use of com.hazelcast.internal.partition.ReadonlyInternalPartition in project hazelcast by hazelcast.
the class InternalPartitionServiceImplTest method test_setInitialState.
@Test
public void test_setInitialState() {
InternalPartition[] partitions = new InternalPartition[partitionCount];
for (int i = 0; i < partitionCount; i++) {
PartitionReplica[] replicas = new PartitionReplica[MAX_REPLICA_COUNT];
replicas[0] = PartitionReplica.from(localMember);
partitions[i] = new ReadonlyInternalPartition(replicas, i, RandomPicker.getInt(1, 10));
}
partitionService.setInitialState(new PartitionTableView(partitions));
for (int i = 0; i < partitionCount; i++) {
assertTrue(partitionService.isPartitionOwner(i));
}
assertNotEquals(0, partitionService.getPartitionStateStamp());
}
Aggregations