Search in sources :

Example 66 with TemporaryFolder

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);
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) CLITestContextBuilder(org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder) Before(org.junit.Before)

Example 67 with TemporaryFolder

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<>();
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) Before(org.junit.Before)

Example 68 with TemporaryFolder

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();
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) Before(org.junit.Before)

Example 69 with TemporaryFolder

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());
}
Also used : ArrayList(java.util.ArrayList) TemporaryFolder(org.junit.rules.TemporaryFolder) File(java.io.File) Test(org.junit.Test)

Example 70 with TemporaryFolder

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());
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) Before(org.junit.Before)

Aggregations

TemporaryFolder (org.junit.rules.TemporaryFolder)106 File (java.io.File)40 Before (org.junit.Before)28 Test (org.junit.Test)28 BeforeClass (org.junit.BeforeClass)13 URL (java.net.URL)7 Path (java.nio.file.Path)7 IOException (java.io.IOException)5 ArrayList (java.util.ArrayList)3 UserState (alluxio.security.user.UserState)2 ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)2 RocksDBPersistenceProvider (com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 URISyntaxException (java.net.URISyntaxException)2 BdpDataPlanePlugin (org.batfish.bdp.BdpDataPlanePlugin)2 Batfish (org.batfish.main.Batfish)2 NotNull (org.jetbrains.annotations.NotNull)2 DefaultSafeModeManager (alluxio.master.DefaultSafeModeManager)1 InMemoryReferenceSequenceFile (au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile)1 SynchronousReferenceLookupAdapter (au.edu.wehi.idsv.picard.SynchronousReferenceLookupAdapter)1