Search in sources :

Example 1 with ChangeWanStateRequest

use of com.hazelcast.internal.management.request.ChangeWanStateRequest in project hazelcast by hazelcast.

the class ChangeWanStateRequestTest method testResumingWanState.

@Test
public void testResumingWanState() throws Exception {
    ChangeWanStateRequest changeWanStateRequest = new ChangeWanStateRequest("schema", "publisher", true);
    JsonObject jsonObject = new JsonObject();
    changeWanStateRequest.writeResponse(managementCenterService, jsonObject);
    JsonObject result = (JsonObject) jsonObject.get("result");
    assertNotEquals(ChangeWanStateRequest.SUCCESS, changeWanStateRequest.readResponse(result));
}
Also used : JsonObject(com.eclipsesource.json.JsonObject) ChangeWanStateRequest(com.hazelcast.internal.management.request.ChangeWanStateRequest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 2 with ChangeWanStateRequest

use of com.hazelcast.internal.management.request.ChangeWanStateRequest in project hazelcast by hazelcast.

the class ChangeWanStateRequestTest method testPausingWanState.

@Test
public void testPausingWanState() throws Exception {
    ChangeWanStateRequest changeWanStateRequest = new ChangeWanStateRequest("schema", "publisher", false);
    JsonObject jsonObject = new JsonObject();
    changeWanStateRequest.writeResponse(managementCenterService, jsonObject);
    JsonObject result = (JsonObject) jsonObject.get("result");
    assertNotEquals(ChangeWanStateRequest.SUCCESS, changeWanStateRequest.readResponse(result));
}
Also used : JsonObject(com.eclipsesource.json.JsonObject) ChangeWanStateRequest(com.hazelcast.internal.management.request.ChangeWanStateRequest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 3 with ChangeWanStateRequest

use of com.hazelcast.internal.management.request.ChangeWanStateRequest in project hazelcast by hazelcast.

the class ChangeWanStateRequestTest method testSerialization.

@Test
public void testSerialization() {
    ChangeWanStateRequest changeWanStateRequest1 = new ChangeWanStateRequest("schema", "publisher", false);
    JsonObject jsonObject = changeWanStateRequest1.toJson();
    ChangeWanStateRequest changeWanStateRequest2 = new ChangeWanStateRequest();
    changeWanStateRequest2.fromJson(jsonObject);
    assertEquals(changeWanStateRequest1.getPublisherName(), changeWanStateRequest2.getPublisherName());
    assertEquals(changeWanStateRequest1.getSchemeName(), changeWanStateRequest2.getSchemeName());
    assertEquals(changeWanStateRequest1.isStart(), changeWanStateRequest2.isStart());
}
Also used : JsonObject(com.eclipsesource.json.JsonObject) ChangeWanStateRequest(com.hazelcast.internal.management.request.ChangeWanStateRequest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

JsonObject (com.eclipsesource.json.JsonObject)3 ChangeWanStateRequest (com.hazelcast.internal.management.request.ChangeWanStateRequest)3 ParallelTest (com.hazelcast.test.annotation.ParallelTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3