Package org.neo4j.kernel

Examples of org.neo4j.kernel.EmbeddedGraphDatabase


    @Test
    public void testStartupInExistingDirectory() {
    File dir = new File("target" + File.separator + "temp" + File.separator);
        Neo4jTestCase.deleteFileOrDirectory( dir );
        dir.mkdir();
        EmbeddedGraphDatabase graphDatabase = new EmbeddedGraphDatabase( dir.getAbsolutePath() );
        Index<Node> index = graphDatabase.index().forNodes("nodes");
        assertNotNull(index);
    }
View Full Code Here


   
    @Test
    public void makeSureStoreWithDecentStringBlockSizeCanBeUpgraded() throws Exception
    {
        String path = path( 7 );
        new EmbeddedGraphDatabase( path ).shutdown();
        setBlockSize( new File( path, "neostore.propertystore.db.strings" ), 0xFFFF, "StringPropertyStore v0.9.5" );
        assertCanStart( path );
    }
View Full Code Here

   
    @Test
    public void makeSureStoreWithTooBigArrayBlockSizeCannotBeUpgraded() throws Exception
    {
        String path = path( 8 );
        new EmbeddedGraphDatabase( path ).shutdown();
        setBlockSize( new File( path, "neostore.propertystore.db.arrays" ), 0x10000, "ArrayPropertyStore v0.9.5" );
        assertCannotStart( path, "Shouldn't be able to upgrade with block size that big" );
    }
View Full Code Here

   
    @Test
    public void makeSureStoreWithDecentArrayBlockSizeCanBeUpgraded() throws Exception
    {
        String path = path( 9 );
        new EmbeddedGraphDatabase( path ).shutdown();
        setBlockSize( new File( path, "neostore.propertystore.db.arrays" ), 0xFFFF, "ArrayPropertyStore v0.9.5" );
        assertCanStart( path );
    }
View Full Code Here

    {
        // Generate some logical logs
        String path = path( 10 );
        for ( int i = 0; i < 3; i++ )
        {
            new EmbeddedGraphDatabase( path, stringMap( KEEP_LOGICAL_LOGS, "true" ) ).shutdown();
        }
       
        setOlderNeoStoreVersion( path );
        new EmbeddedGraphDatabase( path, stringMap( ALLOW_STORE_UPGRADE, "true" ) ).shutdown();
       
        File oldLogDir = new File( path, "1.2-logs" );
        assertTrue( oldLogDir.exists() );
        assertTrue( new File( oldLogDir, "nioneo_logical.log.v0" ).exists() );
        assertTrue( new File( oldLogDir, "nioneo_logical.log.v1" ).exists() );
View Full Code Here

   
    @Test
    public void makeSureStoreCantBeUpgradedIfNotExplicitlyToldTo() throws Exception
    {
        String path = path( 11 );
        new EmbeddedGraphDatabase( path ).shutdown();
        setOlderNeoStoreVersion( path );
       
        try
        {
            new EmbeddedGraphDatabase( path );
            fail( "Shouldn't be able to upgrade if not told to" );
        }
        catch ( TransactionFailureException e )
        {
            if ( !( e.getCause() instanceof IllegalStoreVersionException ) )
View Full Code Here

   
    @Test
    public void makeSureStoreCantBeUpgradedIfNotExplicitlyToldTo2() throws Exception
    {
        String path = path( 12 );
        new EmbeddedGraphDatabase( path ).shutdown();
        setOlderNeoStoreVersion( path );
       
        try
        {
            new EmbeddedGraphDatabase( path, stringMap( ALLOW_STORE_UPGRADE, "false" ) );
            fail( "Shouldn't be able to upgrade if not told to" );
        }
        catch ( TransactionFailureException e )
        {
            if ( !( e.getCause() instanceof IllegalStoreVersionException ) )
View Full Code Here

   
    @Test
    public void makeSureStoreCanBeUpgradedIfExplicitlyToldTo() throws Exception
    {
        String path = path( 13 );
        new EmbeddedGraphDatabase( path ).shutdown();
        setOlderNeoStoreVersion( path );
        new EmbeddedGraphDatabase( path, stringMap( ALLOW_STORE_UPGRADE, "true" ) ).shutdown();
    }
View Full Code Here

   
    @Test
    public void makeSureStoreCantBeUpgradedByBatchInserterEvenIfExplicitlyToldTo() throws Exception
    {
        String path = path( 14 );
        new EmbeddedGraphDatabase( path ).shutdown();
        setOlderNeoStoreVersion( path );
       
        try
        {
            new BatchInserterImpl( path, stringMap( ALLOW_STORE_UPGRADE, "true" ) );
View Full Code Here

    private void assertCannotStart( String path, String failMessage )
    {
        GraphDatabaseService db = null;
        try
        {
            db = new EmbeddedGraphDatabase( path );
            fail( failMessage );
        }
        catch ( TransactionFailureException e )
        {
            if ( !( e.getCause() instanceof IllegalStoreVersionException ) )
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.EmbeddedGraphDatabase

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.