Search in sources :

Example 16 with EmbeddedGraphDatabase

use of org.neo4j.kernel.EmbeddedGraphDatabase in project graphdb by neo4j-attic.

the class TestUpgradeStore method makeSureStoreWithDecentAmountOfRelationshipTypesCanBeUpgraded.

@Test
public void makeSureStoreWithDecentAmountOfRelationshipTypesCanBeUpgraded() throws Exception {
    String path = path(1);
    new EmbeddedGraphDatabase(path).shutdown();
    createManyRelationshipTypes(path, 0xFFFF);
    assertCanStart(path);
}
Also used : EmbeddedGraphDatabase(org.neo4j.kernel.EmbeddedGraphDatabase) Test(org.junit.Test)

Example 17 with EmbeddedGraphDatabase

use of org.neo4j.kernel.EmbeddedGraphDatabase in project graphdb by neo4j-attic.

the class TestUpgradeStore method makeSureStoreWithTooBigArrayBlockSizeCannotBeUpgraded.

@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");
}
Also used : EmbeddedGraphDatabase(org.neo4j.kernel.EmbeddedGraphDatabase) RandomAccessFile(java.io.RandomAccessFile) File(java.io.File) Test(org.junit.Test)

Example 18 with EmbeddedGraphDatabase

use of org.neo4j.kernel.EmbeddedGraphDatabase in project graphdb by neo4j-attic.

the class TestUpgradeStore method makeSureStoreCantBeUpgradedIfNotExplicitlyToldTo.

@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)) {
            throw e;
        }
    }
}
Also used : EmbeddedGraphDatabase(org.neo4j.kernel.EmbeddedGraphDatabase) TransactionFailureException(org.neo4j.graphdb.TransactionFailureException) Test(org.junit.Test)

Example 19 with EmbeddedGraphDatabase

use of org.neo4j.kernel.EmbeddedGraphDatabase in project graphdb by neo4j-attic.

the class TestUpgradeStore method makeSureStoreWithDecentStringBlockSizeCanBeUpgraded.

@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);
}
Also used : EmbeddedGraphDatabase(org.neo4j.kernel.EmbeddedGraphDatabase) RandomAccessFile(java.io.RandomAccessFile) File(java.io.File) Test(org.junit.Test)

Example 20 with EmbeddedGraphDatabase

use of org.neo4j.kernel.EmbeddedGraphDatabase in project graphdb by neo4j-attic.

the class TestUpgradeStore method makeSureStoreWithDecentArrayBlockSizeCanBeUpgraded.

@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);
}
Also used : EmbeddedGraphDatabase(org.neo4j.kernel.EmbeddedGraphDatabase) RandomAccessFile(java.io.RandomAccessFile) File(java.io.File) Test(org.junit.Test)

Aggregations

EmbeddedGraphDatabase (org.neo4j.kernel.EmbeddedGraphDatabase)84 Test (org.junit.Test)50 File (java.io.File)35 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)32 Node (org.neo4j.graphdb.Node)26 Transaction (org.neo4j.graphdb.Transaction)17 Relationship (org.neo4j.graphdb.Relationship)14 BeforeClass (org.junit.BeforeClass)13 HashMap (java.util.HashMap)7 BatchInserterImpl (org.neo4j.kernel.impl.batchinsert.BatchInserterImpl)6 RandomAccessFile (java.io.RandomAccessFile)5 BatchInserter (org.neo4j.kernel.impl.batchinsert.BatchInserter)5 BatchInserterIndex (org.neo4j.graphdb.index.BatchInserterIndex)4 TransactionManager (javax.transaction.TransactionManager)3 Before (org.junit.Before)3 DynamicRelationshipType (org.neo4j.graphdb.DynamicRelationshipType)3 TransactionFailureException (org.neo4j.graphdb.TransactionFailureException)3 BatchInserterIndexProvider (org.neo4j.graphdb.index.BatchInserterIndexProvider)3 IndexManager (org.neo4j.graphdb.index.IndexManager)3 Transaction (javax.transaction.Transaction)2