use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class RollingUpgradeIT method startStandaloneDbToRunUpgrade.
private void startStandaloneDbToRunUpgrade(File storeDir, int dbIndex) {
GraphDatabaseService tempDbForUpgrade = null;
try {
debug("Starting standalone db " + dbIndex + " to run upgrade");
tempDbForUpgrade = new TestGraphDatabaseFactory().newEmbeddedDatabaseBuilder(storeDir).setConfig(GraphDatabaseSettings.allow_store_upgrade, "true").newGraphDatabase();
} finally {
if (tempDbForUpgrade != null) {
tempDbForUpgrade.shutdown();
}
}
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class PageCacheMetricsIT method setUp.
@Before
public void setUp() {
metricsDirectory = testDirectory.directory("metrics");
database = new TestGraphDatabaseFactory().newEmbeddedDatabaseBuilder(testDirectory.graphDbDir()).setConfig(MetricsSettings.neoPageCacheEnabled, Settings.TRUE).setConfig(MetricsSettings.csvEnabled, Settings.TRUE).setConfig(MetricsSettings.csvInterval, "100ms").setConfig(MetricsSettings.csvPath, metricsDirectory.getAbsolutePath()).newGraphDatabase();
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class StoreUpgraderInterruptionTestIT method startStopDatabase.
private void startStopDatabase(File workingDirectory) {
GraphDatabaseService databaseService = new TestGraphDatabaseFactory().newEmbeddedDatabase(workingDirectory);
databaseService.shutdown();
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class LuceneIndexRecoveryIT method startDb.
private void startDb(KernelExtensionFactory<?> indexProviderFactory) {
if (db != null) {
db.shutdown();
}
TestGraphDatabaseFactory factory = new TestGraphDatabaseFactory();
factory.setFileSystem(fs.get());
factory.addKernelExtensions(Arrays.<KernelExtensionFactory<?>>asList(indexProviderFactory));
db = (GraphDatabaseAPI) factory.newImpermanentDatabase();
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class IndexSamplingIntegrationTest method fetchIndexSamplingValues.
private DoubleLongRegister fetchIndexSamplingValues(GraphDatabaseService db) throws IndexNotFoundKernelException {
try {
// Then
db = new TestGraphDatabaseFactory().newEmbeddedDatabase(testDirectory.graphDbDir());
@SuppressWarnings("deprecation") GraphDatabaseAPI api = (GraphDatabaseAPI) db;
CountsTracker countsTracker = api.getDependencyResolver().resolveDependency(RecordStorageEngine.class).testAccessNeoStores().getCounts();
IndexSampleKey key = CountsKeyFactory.indexSampleKey(indexId(api));
return countsTracker.get(key, Registers.newDoubleLongRegister());
} finally {
if (db != null) {
db.shutdown();
}
}
}
Aggregations