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

Method serializeToString

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

Source from the content-addressed store, hash-verified

287
288 // serializeToString
289 @Test
290 public void serializeToString() throws Exception {
291 HashMap<String, String> map = new HashMap<String, String>();
292 map.put("utf", "aériennes");
293 map.put("ascii", "aariennes");
294 String json = JSON.serializeToString(map);
295 assertNotNull(json);
296 assertFalse(json.isEmpty());
297 assertTrue(json.matches(".*[{,]\"ascii\":\"aariennes\"[,}].*"));
298 }
299
300 @Test (expected = IllegalArgumentException.class)
301 public void serializeToStringNull() throws Exception {

Callers

nothing calls this directly

Calls 4

serializeToStringMethod · 0.95
putMethod · 0.80
isEmptyMethod · 0.80
matchesMethod · 0.45

Tested by

no test coverage detected