Examples of toJson()


Examples of bgu.bio.adt.graphs.FlexibleUndirectedGraph.toJSON()

    for (int i = 0; i < edges.length; i++) {
      graph.addEdge(edges[i][0], edges[i][1]);
    }

    try {
      JSONObject json = graph.toJSON();
      FlexibleUndirectedGraph graph2 = FlexibleUndirectedGraph
          .fromJSON(json);
      Assert.assertEquals("Wrong number of nodes", graph.getNodeNum(),
          graph2.getNodeNum());
      Assert.assertEquals("Wrong number of edges", graph.getEdgeNum(),
View Full Code Here

Examples of biz.paluch.logging.gelf.intern.GelfMessage.toJson()

        }

        try {
            GelfMessage message = createGelfMessage(event);
            if (!message.isValid()) {
                reportError("GELF Message is invalid: " + message.toJson(), null);
            }

            if (null == gelfSender || !gelfSender.sendMessage(message)) {
                reportError("Could not send GELF message", null);
            }
View Full Code Here

Examples of buri.ddmsence.ddms.format.Extent.toJSON()

  @Test
  public void testOutputJSONPrettyPrint() throws InvalidDDMSException {
    Extent extent = new Extent("a", "z");
    PropertyReader.setProperty("output.json.prettyPrint", "false");
    assertEquals("{\"qualifier\":\"a\",\"value\":\"z\"}", extent.toJSON());
    PropertyReader.setProperty("output.json.prettyPrint", "true");
    assertEquals("{\n  \"qualifier\": \"a\",\n  \"value\": \"z\"\n}", extent.toJSON());
  }
 
  @Test
View Full Code Here

Examples of buri.ddmsence.ddms.security.Security.toJSON()

  @Test
  public void testOutputJSONInline() throws InvalidDDMSException {
    DDMSVersion.setCurrentVersion("4.1");
    Security security = SecurityTest.getFixture();
    PropertyReader.setProperty("output.json.inlineAttributes", "false");
    assertEquals("{\"excludeFromRollup\":true,\"securityAttributes\":{\"classification\":\"U\",\"ownerProducer\":[\"USA\"]}}", security.toJSON());
    PropertyReader.setProperty("output.json.inlineAttributes", "true");
    assertEquals("{\"excludeFromRollup\":true,\"classification\":\"U\",\"ownerProducer\":[\"USA\"]}", security.toJSON());
  }
 
  @Test
View Full Code Here

Examples of cc.plural.jsonij.JSON.toJSON()

        System.out.println("Unicode");
        String testInput = "{\"lastname\":\"\\u44ff\",\"date\":\"\\u44aa\\u44ff\",\"len\":\"\\u44AA\"}";
        String testSoultion = "{\"lastname\":\"\\u44ff\",\"date\":\"\\u44aa\\u44ff\",\"len\":\"\\u44aa\"}";
        for(int i=0;i<500000;i++) {
            JSON json = JSON.parse(testInput);
            String testOutput = json.toJSON();
            assertEquals(testSoultion, testOutput);
        }
    }
}
View Full Code Here

Examples of cc.plural.jsonij.Value.toJSON()

        assertEquals(v.get("name").toString(), "hello");

        v = parser.parse("{}");
       
        assertEquals(v.toJSON(), "{}");
    }

    public void testParseArray() throws IOException, ParserException {
        Value v = parser.parse("[]");
        if (!(v instanceof JSON.Array<?>)) {
View Full Code Here

Examples of ch.rasc.wampspring.message.WelcomeMessage.toJson()

  @Override
  public void afterConnectionEstablished(WebSocketSession session) throws Exception {
    wampMessageSender.put(session.getId(), session);
    WelcomeMessage welcomeMessage = new WelcomeMessage(session.getId(), SERVER_IDENTIFIER);
    session.sendMessage(new TextMessage(welcomeMessage.toJson(jsonFactory)));
  }

  @Override
  public void handleMessage(WebSocketSession session, WebSocketMessage<?> webSocketMessage) throws Exception {
    Assert.isInstanceOf(TextMessage.class, webSocketMessage);
View Full Code Here

Examples of com.alibaba.json.bvtVO.DataTransaction.toJSON()

        m2.put("name2", "tom");
        m2.put("name3", "tom");

        dt.getBody().getParam().setForm(m2);

        System.out.println(dt.toJSON());

        DataTransaction dt2 = DataTransaction.fromJSON(dt.toJSON());
        System.out.println(dt2.toJSON());
    }
}
View Full Code Here

Examples of com.alibaba.rocketmq.common.protocol.body.TopicConfigSerializeWrapper.toJson()

    public String encode(final boolean prettyFormat) {
        TopicConfigSerializeWrapper topicConfigSerializeWrapper = new TopicConfigSerializeWrapper();
        topicConfigSerializeWrapper.setTopicConfigTable(this.topicConfigTable);
        topicConfigSerializeWrapper.setDataVersion(this.dataVersion);
        return topicConfigSerializeWrapper.toJson(prettyFormat);
    }


    @Override
    public void decode(String jsonString) {
View Full Code Here

Examples of com.alibaba.rocketmq.common.protocol.route.TopicRouteData.toJson()

        try {
            defaultMQAdminExt.start();

            String topic = commandLine.getOptionValue('t').trim();
            TopicRouteData topicRouteData = defaultMQAdminExt.examineTopicRouteInfo(topic);
            String json = topicRouteData.toJson(true);
            System.out.println(json);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.