use of org.junit.rules.TemporaryFolder in project GeoGig by boundlessgeo.
the class GeogigPy4JEntryPointTest method setUpDirectories.
@Before
public void setUpDirectories() throws IOException {
tempFolder = new TemporaryFolder();
tempFolder.create();
File homeDirectory = tempFolder.newFolder("fakeHomeDir").getCanonicalFile();
File currentDirectory = tempFolder.newFolder("testrepo").getCanonicalFile();
GlobalState.platform = new TestPlatform(currentDirectory, homeDirectory);
GlobalContextBuilder.builder = new CLITestContextBuilder(platform);
}
use of org.junit.rules.TemporaryFolder in project android_frameworks_base by crdroidandroid.
the class DiskStatsFileLoggerTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
mOutputFile = temporaryFolder.newFile();
mMainResult = new FileCollector.MeasurementResult();
mDownloadsResult = new FileCollector.MeasurementResult();
mPackages = new ArrayList<>();
}
use of org.junit.rules.TemporaryFolder in project android_frameworks_base by crdroidandroid.
the class DiskStatsLoggingServiceTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
MockitoAnnotations.initMocks(this);
mTemporaryFolder = new TemporaryFolder();
mTemporaryFolder.create();
mInputFile = mTemporaryFolder.newFile();
mDownloads = new TemporaryFolder();
mDownloads.create();
mRootDirectory = new TemporaryFolder();
mRootDirectory.create();
}
use of org.junit.rules.TemporaryFolder in project lionengine by b3dgs.
the class UtilFolderTest method testGetDirectories.
/**
* Test the get directories from path.
*
* @throws IOException If error.
*/
@Test
public void testGetDirectories() throws IOException {
final File dir = TEMP.newFolder("temp");
final File file = File.createTempFile("temp", ".tmp", dir);
final List<File> expected = new ArrayList<>();
for (int i = 0; i < 5; i++) {
final TemporaryFolder folder = new TemporaryFolder(dir);
folder.create();
expected.add(folder.getRoot());
}
Collections.sort(expected);
final List<File> found = UtilFolder.getDirectories(dir);
Collections.sort(found);
Assert.assertEquals(expected, found);
Assert.assertTrue(file.delete());
for (final File current : expected) {
Assert.assertTrue(current.delete());
}
Assert.assertTrue(dir.delete());
}
use of org.junit.rules.TemporaryFolder in project latexdraw by arnobl.
the class TestIPicture method setUp.
@Before
public void setUp() throws IOException {
shape = ShapeFactory.INST.createPicture(ShapeFactory.INST.createPoint());
folder = new TemporaryFolder();
folder.create();
path = ParameteriseShapeData.INST.getTestPNG(folder);
shape.setPathSource(path.toString());
}
Aggregations