Search in sources :

Example 16 with TemporaryFolder

use of org.junit.rules.TemporaryFolder in project xodus by JetBrains.

the class JMHMapDbTokyoCabinetBenchmarkBase method createEnvironment.

private void createEnvironment() throws IOException {
    closeDb();
    temporaryFolder = new TemporaryFolder();
    temporaryFolder.create();
    db = DBMaker.tempFileDB().fileMmapEnable().concurrencyDisable().make();
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder)

Example 17 with TemporaryFolder

use of org.junit.rules.TemporaryFolder in project xodus by JetBrains.

the class JMHPersistItTokyoCabinetBenchmarkBase method createEnvironment.

private void createEnvironment() throws IOException, PersistitException {
    closeDb();
    temporaryFolder = new TemporaryFolder();
    temporaryFolder.create();
    persistit = new Persistit();
    persistit.setPersistitLogger(new Slf4jAdapter(LoggerFactory.getLogger("PERSISTIT")));
    Properties props = new Properties();
    props.setProperty("datapath", temporaryFolder.getRoot().getAbsolutePath());
    props.setProperty("logpath", "${datapath}/log");
    props.setProperty("logfile", "${logpath}/persistit_${timestamp}.log");
    props.setProperty("buffer.count.8192", "5000");
    props.setProperty("journalpath", "${datapath}/journal");
    props.setProperty("tmpvoldir", "${datapath}");
    props.setProperty("volume.1", "${datapath}/persistit,create,pageSize:8192,initialPages:10,extensionPages:100,maximumPages:25000");
    props.setProperty("jmx", "false");
    persistit.setProperties(props);
    persistit.initialize();
    volume = persistit.createTemporaryVolume();
}
Also used : Slf4jAdapter(com.persistit.logging.Slf4jAdapter) Persistit(com.persistit.Persistit) TemporaryFolder(org.junit.rules.TemporaryFolder) Properties(java.util.Properties)

Example 18 with TemporaryFolder

use of org.junit.rules.TemporaryFolder in project xodus by JetBrains.

the class JMH_MVStoreTokyoCabinetBenchmarkBase method createEnvironment.

private void createEnvironment() throws IOException {
    closeStore();
    temporaryFolder = new TemporaryFolder();
    temporaryFolder.create();
    store = new MVStore.Builder().fileName(temporaryFolder.newFile("data").getAbsolutePath()).autoCommitDisabled().open();
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder)

Example 19 with TemporaryFolder

use of org.junit.rules.TemporaryFolder in project xodus by JetBrains.

the class JMHChronicleMapTokyoCabinetBenchmarkBase method createEnvironment.

private void createEnvironment() throws IOException {
    closeTxMaker();
    temporaryFolder = new TemporaryFolder();
    temporaryFolder.create();
    map = ChronicleMap.of(String.class, String.class).averageKeySize(8).averageValueSize(8).entries(randomKeys.length).createPersistedTo(temporaryFolder.newFile("data"));
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder)

Example 20 with TemporaryFolder

use of org.junit.rules.TemporaryFolder in project accumulo by apache.

the class DumpConfigIT method test.

@Test
public void test() throws Exception {
    File target = new File(System.getProperty("user.dir"), "target");
    assertTrue(target.exists() || target.mkdirs());
    TemporaryFolder folder = new TemporaryFolder(target);
    folder.create();
    File siteFileBackup = new File(folder.getRoot(), "accumulo-site.xml.bak");
    assertFalse(siteFileBackup.exists());
    assertEquals(0, exec(Admin.class, new String[] { "dumpConfig", "-a", "-d", folder.getRoot().getPath() }).waitFor());
    assertTrue(siteFileBackup.exists());
    String site = FunctionalTestUtils.readAll(new FileInputStream(siteFileBackup));
    assertTrue(site.contains(Property.TABLE_FILE_BLOCK_SIZE.getKey()));
    assertTrue(site.contains("1234567"));
    String meta = FunctionalTestUtils.readAll(new FileInputStream(new File(folder.getRoot(), MetadataTable.NAME + ".cfg")));
    assertTrue(meta.contains(Property.TABLE_FILE_REPLICATION.getKey()));
    String systemPerm = FunctionalTestUtils.readAll(new FileInputStream(new File(folder.getRoot(), "root_user.cfg")));
    assertTrue(systemPerm.contains("grant System.ALTER_USER -s -u root"));
    assertTrue(systemPerm.contains("grant Table.READ -t " + MetadataTable.NAME + " -u root"));
    assertFalse(systemPerm.contains("grant Table.DROP -t " + MetadataTable.NAME + " -u root"));
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) File(java.io.File) FileInputStream(java.io.FileInputStream) Test(org.junit.Test)

Aggregations

TemporaryFolder (org.junit.rules.TemporaryFolder)88 File (java.io.File)33 Test (org.junit.Test)25 Before (org.junit.Before)24 BeforeClass (org.junit.BeforeClass)13 Path (java.nio.file.Path)7 URL (java.net.URL)6 IOException (java.io.IOException)3 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 DocumentMetaData (de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 URISyntaxException (java.net.URISyntaxException)2 BdpDataPlanePlugin (org.batfish.bdp.BdpDataPlanePlugin)2 Batfish (org.batfish.main.Batfish)2 DefaultSafeModeManager (alluxio.master.DefaultSafeModeManager)1 InMemoryReferenceSequenceFile (au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile)1 SynchronousReferenceLookupAdapter (au.edu.wehi.idsv.picard.SynchronousReferenceLookupAdapter)1