MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / escapeJson

Method escapeJson

test/tsd/TestHttpQuery.java:1013–1024  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1011 }
1012
1013 @Test
1014 public void escapeJson() {
1015 StringBuilder sb = new StringBuilder();
1016 String json = "\" \\ ";
1017 json += Character.toString('\b') + " ";
1018 json += Character.toString('\f') + " ";
1019 json += Character.toString('\n') + " ";
1020 json += Character.toString('\r') + " ";
1021 json += Character.toString('\t');
1022 HttpQuery.escapeJson(json, sb);
1023 assertEquals("\\\" \\\\ \\b \\f \\n \\r \\t", sb.toString());
1024 }
1025
1026 @Test
1027 public void sendReplyBytes() throws Exception {

Callers

nothing calls this directly

Calls 2

escapeJsonMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected