Search in sources :

Example 16 with MasterClient

use of org.neo4j.kernel.ha.com.slave.MasterClient in project neo4j by neo4j.

the class MasterClientTest method newClientsShouldNotIgnoreStoreIdDifferences.

@Test(expected = MismatchingStoreIdException.class)
public void newClientsShouldNotIgnoreStoreIdDifferences() throws Throwable {
    // Given
    MasterImpl.SPI masterImplSPI = MasterImplTest.mockedSpi(StoreIdTestFactory.newStoreIdForCurrentVersion(1, 2, 3, 4));
    when(masterImplSPI.getTransactionChecksum(anyLong())).thenReturn(5L);
    newMasterServer(masterImplSPI);
    StoreId storeId = StoreIdTestFactory.newStoreIdForCurrentVersion(5, 6, 7, 8);
    MasterClient masterClient = newMasterClient320(storeId);
    // When
    masterClient.handshake(1, storeId);
}
Also used : MasterImpl(org.neo4j.kernel.ha.com.master.MasterImpl) StoreId(org.neo4j.kernel.impl.store.StoreId) MasterClient(org.neo4j.kernel.ha.com.slave.MasterClient) MasterImplTest(org.neo4j.kernel.ha.com.master.MasterImplTest) Test(org.junit.Test)

Aggregations

MasterClient (org.neo4j.kernel.ha.com.slave.MasterClient)16 Test (org.junit.Test)11 StoreId (org.neo4j.kernel.impl.store.StoreId)11 URI (java.net.URI)9 TransactionId (org.neo4j.kernel.impl.store.TransactionId)9 TransactionIdStore (org.neo4j.kernel.impl.transaction.log.TransactionIdStore)9 BranchedDataPolicy (org.neo4j.kernel.ha.BranchedDataPolicy)7 HandshakeResult (org.neo4j.kernel.ha.com.master.HandshakeResult)7 LifeSupport (org.neo4j.kernel.lifecycle.LifeSupport)7 CancellationRequest (org.neo4j.helpers.CancellationRequest)6 BranchedDataException (org.neo4j.kernel.ha.BranchedDataException)6 File (java.io.File)5 PageCache (org.neo4j.io.pagecache.PageCache)5 SlaveServer (org.neo4j.kernel.ha.com.slave.SlaveServer)5 MismatchingStoreIdException (org.neo4j.kernel.impl.store.MismatchingStoreIdException)5 IOException (java.io.IOException)4 InstanceId (org.neo4j.cluster.InstanceId)4 ClusterMemberAvailability (org.neo4j.cluster.member.ClusterMemberAvailability)4 MoveAfterCopy (org.neo4j.com.storecopy.MoveAfterCopy)4 StoreCopyClient (org.neo4j.com.storecopy.StoreCopyClient)4