use of com.hazelcast.internal.json.TestUtil.RunnableEx in project hazelcast by hazelcast.
the class JsonParser_Test method parse_handlesPositionsCorrectlyWhenInputExceedsBufferSize.
@Test
public void parse_handlesPositionsCorrectlyWhenInputExceedsBufferSize() {
final String input = "{\n \"a\": 23,\n \"b\": 42,\n}";
ParseException exception = assertException(ParseException.class, new RunnableEx() {
public void run() throws IOException {
parser.parse(new StringReader(input), 3);
}
});
assertEquals(new Location(24, 4, 1), exception.getLocation());
}
use of com.hazelcast.internal.json.TestUtil.RunnableEx in project hazelcast by hazelcast.
the class JsonValue_Test method writeTo_failsWithNullConfig.
@Test
public void writeTo_failsWithNullConfig() {
final JsonValue value = new JsonObject();
assertException(NullPointerException.class, "config is null", new RunnableEx() {
public void run() throws IOException {
value.writeTo(new StringWriter(), null);
}
});
}
use of com.hazelcast.internal.json.TestUtil.RunnableEx in project hazelcast by hazelcast.
the class JsonValue_Test method toString_failsWithNullConfig.
@Test
public void toString_failsWithNullConfig() {
final JsonValue value = new JsonObject();
assertException(NullPointerException.class, "config is null", new RunnableEx() {
public void run() throws IOException {
value.toString(null);
}
});
}
Aggregations