From 1e65e54fd1029dcdc237738393cb70685617abeb Mon Sep 17 00:00:00 2001 From: RagnarW Date: Fri, 4 May 2018 14:33:09 +0200 Subject: [PATCH] updated tests --- .../catchup/storecopy/CatchupServerIT.java | 8 ++------ .../catchup/storecopy/PrepareStoreCopyFilesTest.java | 10 ++++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/CatchupServerIT.java b/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/CatchupServerIT.java index 6f0ed69cfd0f7..ceab9413d2a05 100644 --- a/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/CatchupServerIT.java +++ b/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/CatchupServerIT.java @@ -148,7 +148,8 @@ public void shouldListExpectedFilesCorrectly() throws Exception assertTransactionIdMatches( prepareStoreCopyResponse.lastTransactionId() ); //and - assertIndexIdsAreEmpty( prepareStoreCopyResponse.getIndexIds() ); + assertTrue( "Expected an empty set of ids. Found size " + prepareStoreCopyResponse.getIndexIds().size(), + prepareStoreCopyResponse.getIndexIds().isEmpty() ); } @Test @@ -277,11 +278,6 @@ private void listOfDownloadedFilesMatchesServer( NeoStoreDataSource neoStoreData assertThat( givenFile, containsInAnyOrder( expectedStoreFiles.toArray( new String[givenFile.size()] ) ) ); } - private void assertIndexIdsAreEmpty( PrimitiveLongSet indexIds ) - { - assertTrue( indexIds.isEmpty() ); - } - private PrimitiveLongSet getExpectedIndexIds( NeoStoreDataSource neoStoreDataSource ) { return neoStoreDataSource.getNeoStoreFileListing().getNeoStoreFileIndexListing().getIndexIds(); diff --git a/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/PrepareStoreCopyFilesTest.java b/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/PrepareStoreCopyFilesTest.java index a2b47c3ec32a2..547bfa8b0b0e7 100644 --- a/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/PrepareStoreCopyFilesTest.java +++ b/enterprise/causal-clustering/src/test/java/org/neo4j/causalclustering/catchup/storecopy/PrepareStoreCopyFilesTest.java @@ -26,6 +26,8 @@ import java.io.File; import java.io.IOException; import java.util.Arrays; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import org.neo4j.collection.primitive.Primitive; import org.neo4j.collection.primitive.PrimitiveLongSet; @@ -129,11 +131,11 @@ public void shouldHandleEmptyDescriptors() } @Test - public void shouldReturnEmptySetOfIds() + public void shouldReturnEmptySetOfIdsAndIgnoreIndexListing() { - PrimitiveLongSet expectedIndexIds = Primitive.longSet(); - expectedIndexIds.add( 42 ); - when( indexListingMock.getIndexIds() ).thenReturn( expectedIndexIds ); + PrimitiveLongSet existingIds = Primitive.longSet(); + existingIds.add( 42 ); + when( indexListingMock.getIndexIds() ).thenReturn( existingIds ); PrimitiveLongSet actualIndexIndexIds = prepareStoreCopyFiles.getNonAtomicIndexIds();