Package in.partake.base

Examples of in.partake.base.DateTime


    public void createFixtures(PartakeConnection con, IPartakeDAOs daos) throws DAOException {
        IUserNotificationAccess dao = daos.getUserNotificationAccess();
        dao.truncate(con);

        dao.put(con, new UserNotification(USER_NOTIFICATION_INQUEUE_ID, DEFAULT_EVENT_TICKET_ID, DEFAULT_USER_ID, NotificationType.EVENT_ONEDAY_BEFORE_REMINDER, MessageDelivery.INQUEUE, new DateTime(0), null));
    }
View Full Code Here


public class MessageEnvelopeTestDataProvider extends TestDataProvider<MessageEnvelope> {
    @Override
    public MessageEnvelope create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, pkSalt.hashCode());
        MessageEnvelope envelope = new MessageEnvelope(uuid.toString(), "userMessageId", null, null, 0, null, null, null, new DateTime(objNumber), null);
        return envelope;
    }
View Full Code Here

    }

    @Override
    public List<MessageEnvelope> createSamples() {
        List<MessageEnvelope> array = new ArrayList<MessageEnvelope>();
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, null, 0, null, null, null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 1).toString(), "userMessageId", null, null, 0, null, null, null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId1", null, null, 0, null, null, null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", "hoge", null, 0, null, null, null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, "fuga", 0, null, null, null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, null, 1, null, null, null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, null, 0, new DateTime(0), null, null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, null, 0, null, new DateTime(0), null, new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, null, 0, null, null, new DateTime(0), new DateTime(0), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, null, 0, null, null, null, new DateTime(1), null));
        array.add(new MessageEnvelope(new UUID(0, 0).toString(), "userMessageId", null, null, 0, null, null, null, new DateTime(0), new DateTime(0)));
        return array;
    }
View Full Code Here

    @Override
    public void createFixtures(PartakeConnection con, IPartakeDAOs daos) throws DAOException {
        IMessageAccess dao = daos.getMessageAccess();
        dao.truncate(con);

        dao.put(con, new Message(DEFAULT_MESSAGE_ID, "subject", "body", new DateTime(0L), null));
    }
View Full Code Here

    }

    private List<Pair<UUID, String>> prepareEvents(int n) throws Exception {
        List<Pair<UUID, String>> ids = new ArrayList<Pair<UUID, String>>();

        DateTime now = TimeUtil.getCurrentDateTime();
        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,
View Full Code Here

            UUID ticketId = ids.get(i).getFirst();
            String eventId = ids.get(i).getSecond();
            ParticipationStatus status = ParticipationStatus.ENROLLED;
            ModificationStatus modificationStatus = ModificationStatus.CHANGED;
            AttendanceStatus attendanceStatus = AttendanceStatus.UNKNOWN;
            DateTime enrolledAt = new DateTime(TimeUtil.getCurrentTime() + (ids.size() - i) * 1000);
            UserTicket enrollment = new UserTicket(null, userId, ticketId, eventId, "comment", status, modificationStatus, attendanceStatus, null, enrolledAt, enrolledAt, enrolledAt);
            userTicketIds.add(storeEnrollment(enrollment));
        }
        return userTicketIds;
    }
View Full Code Here

        assertThat(modified.getBeginDate(), is(TimeUtil.create(2012, 8, 1, 0, 0, 0)));
    }

    @Test
    public void testToModifyBeginDateFromEpoc() throws Exception {
        DateTime dt = TimeUtil.create(2012, 8, 1, 0, 0, 0);

        ActionProxy proxy = getActionProxy(POST, "/api/event/modify");
        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "beginDate", String.valueOf(dt.getTime()));

        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(DEFAULT_EVENT_ID);
View Full Code Here

    // --- enddata

    @Test
    public void testToModifyEndDate() throws Exception {
        DateTime newEndDate = TimeUtil.getCurrentDateTime().nDayAfter(10).adjustByMinutes();
       
        ActionProxy proxy = getActionProxy(POST, "/api/event/modify");
        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "endDate", newEndDate.toHumanReadableFormat());
        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(DEFAULT_EVENT_ID);
        assertThat(modified.getEndDate(), is(newEndDate));
View Full Code Here

        assertThat(modified.getEndDate(), is(newEndDate));
    }

    @Test
    public void testToModifyEndDateFromEpoc() throws Exception {
        DateTime tomorrow = TimeUtil.getCurrentDateTime().nDayAfter(1);

        ActionProxy proxy = getActionProxy(POST, "/api/event/modify");
        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "endDate", String.valueOf(tomorrow.getTime()));

        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(DEFAULT_EVENT_ID);
View Full Code Here

        UUID uuid = new UUID(pkNumber, ("comment" + pkSalt).hashCode());
        String eventId = new UUID(pkNumber, ("comment" + pkSalt).hashCode()).toString();
        String userId  = new UUID(objNumber, "user".hashCode()).toString();
        String comment = "";
        boolean isHTML = false;
        DateTime createdAt = new DateTime(objNumber);
        return new EventComment(uuid.toString(), eventId, userId, comment, isHTML, createdAt);
    }
View Full Code Here

TOP

Related Classes of in.partake.base.DateTime

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.