From ed8b83338e9a45a6f2e9a14d23e29acb580bb5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Finn=C3=A9?= Date: Wed, 19 Sep 2018 12:07:05 +0200 Subject: [PATCH] IndexBackupIT tests index provider that has Lucene Because it tests lucene-specific behaviour of file snapshots. --- .../org/neo4j/index/backup/IndexBackupIT.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/community/community-it/index-it/src/test/java/org/neo4j/index/backup/IndexBackupIT.java b/community/community-it/index-it/src/test/java/org/neo4j/index/backup/IndexBackupIT.java index b3414e499b19c..2cf9e2d8ea4eb 100644 --- a/community/community-it/index-it/src/test/java/org/neo4j/index/backup/IndexBackupIT.java +++ b/community/community-it/index-it/src/test/java/org/neo4j/index/backup/IndexBackupIT.java @@ -21,7 +21,6 @@ import org.apache.commons.io.FilenameUtils; import org.apache.lucene.index.IndexFileNames; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -38,6 +37,7 @@ import org.neo4j.graphdb.Node; import org.neo4j.graphdb.ResourceIterator; import org.neo4j.graphdb.Transaction; +import org.neo4j.graphdb.factory.GraphDatabaseSettings; import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.kernel.impl.api.index.IndexingService; import org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer; @@ -59,23 +59,16 @@ public class IndexBackupIT @Rule public RandomRule randomRule = new RandomRule(); @Rule - public EmbeddedDatabaseRule database = new EmbeddedDatabaseRule(); + public EmbeddedDatabaseRule database = new EmbeddedDatabaseRule().startLazily(); private CheckPointer checkPointer; private IndexingService indexingService; private FileSystemAbstraction fileSystem; - @Before - public void setUp() - { - checkPointer = resolveDependency( CheckPointer.class ); - indexingService = resolveDependency( IndexingService.class ); - fileSystem = resolveDependency( FileSystemAbstraction.class ); - } - @Test - public void concurrentIndexSnapshotUseDifferentSnapshots() throws Exception + public void concurrentLuceneIndexSnapshotUseDifferentSnapshots() throws Exception { Label label = Label.label( "testLabel" ); + database.withSetting( GraphDatabaseSettings.default_schema_provider, GraphDatabaseSettings.SchemaIndex.NATIVE20.providerIdentifier() ); prepareDatabase( label ); forceCheckpoint( checkPointer ); @@ -105,7 +98,6 @@ public void concurrentIndexSnapshotUseDifferentSnapshots() throws Exception firstCheckpointSnapshot.close(); secondCheckpointSnapshot.close(); thirdCheckpointSnapshot.close(); - } @Test @@ -221,6 +213,10 @@ private void prepareDatabase( Label label ) { database.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES ); } + + checkPointer = resolveDependency( CheckPointer.class ); + indexingService = resolveDependency( IndexingService.class ); + fileSystem = resolveDependency( FileSystemAbstraction.class ); } private void generateData( Label label )