MCPcopy
hub / github.com/OpenTSDB/opentsdb / serializeToJSONString

Method serializeToJSONString

test/utils/TestJSON.java:323–332  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321
322 // serializeToJSONString
323 @Test
324 public void serializeToJSONString() throws Exception {
325 HashMap<String, String> map = new HashMap<String, String>();
326 map.put("utf", "aériennes");
327 map.put("ascii", "aariennes");
328 String json = JSON.serializeToJSONPString("dummycb", map);
329 assertNotNull(json);
330 assertFalse(json.isEmpty());
331 assertTrue(json.matches("dummycb\\(.*[{,]\"ascii\":\"aariennes\"[,}].*\\)"));
332 }
333
334 @Test (expected = IllegalArgumentException.class)
335 public void serializeToJSONStringNullData() throws Exception {

Callers

nothing calls this directly

Calls 4

putMethod · 0.80
isEmptyMethod · 0.80
matchesMethod · 0.45

Tested by

no test coverage detected