Examples of TestGraphDatabaseFactory


Examples of org.neo4j.test.TestGraphDatabaseFactory

    }

    @BeforeClass
    public static void init()
    {
        db = new TestGraphDatabaseFactory( ).newImpermanentDatabase();
        ((ImpermanentGraphDatabase)db).cleanContent(  );
        try
        {
            load();
        }
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

        assertEquals(0,IteratorUtil.count(result));
    }

    @Test
    public void testWithSeparateTransactions() throws Exception {
        final GraphDatabaseService gdb = new TestGraphDatabaseFactory().newImpermanentDatabase();
        final Thread t = new Thread() {
            @Override
            public void run() {
                final Transaction tx = gdb.beginTx();
                final Index<Node> index = gdb.index().forNodes("Test");
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

     * @param sameGraphCypher second graph expressed as a Cypher create statement, which communicates the desired state
     *                        of the database (first parameter) iff the code that created it is correct.
     * @throws AssertionError in case the graphs are not the same.
     */
    public static void assertSameGraph(GraphDatabaseService database, String sameGraphCypher) {
        GraphDatabaseService otherDatabase = new TestGraphDatabaseFactory().newImpermanentDatabase();

        new ExecutionEngine(otherDatabase).execute(sameGraphCypher);

        try {
            assertSameGraph(database, otherDatabase, InclusionPolicies.all());
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

     *                          of the database (first parameter) iff the code that created it is correct.
     * @param inclusionPolicies {@link com.graphaware.common.policy.InclusionPolicies} deciding whether to include nodes/relationships/properties in the comparisons.
     * @throws AssertionError in case the graphs are not the same.
     */
    public static void assertSameGraph(GraphDatabaseService database, String sameGraphCypher, InclusionPolicies inclusionPolicies) {
        GraphDatabaseService otherDatabase = new TestGraphDatabaseFactory().newImpermanentDatabase();

        new ExecutionEngine(otherDatabase).execute(sameGraphCypher);

        try {
            assertSameGraph(database, otherDatabase, inclusionPolicies);
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

     * @param subgraphCypher second graph expressed as a Cypher create statement, which communicates the desired state
     *                       of the database (first parameter) iff the code that created it is correct.
     * @throws AssertionError in case the "cypher" graph is not a subgraph of the "database" graph.
     */
    public static void assertSubgraph(GraphDatabaseService database, String subgraphCypher) {
        GraphDatabaseService otherDatabase = new TestGraphDatabaseFactory().newImpermanentDatabase();

        new ExecutionEngine(otherDatabase).execute(subgraphCypher);

        try {
            assertSubgraph(database, otherDatabase, InclusionPolicies.all());
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

     *                          of the database (first parameter) iff the code that created it is correct.
     * @param inclusionPolicies {@link com.graphaware.common.policy.InclusionPolicies} deciding whether to include nodes/relationships/properties or not.
     * @throws AssertionError in case the "cypher" graph is not a subgraph of the "database" graph.
     */
    public static void assertSubgraph(GraphDatabaseService database, String subgraphCypher, InclusionPolicies inclusionPolicies) {
        GraphDatabaseService otherDatabase = new TestGraphDatabaseFactory().newImpermanentDatabase();

        new ExecutionEngine(otherDatabase).execute(subgraphCypher);

        try {
            assertSubgraph(database, otherDatabase, inclusionPolicies);
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

*/
public class IncludeRelationshipsTest {

    @Test
    public void shouldIncludeCorrectRelationships() {
        GraphDatabaseService database = new TestGraphDatabaseFactory().newImpermanentDatabase();

        try (Transaction tx = database.beginTx()) {
            Node n1 = database.createNode();
            Node n2 = database.createNode();
            Relationship r = n1.createRelationshipTo(n2, withName("TEST"));
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

*/
public class IncludeNodesTest {

    @Test
    public void shouldIncludeCorrectRelationships() {
        GraphDatabaseService database = new TestGraphDatabaseFactory().newImpermanentDatabase();

        try (Transaction tx = database.beginTx()) {
            Node n = database.createNode(label("Test"));
            n.setProperty("test", "test");

View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

     * Instantiate a database. By default this will be {@link org.neo4j.test.ImpermanentGraphDatabase}.
     *
     * @return new database.
     */
    protected GraphDatabaseService createDatabase() {
        return new TestGraphDatabaseFactory().newImpermanentDatabase();
    }
View Full Code Here

Examples of org.neo4j.test.TestGraphDatabaseFactory

    private GraphDatabaseService database;

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

        try (Transaction tx = database.beginTx()) {
            Node root = database.createNode();
            Node one = database.createNode();
            root.createRelationshipTo(one, withName("TEST")).setProperty("k", new int[]{2, 3, 4});
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.