use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class StartClientIT method shouldNotStartBolt.
@Test
public void shouldNotStartBolt() throws IOException {
// Given
AssertableLogProvider log = new AssertableLogProvider();
// When
new StartClient(System.out, System.err) {
@Override
protected GraphDatabaseShellServer getGraphDatabaseShellServer(File path, boolean readOnly, String configFile) throws RemoteException {
return new GraphDatabaseShellServer(new TestGraphDatabaseFactory().setUserLogProvider(log), path, readOnly, configFile);
}
}.start(new String[] { "-c", "RETURN 1;", "-path", db.getStoreDir(), "-config", getClass().getResource("/config-with-bolt-connector.conf").getFile() }, mock(CtrlCHandler.class));
// Then
log.assertNone(inLog(startsWith(WorkerFactory.class.getPackage().getName())).any());
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class FakeShellServer method doBefore.
@Before
public void doBefore() throws Exception {
db = (GraphDatabaseAPI) new TestGraphDatabaseFactory().newImpermanentDatabase();
shellServer = new FakeShellServer(db);
shellClient = new SameJvmClient(new HashMap<String, Serializable>(), shellServer, new CollectingOutput());
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class ServerProcess method startup.
@Override
public void startup(Pair<File, String> config) throws Throwable {
File storeDir = config.first();
String backupConfigValue = config.other();
if (backupConfigValue == null) {
this.db = new TestGraphDatabaseFactory().newEmbeddedDatabase(storeDir);
} else {
// TODO This is using the old config style - is this class even used anywhere!?
this.db = new TestGraphDatabaseFactory().newEmbeddedDatabaseBuilder(storeDir).setConfig("enable_online_backup", backupConfigValue).newGraphDatabase();
}
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class SchemaIndexProviderApprovalTest method init.
@BeforeClass
public static void init() {
GraphDatabaseService db = new TestGraphDatabaseFactory().newImpermanentDatabase();
for (TestValue value : TestValue.values()) {
createNode(db, PROPERTY_KEY, value.value);
}
noIndexRun = runFindByLabelAndProperty(db);
createIndex(db, label(LABEL), PROPERTY_KEY);
indexRun = runFindByLabelAndProperty(db);
db.shutdown();
}
use of org.neo4j.test.TestGraphDatabaseFactory in project neo4j by neo4j.
the class StoreLockerTest method mustPreventMultipleInstancesFromStartingOnSameStore.
@Test
public void mustPreventMultipleInstancesFromStartingOnSameStore() {
File storeDir = target.graphDbDir();
GraphDatabaseService db = new TestGraphDatabaseFactory().newEmbeddedDatabase(storeDir);
try (Transaction tx = db.beginTx()) {
db.createNode();
tx.success();
}
try {
new TestGraphDatabaseFactory().newEmbeddedDatabase(storeDir);
fail("Should not be able to start up another db in the same dir");
} catch (Exception e) {
// Good
} finally {
db.shutdown();
}
}
Aggregations