Search in sources :

Example 1 with MemberHotRestartStatus

use of com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO.MemberHotRestartStatus in project hazelcast by hazelcast.

the class ClusterHotRestartStatusDTOTest method testSerialization.

@Test
public void testSerialization() {
    Map<String, MemberHotRestartStatus> memberHotRestartStatusMap = new HashMap<String, MemberHotRestartStatus>();
    memberHotRestartStatusMap.put("127.0.0.1:5701", MemberHotRestartStatus.PENDING);
    memberHotRestartStatusMap.put("127.0.0.1:5702", MemberHotRestartStatus.SUCCESSFUL);
    ClusterHotRestartStatusDTO dto = new ClusterHotRestartStatusDTO(HotRestartClusterDataRecoveryPolicy.FULL_RECOVERY_ONLY, ClusterHotRestartStatus.IN_PROGRESS, 23, 42, memberHotRestartStatusMap);
    JsonObject json = dto.toJson();
    ClusterHotRestartStatusDTO deserialized = new ClusterHotRestartStatusDTO();
    deserialized.fromJson(json);
    assertEquals(dto.getDataRecoveryPolicy(), deserialized.getDataRecoveryPolicy());
    assertEquals(dto.getHotRestartStatus(), deserialized.getHotRestartStatus());
    assertEquals(dto.getRemainingValidationTimeMillis(), deserialized.getRemainingValidationTimeMillis());
    assertEquals(dto.getRemainingDataLoadTimeMillis(), deserialized.getRemainingDataLoadTimeMillis());
    assertEquals(dto.getMemberHotRestartStatusMap(), deserialized.getMemberHotRestartStatusMap());
}
Also used : HashMap(java.util.HashMap) MemberHotRestartStatus(com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO.MemberHotRestartStatus) JsonObject(com.eclipsesource.json.JsonObject) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

JsonObject (com.eclipsesource.json.JsonObject)1 MemberHotRestartStatus (com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO.MemberHotRestartStatus)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 HashMap (java.util.HashMap)1 Test (org.junit.Test)1