use of elemental.json.JsonValue in project che by eclipse.
the class JsonRpcResultTest method shouldToJsonValueWhenPassingParametersWithResultAsASingleString.
@Test
public void shouldToJsonValueWhenPassingParametersWithResultAsASingleString() throws Exception {
String value = "a";
JsonString expected = jsonFactory.create("a");
JsonRpcResult jsonRpcResult = new JsonRpcResult(value, dtoFactory, jsonFactory);
JsonValue actual = jsonRpcResult.toJsonValue();
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonValue in project che by eclipse.
the class JsonRpcResultTest method shouldToJsonValueWhenPassingParametersWithResultAsASingleVoid.
@Test
public void shouldToJsonValueWhenPassingParametersWithResultAsASingleVoid() throws Exception {
JsonObject expected = jsonFactory.createObject();
JsonRpcResult jsonRpcResult = new JsonRpcResult(null, dtoFactory, jsonFactory);
JsonValue actual = jsonRpcResult.toJsonValue();
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonValue in project che by eclipse.
the class JsonRpcResultTest method shouldToJsonValueWhenParsingStringWithResultAsAListOfDto.
@Test
public void shouldToJsonValueWhenParsingStringWithResultAsAListOfDto() throws Exception {
JsonArray expected = jsonFactory.createArray();
JsonObject value = jsonFactory.parse(dto.toString());
expected.set(0, value);
JsonRpcResult jsonRpcResult = new JsonRpcResult(expected.toJson(), jsonFactory, dtoFactory);
JsonValue actual = jsonRpcResult.toJsonValue();
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonValue in project che by eclipse.
the class JsonRpcResultTest method shouldToJsonValueWhenPassingParametersWithResultAsASingleNumber.
@Test
public void shouldToJsonValueWhenPassingParametersWithResultAsASingleNumber() throws Exception {
Double number = 0D;
JsonNumber expected = jsonFactory.create(number);
JsonRpcResult jsonRpcResult = new JsonRpcResult(number, dtoFactory, jsonFactory);
JsonValue actual = jsonRpcResult.toJsonValue();
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonValue in project che by eclipse.
the class JsonRpcResultTest method shouldToJsonValueWhenParsingStringWithResultAsASingleVoid.
@Test
public void shouldToJsonValueWhenParsingStringWithResultAsASingleVoid() throws Exception {
JsonObject expected = jsonFactory.createObject();
JsonRpcResult jsonRpcResult = new JsonRpcResult(expected.toJson(), jsonFactory, dtoFactory);
JsonValue actual = jsonRpcResult.toJsonValue();
assertTrue(expected.jsEquals(actual));
}
Aggregations