Search in sources :

Example 26 with JsonObject

use of com.eclipsesource.json.JsonObject 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 27 with JsonObject

use of com.eclipsesource.json.JsonObject 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 28 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class ClearWanQueuesTest method testClearWanQueue.

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

Example 29 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class ExecuteScriptRequestTest method testExecuteScriptRequest_withScriptException.

@Test
public void testExecuteScriptRequest_withScriptException() throws Exception {
    ExecuteScriptRequest request = new ExecuteScriptRequest("print(;", "JavaScript", true, bindings);
    JsonObject jsonObject = new JsonObject();
    request.writeResponse(managementCenterService, jsonObject);
    JsonObject result = (JsonObject) jsonObject.get("result");
    String response = (String) request.readResponse(result);
    assertNotNull(response);
}
Also used : ExecuteScriptRequest(com.hazelcast.internal.management.request.ExecuteScriptRequest) JsonObject(com.eclipsesource.json.JsonObject) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 30 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class ExecuteScriptRequestTest method testExecuteScriptRequest_withIllegalScriptEngine.

@Test
public void testExecuteScriptRequest_withIllegalScriptEngine() throws Exception {
    ExecuteScriptRequest request = new ExecuteScriptRequest("script", "engine", true, bindings);
    JsonObject jsonObject = new JsonObject();
    request.writeResponse(managementCenterService, jsonObject);
    JsonObject result = (JsonObject) jsonObject.get("result");
    String response = (String) request.readResponse(result);
    assertContains(response, "IllegalArgumentException");
}
Also used : ExecuteScriptRequest(com.hazelcast.internal.management.request.ExecuteScriptRequest) 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)499 Test (org.junit.Test)157 URL (java.net.URL)145 JsonArray (com.eclipsesource.json.JsonArray)96 JsonValue (com.eclipsesource.json.JsonValue)43 ParallelTest (com.hazelcast.test.annotation.ParallelTest)36 QuickTest (com.hazelcast.test.annotation.QuickTest)36 ArrayList (java.util.ArrayList)33 HashMap (java.util.HashMap)28 IOException (java.io.IOException)17 Map (java.util.Map)17 Matchers.containsString (org.hamcrest.Matchers.containsString)17 Date (java.util.Date)13 JsonUtil.getString (com.hazelcast.util.JsonUtil.getString)12 MalformedURLException (java.net.MalformedURLException)11 WalletCallException (com.vaklinov.zcashui.ZCashClientCaller.WalletCallException)7 URISyntaxException (java.net.URISyntaxException)6 ExecuteScriptRequest (com.hazelcast.internal.management.request.ExecuteScriptRequest)5 Link (org.eclipse.leshan.Link)5 Jedis (redis.clients.jedis.Jedis)5