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

Method serializeToBytes

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

Source from the content-addressed store, hash-verified

304
305 // serializeToBytes
306 @Test
307 public void serializeToBytes() throws Exception {
308 HashMap<String, String> map = new HashMap<String, String>();
309 map.put("utf", "aériennes");
310 map.put("ascii", "aariennes");
311 byte[] raw = JSON.serializeToBytes(map);
312 assertNotNull(raw);
313 String json = new String(raw, "UTF8");
314 assertTrue(json.matches(".*[{,]\"ascii\":\"aariennes\"[,}].*"));
315 }
316
317 @Test (expected = IllegalArgumentException.class)
318 public void serializeToBytesNull() throws Exception {

Callers

nothing calls this directly

Calls 3

serializeToBytesMethod · 0.95
putMethod · 0.80
matchesMethod · 0.45

Tested by

no test coverage detected