use of org.neo4j.kernel.EmbeddedReadOnlyGraphDatabase in project graphdb by neo4j-attic.
the class TestExceptionTypeOnInvalidIds method createDatabase.
@BeforeClass
public static void createDatabase() {
String storeDir = "target/var/id_test";
AbstractNeo4jTestCase.deleteFileOrDirectory(new File(storeDir));
graphdb = new EmbeddedGraphDatabase(storeDir);
graphDbReadOnly = new EmbeddedReadOnlyGraphDatabase(storeDir);
}
use of org.neo4j.kernel.EmbeddedReadOnlyGraphDatabase in project graphdb by neo4j-attic.
the class TestReadOnlyNeo4j method testSimple.
@Test
public void testSimple() {
DbRepresentation someData = createSomeData();
GraphDatabaseService readGraphDb = new EmbeddedReadOnlyGraphDatabase(PATH);
assertEquals(someData, DbRepresentation.of(readGraphDb));
Transaction tx = readGraphDb.beginTx();
try {
readGraphDb.createNode();
} catch (ReadOnlyDbException e) {
// good
}
tx.finish();
readGraphDb.shutdown();
}
Aggregations