コード例 #1
0
 @Test
 public void jsonToModel() throws Exception {
   CRLFStringTestModel m =
       meta.jsonToModel(
           "{\"stringValue\":\"hello\\b\\f\\n\\r\\t\\\"\u1234world\","
               + "\"textValue\":\"hello\\b\\f\\n\\r\\t\\\"\u1234world\"}");
   Assert.assertEquals("hello\b\f\n\r\t\"\u1234world", m.getStringValue());
   Assert.assertEquals("hello\b\f\n\r\t\"\u1234world", m.getTextValue().getValue());
 }
コード例 #2
0
 @Test
 public void modelToJson() throws Exception {
   CRLFStringTestModel m = new CRLFStringTestModel();
   m.setStringValue("hello\b\f\n\r\t\"\u1234world");
   m.setTextValue(new Text("hello\b\f\n\r\t\"\u1234world"));
   Assert.assertEquals(
       "{\"stringValue\":\"hello\\b\\f\\n\\r\\t\\\"\u1234world\","
           + "\"textValue\":\"hello\\b\\f\\n\\r\\t\\\"\u1234world\"}",
       CRLFStringTestModelMeta.get().modelToJson(m));
 }