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();
}
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();
}
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();
}
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"));
}
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"));
}
Aggregations