コード例 #1
0
  @Test
  public void test() {
    JSONCharacterSink sink = createMock(JSONCharacterSink.class);
    sink.append("\"foo\"");
    expectLastCall().once();

    replay(sink);

    JSON json = new JSON();
    json.registerJSONifier(Bean.class, new TestSinkAwareJSONifier());
    json.dumpObject(sink, new Bean());
    verify(sink);
  }
コード例 #2
0
 public void writeToSink(JSONCharacterSink sink, Object o) {
   sink.append("\"foo\"");
 }