Search in sources :

Example 6 with MigrationStateImpl

use of com.hazelcast.internal.partition.MigrationStateImpl in project hazelcast by hazelcast.

the class MigrationListenerAdapterTest method test_migrationCompleted.

@Test
public void test_migrationCompleted() {
    MigrationState migrationSchedule = new MigrationStateImpl();
    ReplicaMigrationEvent event = new ReplicaMigrationEventImpl(migrationSchedule, 0, 0, null, null, true, 0L);
    adapter.onEvent(event);
    verify(listener, never()).migrationStarted(any(MigrationState.class));
    verify(listener, never()).migrationFinished(any(MigrationState.class));
    verify(listener, never()).replicaMigrationFailed(any(ReplicaMigrationEvent.class));
    verify(listener).replicaMigrationCompleted(event);
}
Also used : MigrationState(com.hazelcast.partition.MigrationState) ReplicaMigrationEventImpl(com.hazelcast.internal.partition.ReplicaMigrationEventImpl) MigrationStateImpl(com.hazelcast.internal.partition.MigrationStateImpl) ReplicaMigrationEvent(com.hazelcast.partition.ReplicaMigrationEvent) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with MigrationStateImpl

use of com.hazelcast.internal.partition.MigrationStateImpl in project hazelcast by hazelcast.

the class MigrationListenerAdapterTest method test_migrationProcessStarted.

@Test
public void test_migrationProcessStarted() {
    MigrationState migrationSchedule = new MigrationStateImpl();
    ReplicaMigrationEvent event = new ReplicaMigrationEventImpl(migrationSchedule, MIGRATION_STARTED_PARTITION_ID, 0, null, null, true, 0L);
    adapter.onEvent(event);
    verify(listener).migrationStarted(migrationSchedule);
    verify(listener, never()).migrationFinished(any(MigrationStateImpl.class));
    verify(listener, never()).replicaMigrationCompleted(any(ReplicaMigrationEvent.class));
    verify(listener, never()).replicaMigrationFailed(any(ReplicaMigrationEvent.class));
}
Also used : MigrationState(com.hazelcast.partition.MigrationState) ReplicaMigrationEventImpl(com.hazelcast.internal.partition.ReplicaMigrationEventImpl) MigrationStateImpl(com.hazelcast.internal.partition.MigrationStateImpl) ReplicaMigrationEvent(com.hazelcast.partition.ReplicaMigrationEvent) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MigrationStateImpl (com.hazelcast.internal.partition.MigrationStateImpl)7 ReplicaMigrationEventImpl (com.hazelcast.internal.partition.ReplicaMigrationEventImpl)5 MigrationState (com.hazelcast.partition.MigrationState)4 ReplicaMigrationEvent (com.hazelcast.partition.ReplicaMigrationEvent)4 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)4 QuickTest (com.hazelcast.test.annotation.QuickTest)4 Test (org.junit.Test)4 MigrationInfo (com.hazelcast.internal.partition.MigrationInfo)2 InternalPartitionServiceImpl (com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl)2 MigrationCycleOperation (com.hazelcast.internal.partition.MigrationCycleOperation)1 PartitionLostEventImpl (com.hazelcast.internal.partition.PartitionLostEventImpl)1 PartitionReplica (com.hazelcast.internal.partition.PartitionReplica)1 PartitionRuntimeState (com.hazelcast.internal.partition.PartitionRuntimeState)1 ReplicaFragmentMigrationState (com.hazelcast.internal.partition.ReplicaFragmentMigrationState)1 PartitionEventManager (com.hazelcast.internal.partition.impl.PartitionEventManager)1 AssignPartitions (com.hazelcast.internal.partition.operation.AssignPartitions)1 FetchPartitionStateOperation (com.hazelcast.internal.partition.operation.FetchPartitionStateOperation)1 HasOngoingMigration (com.hazelcast.internal.partition.operation.HasOngoingMigration)1 MigrationCommitOperation (com.hazelcast.internal.partition.operation.MigrationCommitOperation)1 MigrationOperation (com.hazelcast.internal.partition.operation.MigrationOperation)1