Package org.codehaus.jackson.node

Examples of org.codehaus.jackson.node.ObjectNode


        addFormParameter(proxy, "sortOrder", "score");
        addFormParameter(proxy, "maxNum", "10");
        proxy.execute();

        assertResultOK(proxy);
        ObjectNode json = getJSON(proxy);
        DateTime now = TimeUtil.getCurrentDateTime();
        boolean findEventWhichIsAfterDeadline = false;
        boolean findEventWhichIsBeforeDeadline = false;
        for (JsonNode eventJSON : json.get("events")) {
            Event event = loadEvent(eventJSON.get("id").asText());
            List<EventTicket> tickets = loadEventTickets(event.getId());
            DateTime deadline = event.acceptsSomeTicketsTill(tickets);

            if (deadline.isBefore(now)) {
View Full Code Here


        addFormParameter(proxy, "sortOrder", "score");
        addFormParameter(proxy, "maxNum", "10");
        proxy.execute();

        assertResultOK(proxy);
        ObjectNode json = getJSON(proxy);
        assertOnlyBeforeDeadlineAreFound(json);
    }
View Full Code Here

        addFormParameter(proxy, "sortOrder", "score");
        // addFormParameter(proxy, "maxNum", null);
        proxy.execute();

        assertResultOK(proxy);
        ObjectNode json = getJSON(proxy);
        assertThat(json.has("reason"), equalTo(false));
        assertThat(json.get("events").size(), equalTo(10));
    }
View Full Code Here

        // addFormParameter(proxy, "maxNum", null);
        addFormParameter(proxy, "maxnum", "10");
        proxy.execute();

        assertResultOK(proxy);
        ObjectNode json = getJSON(proxy);
        assertThat(json.has("reason"), equalTo(false));
        assertThat(json.get("events").size(), equalTo(10));
    }
View Full Code Here

        addFormParameter(proxy, "category", "all");
        addFormParameter(proxy, "maxNum", "2");
        proxy.execute();

        assertResultOK(proxy);
        ObjectNode json = getJSON(proxy);
        String expectedId = json.get("events").get(1).get("id").asText();

        addFormParameter(proxy, "offset", "1");
        proxy.execute();

        assertResultOK(proxy);
        json = getJSON(proxy);
        String actualId = json.get("events").get(0).get("id").asText();
        assertThat(actualId, is(equalTo(expectedId)));
    }
View Full Code Here

        ActionProxy proxy = getActionProxy(GET, SESSION_TOKEN_PATH);

        proxy.execute();
        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        Assert.assertTrue(obj.has("token"));
    }
View Full Code Here

        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);

        proxy.execute();
        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        Assert.assertTrue(obj.has("token"));
    }
View Full Code Here

        loginAs(proxy, DEFAULT_USER_ID);

        proxy.execute();
        assertResultOK(proxy);

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

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

        loginAs(proxy, TestDataProvider.EVENT_OWNER_ID);

        proxy.execute();
        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        assertThat(obj.get("totalEventCount").asInt(), is(N));
        assertThat(obj.get("eventStatuses"), is(not(nullValue())));
        JsonNode array = obj.get("eventStatuses");
        assertThat(array.size(), is(10));
        for (int i = 0; i < array.size(); ++i) {
            JsonNode eventStatus = array.get(i);
            JsonNode event = eventStatus.get("event");
            assertThat(event.get("id").asText(), is(ids.get(N - i - 1)));
View Full Code Here

        loginAs(proxy, EVENT_EDITOR_ID);

        proxy.execute();
        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        assertThat(obj.get("totalEventCount").asInt(), is(N));
        assertThat(obj.get("eventStatuses"), is(not(nullValue())));
        JsonNode array = obj.get("eventStatuses");
        assertThat(array.size(), is(10));
        for (int i = 0; i < array.size(); ++i) {
            JsonNode eventStatus = array.get(i);
            JsonNode event = eventStatus.get("event");
            assertThat(event.get("id").asText(), is(ids.get(N - i - 1)));
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.node.ObjectNode

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.