Android JUNIT テストケースのセットアップでファイルを作成しようとしています:
protected void setUp() throws Exception {
super.setUp();
File storageDirectory = new File("testDir");
storageDirectory.mkdir();
File storageFile = new File(storageDirectory.getAbsolutePath()
+ "/test.log");
if (!storageFile.exists()) {
storageFile.createNewFile();
}
mContext = new InternalStorageMockContext(storageFile);
mContextWrapper = new ContextWrapper(mContext);
}
createNewFile を呼び出すと、No such File or Directory という例外が発生します。Android JUNIT からファイルを作成する標準的な方法はありますか?