Skip to content

Commit

Permalink
IndexBackupIT tests index provider that has Lucene
Browse files Browse the repository at this point in the history
Because it tests lucene-specific behaviour of file snapshots.
  • Loading branch information
tinwelint committed Sep 24, 2018
1 parent 6bcb904 commit ed8b833
Showing 1 changed file with 8 additions and 12 deletions.
Expand Up @@ -21,7 +21,6 @@


import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.IndexFileNames;
import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;


Expand All @@ -38,6 +37,7 @@
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.ResourceIterator; import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.kernel.impl.api.index.IndexingService; import org.neo4j.kernel.impl.api.index.IndexingService;
import org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer; import org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer;
Expand All @@ -59,23 +59,16 @@ public class IndexBackupIT
@Rule @Rule
public RandomRule randomRule = new RandomRule(); public RandomRule randomRule = new RandomRule();
@Rule @Rule
public EmbeddedDatabaseRule database = new EmbeddedDatabaseRule(); public EmbeddedDatabaseRule database = new EmbeddedDatabaseRule().startLazily();
private CheckPointer checkPointer; private CheckPointer checkPointer;
private IndexingService indexingService; private IndexingService indexingService;
private FileSystemAbstraction fileSystem; private FileSystemAbstraction fileSystem;


@Before
public void setUp()
{
checkPointer = resolveDependency( CheckPointer.class );
indexingService = resolveDependency( IndexingService.class );
fileSystem = resolveDependency( FileSystemAbstraction.class );
}

@Test @Test
public void concurrentIndexSnapshotUseDifferentSnapshots() throws Exception public void concurrentLuceneIndexSnapshotUseDifferentSnapshots() throws Exception
{ {
Label label = Label.label( "testLabel" ); Label label = Label.label( "testLabel" );
database.withSetting( GraphDatabaseSettings.default_schema_provider, GraphDatabaseSettings.SchemaIndex.NATIVE20.providerIdentifier() );
prepareDatabase( label ); prepareDatabase( label );


forceCheckpoint( checkPointer ); forceCheckpoint( checkPointer );
Expand Down Expand Up @@ -105,7 +98,6 @@ public void concurrentIndexSnapshotUseDifferentSnapshots() throws Exception
firstCheckpointSnapshot.close(); firstCheckpointSnapshot.close();
secondCheckpointSnapshot.close(); secondCheckpointSnapshot.close();
thirdCheckpointSnapshot.close(); thirdCheckpointSnapshot.close();

} }


@Test @Test
Expand Down Expand Up @@ -221,6 +213,10 @@ private void prepareDatabase( Label label )
{ {
database.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES ); database.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
} }

checkPointer = resolveDependency( CheckPointer.class );
indexingService = resolveDependency( IndexingService.class );
fileSystem = resolveDependency( FileSystemAbstraction.class );
} }


private void generateData( Label label ) private void generateData( Label label )
Expand Down

0 comments on commit ed8b833

Please sign in to comment.