Examples of JsonNode


Examples of org.codehaus.jackson.JsonNode

        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        assertThat(obj.get("totalTicketCount").asInt(), is(20));

        JsonNode array = obj.get("ticketStatuses");
        assertThat(array.size(), is(5));
        for (int i = 0; i < 5; ++i) {
            assertThat(array.get(i).get("ticket").get("id").asText(), is(ids.get(i * 2).getFirst().toString()));
            assertThat(array.get(i).get("status").asText(), is("enrolled"));
        }
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        assertThat(obj.get("totalEventCount").asInt(), is(N - 6));
        assertThat(obj.path("eventStatuses"), is(not(nullValue())));
        JsonNode array = obj.get("eventStatuses");
        assertThat(array.size(), is(10));

        int pos = N - 1;
        for (int i = 0; i < array.size(); ++i) {
            while (pos % 8 == 0 || pos % 8 == 1)
                pos -= 1;

            JsonNode eventStatus = array.get(i);
            JsonNode event = eventStatus.get("event");
            assertThat(event.get("id").asText(), is(ids.get(pos)));

            pos -= 1;
        }
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        assertThat(obj.get("totalEventCount").asInt(), is(N - 6));
        assertThat(obj.path("eventStatuses"), is(not(nullValue())));
        JsonNode array = obj.get("eventStatuses");
        assertThat(array.size(), is(10));

        int pos = N - 1;
        for (int i = 0; i < array.size(); ++i) {
            while (pos % 8 == 0 || pos % 8 == 1)
                pos -= 1;

            JsonNode eventStatus = array.get(i);
            JsonNode event = eventStatus.get("event");
            assertThat(event.get("id").asText(), is(ids.get(pos)));

            pos -= 1;
        }
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);

        assertThat(obj.get("count").asInt(), is(10));
        JsonNode ids = obj.get("imageIds");
        for (int i = 0; i < ids.size(); ++i)
            assertThat(ids.get(i).asText(), is(TestDataProvider.IMAGE_OWNED_BY_DEFAULT_USER_ID[i]));
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);

        assertThat(obj.get("count").asInt(), is(10));
        JsonNode ids = obj.get("imageIds");
        for (int i = 0; i < ids.size(); ++i)
            assertThat(ids.get(i).asText(), is(TestDataProvider.IMAGE_OWNED_BY_DEFAULT_USER_ID[i]));
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);

        assertThat(obj.get("count").asInt(), is(10));
        JsonNode ids = obj.get("imageIds");
        for (int i = 0; i < ids.size(); ++i)
            assertThat(ids.get(i).asText(), is(TestDataProvider.IMAGE_OWNED_BY_DEFAULT_USER_ID[i]));
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);

        assertThat(obj.get("count").asInt(), is(10));
        JsonNode ids = obj.get("imageIds");
        for (int i = 0; i < ids.size(); ++i)
            assertThat(ids.get(i).asText(), is(TestDataProvider.IMAGE_OWNED_BY_DEFAULT_USER_ID[i + 3]));
    }
View Full Code Here

Examples of org.jcoredb.service.http.output.JSONNode

   
    try
    {
      Block block = fs.read(blockId);
     
      JSONNode root = JSONHelper.createSuccessNode();
      JSONAttribute containerId = new JSONAttribute("containerId", ""+blockId.getContainerId(), AttrType.Number);
      JSONAttribute segmentId = new JSONAttribute("segmentId", ""+blockId.getSegmentId(), AttrType.Number);
      JSONAttribute id = new JSONAttribute("blockId", ""+blockId.getId(), AttrType.Number);
      JSONAttribute data = new JSONAttribute("data", Base64.encodeBase64String(block.getBytes()),AttrType.String);
      root.add(containerId);
      root.add(segmentId);
      root.add(id);
      root.add(data);
     
      out.println(root.toJSONString());
    }
    catch (Exception e) {

      out.println(JSONHelper.createErrorNode(e));
    }
View Full Code Here

Examples of org.jitterbit.integration.json.dom.JsonNode

    public JsonNode current() {
        return parentStack.isEmpty() ? null : parentStack.peek();
    }
   
    public boolean isSimpleArray() {
        JsonNode node = current();
        return node instanceof ArrayNode && ((ArrayNode) node).isSimpleForm();
    }
View Full Code Here

Examples of weka.core.json.JSONNode

    if ((retrieveFile() == null) && (getWriter() == null))
      outW = new PrintWriter(System.out);
    else
      outW = new PrintWriter(getWriter());
   
    JSONNode json = JSONInstances.toJSON(getInstances());
    StringBuffer buffer = new StringBuffer();
    json.toString(buffer);
    outW.println(buffer.toString());
    outW.flush();
   
    if (getWriter() != null)
      outW.close();
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.