Package in.partake.model.dto

Examples of in.partake.model.dto.Event


        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)) {
                findEventWhichIsAfterDeadline = true;
            } else {
                findEventWhichIsBeforeDeadline = true;
View Full Code Here


        assertResultOK(proxy);
    }

    private Event createEvent() {
        Event event = PartakeTestApp.getTestService().getTestDataProviderSet().getEventProvider().create();
        event.setTitle(SEARCH_QUERY);
        event.setSummary(SEARCH_QUERY);
        event.setDescription(SEARCH_QUERY);
        event.setBeginDate(new DateTime(0L));
        event.setCategory("neta");
        event.setCreatedAt(new DateTime(0L));
        event.setDraft(false);
        event.setPasscode(null); // privateイベントは検索の対象にならないので公開イベントとして作成

        assert event.isSearchable();
        return event;
    }
View Full Code Here

        assert event.isSearchable();
        return event;
    }

    private Event storeEventAfterDeadline() throws DAOException, PartakeException {
        final Event event = createEvent();
        event.setBeginDate(TimeUtil.getCurrentDateTime().nDayBefore(1));
        String eventId = new Transaction<String>() {
            @Override
            protected String doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
                return EventDAOFacade.create(con, daos, event);
            }
View Full Code Here

        PartakeApp.getEventSearchService().create(event, Collections.singletonList(ticket));
        return event;
    }

    private Event storeEventBeforeDeadline() throws DAOException, PartakeException {
        final Event event = createEvent();
        event.setBeginDate(TimeUtil.getCurrentDateTime().nDayAfter(1));
        String eventId = new Transaction<String>() {
            @Override
            protected String doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
                return EventDAOFacade.create(con, daos, event);
            }
View Full Code Here

    private void assertOnlyBeforeDeadlineAreFound(ObjectNode json) throws PartakeException, DAOException {
        DateTime now = TimeUtil.getCurrentDateTime();

        boolean findEvents = false;
        for (JsonNode node : json.get("events")) {
            Event event = loadEvent(node.get("id").asText());
            List<EventTicket> tickets = loadEventTickets(event.getId());
            DateTime deadline = event.acceptsSomeTicketsTill(tickets);
            assertThat("締め切り後のイベントが見つかってしまいました", deadline.getTime(), is(greaterThan(now.getTime())));
            findEvents = true;
        }
        assertTrue("見つかるはずのイベントが見つかりませんでした", findEvents);
    }
View Full Code Here

        DateTime late = new DateTime(now.getTime() + 1000 * 3600);
        String category = EventCategory.getCategories().get(0).getKey();

        for (int i = 0; i < n; ++i) {
            boolean isPrivate = i % 2 == 1;
            Event event = new Event(null, "title", "summary", category, late, late,
                    "url", "place",
                    "address", "description", "#hashTag", EVENT_OWNER_ID,
                    EVENT_FOREIMAGE_ID, EVENT_BACKIMAGE_ID, isPrivate ? "passcode" : null, false,
                    Collections.singletonList(EVENT_EDITOR_TWITTER_SCREENNAME), new ArrayList<String>(), null,
                    now, now, -1);
View Full Code Here

            protected Void doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
                IEventAccess dao = daos.getEventAccess();
                dao.truncate(con);

                for (int i = 0; i < N; ++i) {
                    dao.put(con, new Event(ids.get(i), "title", "summary", "category",
                            new DateTime(i), null, "url", "place",
                            "address", "description", "#hashTag", TestDataProvider.EVENT_OWNER_ID,
                            null, null, null, false,
                            Collections.singletonList(TestDataProvider.EVENT_EDITOR_ID), new ArrayList<String>(), null,
                            new DateTime(i), new DateTime(i), -1));
View Full Code Here

        addFormParameter(proxy, "hashTag", "");

        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(DEFAULT_EVENT_ID);
        assertThat(modified.getHashTag(), is(nullValue()));
    }
View Full Code Here

        addFormParameter(proxy, "passcode", "hogehoge");

        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(DEFAULT_EVENT_ID);
        assertThat(modified.getPasscode(), is("hogehoge"));
    }
View Full Code Here

        addFormParameter(proxy, "passcode", "");

        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(DEFAULT_EVENT_ID);
        assertThat(modified.getPasscode(), is(nullValue()));
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dto.Event

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.