Skip to content
Browse files

Fixes for a recent migration commit.

 - Fixed remaining hard references to legacy version v0.9.9 instead of using
   LegacyStore.LEGACY_VERSION.
 - Increased expected max ID of node store in a test due to the previous
   store migration code increasing max ID one too much even if the last ID
   wasn't in use.
  • Loading branch information...
1 parent 38c134c commit 8288187dbd9577af3148eacb0dad0e8ba4377ead @tinwelint tinwelint committed
View
2 community/kernel/src/test/java/org/neo4j/kernel/impl/nioneo/store/UpgradeStoreIT.java
@@ -296,7 +296,7 @@ private void setBlockSize( File file, int blockSize, String oldVersionToSet ) th
buffer.flip();
channel.write( buffer );
- // It's the same length as the current version v0.9.9
+ // It's the same length as the current version
channel.position( channel.size() - UTF8.encode( oldVersionToSet ).length );
buffer = ByteBuffer.wrap( UTF8.encode( oldVersionToSet ) );
channel.write( buffer );
View
2 ...ernel/src/test/java/org/neo4j/kernel/impl/storemigration/StoreUpgradeIntegrationTest.java
@@ -91,7 +91,7 @@ public void shouldAbortOnCorruptStore() throws IOException
assertTrue( allStoreFilesHaveVersion( fileSystem, workingDirectory, LEGACY_VERSION ) );
truncateFile(fileSystem, new File( workingDirectory,
"neostore.propertystore.db.index.keys" ),
- "StringPropertyStore v0.9.9" );
+ "StringPropertyStore " + LEGACY_VERSION );
Map<String, String> params = new HashMap<String, String>();
params.put( Config.ALLOW_STORE_UPGRADE, "true" );
View
7 ...y/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/UpgradableDatabaseTestIT.java
@@ -28,6 +28,7 @@
import static org.neo4j.kernel.impl.storemigration.MigrationTestUtils.changeVersionNumber;
import static org.neo4j.kernel.impl.storemigration.MigrationTestUtils.truncateFile;
import static org.neo4j.kernel.impl.storemigration.MigrationTestUtils.truncateToFixedLength;
+import static org.neo4j.kernel.impl.storemigration.legacystore.LegacyStore.LEGACY_VERSION;
import static org.neo4j.kernel.impl.util.FileUtils.copyRecursively;
import java.io.File;
@@ -92,7 +93,7 @@ public void shouldRejectStoresIfOneFileHasNoVersionAsIfNotShutDownCleanly() thro
copyRecursively( resourceDirectory, workingDirectory );
- truncateFile( fileSystem, new File( workingDirectory, "neostore.nodestore.db" ), "StringPropertyStore v0.9.9" );
+ truncateFile( fileSystem, new File( workingDirectory, "neostore.nodestore.db" ), "StringPropertyStore " + LEGACY_VERSION );
assertFalse( new UpgradableDatabase(fileSystem).storeFilesUpgradeable( new File( workingDirectory, "neostore" ) ) );
}
@@ -110,7 +111,7 @@ public void shouldRejectStoresIfOneFileShorterThanExpectedVersionString() throws
copyRecursively( resourceDirectory, workingDirectory );
int shortFileLength = 5 /* (RelationshipTypeStore.RECORD_SIZE) */ * 3;
- assertTrue( shortFileLength < UTF8.encode( "StringPropertyStore v0.9.9" ).length );
+ assertTrue( shortFileLength < UTF8.encode( "StringPropertyStore " + LEGACY_VERSION ).length );
truncateToFixedLength( fileSystem, new File( workingDirectory, "neostore.relationshiptypestore.db" ), shortFileLength );
assertFalse( new UpgradableDatabase(fileSystem).storeFilesUpgradeable( new File( workingDirectory, "neostore" ) ) );
@@ -140,7 +141,7 @@ public void shouldCommunicateWhatCausesInabilityToUpgrade() throws IOException
catch (StoreUpgrader.UnableToUpgradeException e)
{
assertThat( e.getMessage(), is("'neostore.nodestore.db' has a store version number that we cannot upgrade " +
- "from. Expected 'NodeStore v0.9.9' but file is version 'NodeStore v0.9.5'.") );
+ "from. Expected 'NodeStore " + LEGACY_VERSION + "' but file is version 'NodeStore v0.9.5'.") );
}
}
}
View
2 ...nel/src/test/java/org/neo4j/kernel/impl/storemigration/legacystore/ReadRecordsTestIT.java
@@ -38,7 +38,7 @@ public void shouldReadNodeRecords() throws IOException
URL nodeStoreFile = getClass().getResource( "exampledb/neostore.nodestore.db" );
LegacyNodeStoreReader nodeStoreReader = new LegacyNodeStoreReader( fs, new File( nodeStoreFile.getFile() ) );
- assertEquals( 1001, nodeStoreReader.getMaxId() );
+ assertEquals( 1002, nodeStoreReader.getMaxId() );
Iterable<NodeRecord> records = nodeStoreReader.readNodeStore();
int nodeCount = 0;
for ( NodeRecord record : records )

0 comments on commit 8288187

Please sign in to comment.
Something went wrong with that request. Please try again.