Package org.neo4j.test

Examples of org.neo4j.test.TestGraphDatabaseFactory


    private GraphDatabaseService database;

    @Before
    public void setUp() {
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();
        new ExecutionEngine(database).execute("CREATE " +
                "(a), " +
                "(b {key:'value'})," +
                "(b)-[:test]->(a)," +
                "(c {key:'value'})");
View Full Code Here


        }
    }

    @Test
    public void shouldDeleteNodeWithAllRelationships() {
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();
        new ExecutionEngine(database).execute("CREATE " +
                "(a), " +
                "(b {name:'node1'})," +
                "(c {name:'node2'})," +
                "(c)-[:test {key1:'value1'}]->(b)," +
View Full Code Here

        }
    }

    private void populateDatabaseWithNumberProperties() {
        database.shutdown();
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();

        try (Transaction tx = database.beginTx()) {
            database.createNode().setProperty("test", (byte) 123);
            database.createNode().setProperty("test", 123);
            database.createNode().setProperty("test", 123L);
View Full Code Here

* Only for documentation. If you need to change this class, change the code in README.md as well please.
*/
public class JustForDocs {

    private void justForDocs() {
        GraphDatabaseService database = new TestGraphDatabaseFactory().newImpermanentDatabase();
        database.registerTransactionEventHandler(new TransactionEventHandler<Object>() {
            @Override
            public Object beforeCommit(TransactionData data) throws Exception {
                ImprovedTransactionData improvedTransactionData = new LazyTransactionData(data);

View Full Code Here

            }
        });
    }

    private void justForDocs2() {
        GraphDatabaseService database = new TestGraphDatabaseFactory().newImpermanentDatabase();
        database.registerTransactionEventHandler(new TransactionEventHandler.Adapter<Object>() {
            @Override
            public Object beforeCommit(TransactionData data) throws Exception {
                InclusionPolicies inclusionPolicies = InclusionPolicies.all()
                        .with(new NodeInclusionPolicy() {
View Full Code Here

    protected PropertyContainer propertyContainer;

    @Before
    public void setUp() {
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();

        try (Transaction tx = database.beginTx()) {
            Node root = database.createNode();
            root.setProperty("two", 2);
            root.setProperty("three", "3");
View Full Code Here

    private GraphDatabaseService database;
    private ExecutionEngine executionEngine;

    @Before
    public void setUp() {
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();
        executionEngine = new ExecutionEngine(database);
    }
View Full Code Here

            return result;
        }
    }

    private void createTestDatabase() {
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();

        new TestDataBuilder(database)
                .node() //ID=0
                .node().setProp("name", "One").setProp("count", 1).setProp("tags", new String[]{"one", "two"})
View Full Code Here

            four.setProperty("name", "Four");
        }
    }

    private void createTestDatabaseForInternalTest() {
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();

        new TestDataBuilder(database)
                .node() //ID=0
                .node().setProp(INTERNAL_NODE_PROPERTY, "whatever").setProp(INTERNAL_PREFIX + "name", "One").setProp(INTERNAL_PREFIX + "count", 1).setProp(INTERNAL_PREFIX + "tags", new String[]{"one", "two"})
View Full Code Here

    public TemporaryFolder temporaryFolder = new TemporaryFolder();

    @Test(timeout = 5000)
    @RepeatRule.Repeat(times = 10)
    public void makeSureDeadlockDoesNotOccur() throws InterruptedException {
        GraphDatabaseService database = new TestGraphDatabaseFactory()
                .newImpermanentDatabaseBuilder()
                .setConfig(RuntimeKernelExtension.RUNTIME_ENABLED, "true")
                .newGraphDatabase();

        Thread.sleep(random.nextInt(10));
View Full Code Here

TOP

Related Classes of org.neo4j.test.TestGraphDatabaseFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.