@Test public void testLengthOfStrings() throws IOException { TestClassWithStrings testClassWithStrings = new TestClassWithStrings(); String s1 = TelemetryTestsUtils.createString(110); testClassWithStrings.setS1(s1); testClassWithStrings.setS2("abc"); Buffer buffer = new Buffer(); JsonWriter writer = JsonWriter.of(buffer); JsonTelemetryDataSerializer tested = new JsonTelemetryDataSerializer(writer); testClassWithStrings.serialize(tested); tested.close(); writer.close(); String str = new String(buffer.readByteArray(), Charsets.UTF_8); TestClassWithStrings bac = new Gson().fromJson(str, TestClassWithStrings.class); Map<String, String> recoveryMap = new Gson().fromJson(str, new TypeToken<HashMap<String, String>>() {}.getType()); assertNotEquals((recoveryMap.get("s1")).length(), s1.length()); assertNotEquals(bac, testClassWithStrings); }
public void close() throws IOException { out.endObject(); }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } JsonTelemetryDataSerializer(JsonWriter out); }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } JsonTelemetryDataSerializer(JsonWriter out); void reset(JsonWriter out); void close(); void write(String name, Duration value); void write(String name, DataPointType value); void write(String name, int value); void write(String name, com.microsoft.applicationinsights.internal.schemav2.SeverityLevel value); void write(String name, Integer value); void write(String name, double value); void write(String name, Double value); void write(String name, short value); void write(String name, Short value); void write(String name, long value); void write(String name, Long value); void write(String name, boolean value); void write(String name, Boolean value); void write(String name, Date value); void write(String name, String value, int len); void writeRequired(String name, String value, int len); void write(String name, T value); void write(String name, Map<String, T> map); void write(String name, List<T> list); }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } JsonTelemetryDataSerializer(JsonWriter out); void reset(JsonWriter out); void close(); void write(String name, Duration value); void write(String name, DataPointType value); void write(String name, int value); void write(String name, com.microsoft.applicationinsights.internal.schemav2.SeverityLevel value); void write(String name, Integer value); void write(String name, double value); void write(String name, Double value); void write(String name, short value); void write(String name, Short value); void write(String name, long value); void write(String name, Long value); void write(String name, boolean value); void write(String name, Boolean value); void write(String name, Date value); void write(String name, String value, int len); void writeRequired(String name, String value, int len); void write(String name, T value); void write(String name, Map<String, T> map); void write(String name, List<T> list);  }