Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.GraphDatabaseService.shutdown()


        }
        finally
        {
            if ( db != null )
            {
                db.shutdown();
            }
        }
    }
   
    private void setOlderNeoStoreVersion( String path ) throws IOException
View Full Code Here


        assertEquals( nodeAboveTheLine, edb.getNodeById( highMark ).getId() );
        assertEquals( relBelowTheLine, edb.getNodeById( idBelow ).getSingleRelationship( this, Direction.OUTGOING ).getId() );
        assertEquals( relAboveTheLine, edb.getNodeById( idBelow ).getSingleRelationship( this, Direction.INCOMING ).getId() );
        assertEquals(   asSet( asList( edb.getRelationshipById( relBelowTheLine ), edb.getRelationshipById( relAboveTheLine ) ) ),
                        asSet( asCollection( edb.getNodeById( idBelow ).getRelationships() ) ) );
        edb.shutdown();
        db = new BatchInserterImpl( PATH );
    }
   
    @Test( expected=IllegalArgumentException.class )
    public void makeSureCantCreateNodeWithMagicNumber()
View Full Code Here

        {
            assertTrue( rels.contains( rel ) );
            assertEquals( rel.getStartNode(), startNode );
        }
        setProperties( startNode );
        graphDb.shutdown();
    }
   
    @Test
    public void testGraphDbServiceGetRelationships()
    {
View Full Code Here

            Iterator<Relationship> relItr =
                startNode.getRelationships( relTypeArray[i] ).iterator();
            relItr.next();
            assertTrue( !relItr.hasNext() );
        }
        graphDb.shutdown();
    }
}
View Full Code Here

        }
        assertContains( dbIndex.query( "name", "Joe*" ),
                nodes.toArray( new Node[nodes.size()] ) );
        assertContains( dbIndex.query( "name:Joe0 AND other:Schmoe" ),
                db.getNodeById( ids.get( 0 ) ) );
        db.shutdown();
    }

    @Test
    public void testFulltext()
    {
View Full Code Here

        GraphDatabaseService db = new EmbeddedGraphDatabase( path );
        Index<Node> dbIndex = db.index().forNodes( name );
        Node node1 = db.getNodeById( id1 );
        Node node2 = db.getNodeById( id2 );
        assertContains( dbIndex.query( "name", "persson" ), node1, node2 );
        db.shutdown();
    }

    @Ignore
    @Test
    public void testInsertionSpeed()
View Full Code Here

        {
            return of( db );
        }
        finally
        {
            db.shutdown();
        }
    }
   
    public long getHighestNodeId()
    {
View Full Code Here

            tx.success();
            tx.finish();
        }
        finally
        {
            graphDb.shutdown();
        }
    }

    @Test
    public void testCanIndexRelationships()
View Full Code Here

        GraphDatabaseService db = new EmbeddedGraphDatabase( path );
        Node n1 = db.getNodeById( node1 );
        Node n2 = db.getNodeById( node2 );
        Index<Node> idx = db.index().forNodes( "mine" );
        assertContains( idx.query( "number", newIntRange( "number", 21, 45, false, true ) ), n1 );
        db.shutdown();
    }
   
    @Test
    public void indexNumbers() throws Exception
    {
View Full Code Here

        assertTrue( handler1 == graphDb.unregisterKernelEventHandler(
                handler1 ) );
        assertTrue( handler2 == graphDb.unregisterKernelEventHandler(
                handler2 ) );

        graphDb.shutdown();
    }

    @Test
    public void testShutdownEvents()
    {
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.