Skip to content

Commit

Permalink
More test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ragadeeshu committed May 21, 2018
1 parent eb0e2aa commit 1f0285d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
Expand Up @@ -107,19 +107,6 @@ public void shouldCreateIndex() throws Exception
}
}

@Test
public void shouldGetUndecidedVersionAndKeyFromIndexReference() throws Exception
{
try ( Transaction transaction = session.beginTransaction() )
{
transaction.schemaWrite().indexCreate( labelDescriptor( label, prop1 ) );
IndexReference index = transaction.schemaRead().index( label, prop1 );

assertThat( index.providerKey(), equalTo( "Undecided" ));
assertThat( index.providerVersion(), equalTo( "0" ));
}
}

@Test
public void createdIndexShouldPopulateInTx() throws Exception
{
Expand Down
Expand Up @@ -120,7 +120,7 @@ public void shouldDropIndexIfPopulationFails() throws Exception

IndexingService indexingService = mock( IndexingService.class );
IndexProxy indexProxy = mock( IndexProxy.class );
when( indexingService.getIndexProxy( 2468L ) ).thenReturn( indexProxy );
when( indexingService.getIndexProxy( INDEX_ID ) ).thenReturn( indexProxy );
when( indexingService.getIndexProxy( descriptor ) ).thenReturn( indexProxy );

IndexEntryConflictException cause = new IndexEntryConflictException( 2, 1, Values.of( "a" ) );
Expand Down
Expand Up @@ -649,6 +649,9 @@ public void closingOfValidatedUpdatesShouldCloseUpdaters() throws Exception
int labelId1 = 24;
int labelId2 = 42;

StoreIndexDescriptor index1 = storeIndex( indexId1, labelId1, propertyKeyId, PROVIDER_DESCRIPTOR );
StoreIndexDescriptor index2 = storeIndex( indexId2, labelId2, propertyKeyId, PROVIDER_DESCRIPTOR );

IndexingService indexing = newIndexingServiceWithMockedDependencies( populator, accessor, withData() );

IndexAccessor accessor1 = mock( IndexAccessor.class );
Expand All @@ -659,15 +662,13 @@ public void closingOfValidatedUpdatesShouldCloseUpdaters() throws Exception
IndexUpdater updater2 = mock( IndexUpdater.class );
when( accessor2.newUpdater( any( IndexUpdateMode.class ) ) ).thenReturn( updater2 );

when( indexProvider.getOnlineAccessor( any( StoreIndexDescriptor.class ),
any( IndexSamplingConfig.class ) ) ).thenReturn( accessor1 );
when( indexProvider.getOnlineAccessor( any( StoreIndexDescriptor.class ),
any( IndexSamplingConfig.class ) ) ).thenReturn( accessor2 );
when( indexProvider.getOnlineAccessor( eq( index1 ), any( IndexSamplingConfig.class ) ) ).thenReturn( accessor1 );
when( indexProvider.getOnlineAccessor( eq( index2 ), any( IndexSamplingConfig.class ) ) ).thenReturn( accessor2 );

life.start();

indexing.createIndexes( storeIndex( indexId1, labelId1, propertyKeyId, PROVIDER_DESCRIPTOR ) );
indexing.createIndexes( storeIndex( indexId2, labelId2, propertyKeyId, PROVIDER_DESCRIPTOR ) );
indexing.createIndexes( index1 );
indexing.createIndexes( index2 );

waitForIndexesToComeOnline( indexing, indexId1, indexId2 );

Expand Down

0 comments on commit 1f0285d

Please sign in to comment.