use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class PrettyPrint_Test method testIndentWithSpaces_one.
@Test
public void testIndentWithSpaces_one() throws IOException {
new JsonArray().add(23).add(42).writeTo(output, indentWithSpaces(1));
assertEquals("[\n 23,\n 42\n]", output.toString());
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class PrettyPrint_Test method testSingleLine_nestedArray.
@Test
public void testSingleLine_nestedArray() throws IOException {
new JsonArray().add(23).add(new JsonArray().add(42)).writeTo(output, singleLine());
assertEquals("[23, [42]]", output.toString());
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class Mocking_Test method mockArray.
@Test
public void mockArray() {
JsonArray jsonArray = Mockito.mock(JsonArray.class);
assertNotNull(jsonArray);
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class JsonLiteral_Test method sameAfterDeserialization.
@Test
public void sameAfterDeserialization() throws Exception {
JsonArray array = new JsonArray().add(NULL).add(NULL);
JsonArray deserialized = serializeAndDeserialize(array);
assertNotSame(NULL, deserialized.get(0));
assertSame(deserialized.get(0), deserialized.get(1));
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class JsonParser_Test method parse_doesNotFailWithManyObjects.
@Test
public void parse_doesNotFailWithManyObjects() {
JsonArray array = new JsonArray();
for (int i = 0; i < 1001; i++) {
array.add(new JsonObject().add("a", 7));
}
final String input = array.toString();
JsonValue result = parse(input);
assertTrue(result.isArray());
}
Aggregations