Package org.codehaus.jackson

Examples of org.codehaus.jackson.JsonNode


        assertThat(obj.get("id").asText(), is(DEFAULT_USER_ID));
        // These values should not be public.
        assertThat(obj.get("twitterId"), is(nullValue()));
        assertThat(obj.get("lastLoginAt"), is(nullValue()));
        assertThat(obj.get("calendarId"), is(nullValue()));
        JsonNode twitter = obj.get("twitter");
        assertThat(twitter, is(notNullValue()));
        assertThat(twitter.get("screenName").asText(), is(DEFAULT_TWITTER_SCREENNAME));
        assertThat(twitter.get("profileImageURL").asText(), is("http://www.example.com/"));
        // These values should not be public.
        assertThat(twitter.get("accessToken"), is(nullValue()));
        assertThat(twitter.get("accessTokenSecret"), is(nullValue()));

        // We don't expose OpenID Linkage.
        assertThat(obj.get("openIDLinakge"), is(nullValue()));
    }
View Full Code Here


        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

        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

        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

        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

        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

        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

        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

  public static class ConfigDeserializer extends JsonDeserializer<Config> {
    @Override
    public Config deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException {
      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      return new MapConfig(OBJECT_MAPPER.<Map<String, String>> readValue(node, new TypeReference<Map<String, String>>() {
      }));
    }
View Full Code Here

  public static class PartitionDeserializer extends JsonDeserializer<Partition> {
    @Override
    public Partition deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException {
      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      return new Partition(node.getIntValue());
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.JsonNode

Copyright © 2018 www.massapicom. 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.