Package in.partake.base

Examples of in.partake.base.DateTime


    @Override
    public List<EventComment> createSamples() {
        List<EventComment> list = new ArrayList<EventComment>();

        DateTime now = new DateTime(0);
        list.add(new EventComment("id", "eventId", "userId", "comment", false, now));
        list.add(new EventComment("id1", "eventId1", "userId", "comment", false, now));
        list.add(new EventComment("id", "eventId1", "userId", "comment", false, now));
        list.add(new EventComment("id", "eventId", "userId1", "comment", false, now));
        list.add(new EventComment("id", "eventId", "userId", "comment1", false, now));
        list.add(new EventComment("id", "eventId", "userId", "comment", true, now));
        list.add(new EventComment("id", "eventId", "userId", "comment", false, new DateTime(now.getTime() + 1)));

        return list;
    }
View Full Code Here


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

        DateTime now = TimeUtil.getCurrentDateTime();

        dao.put(con, new EventComment(OWNER_COMMENT_ID, DEFAULT_EVENT_ID, EVENT_OWNER_ID, "comment", false, now));
        dao.put(con, new EventComment(EDITOR_COMMENT_ID, DEFAULT_EVENT_ID, EVENT_EDITOR_ID, "comment", false, now));
        dao.put(con, new EventComment(COMMENTOR_COMMENT_ID, DEFAULT_EVENT_ID, EVENT_COMMENTOR_ID, "comment", false, now));
        dao.put(con, new EventComment(UNRELATED_USER_COMMENT_ID, DEFAULT_EVENT_ID, EVENT_UNRELATED_USER_ID, "comment", false, now));
View Full Code Here

        return PartakeTestApp.getTestService().getTestDataProviderSet().getMessageProvider();
    }

    @Test
    public void testToCopy() {
        DateTime dt = new DateTime(0);
        UUID id = UUID.randomUUID();
        Message message = new Message(id, "title", "body", dt, dt);
        Message copied = new Message(message);
        Assert.assertEquals(message, copied);
        Assert.assertEquals(message, new Message(id, "title", "body", dt, dt));
View Full Code Here

                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));
                }

                return null;
            }
        }.execute();
View Full Code Here

public class EventMessageTestDataProvider extends TestDataProvider<EventMessage> {
    @Override
    public EventMessage create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, pkSalt.hashCode());
        EventMessage message = new EventMessage(uuid.toString(), "eventId", "senderId", "messageId", new DateTime(objNumber), null);
        return message;
    }
View Full Code Here

    }

    @Override
    public List<EventMessage> createSamples() {
        List<EventMessage> array = new ArrayList<EventMessage>();
        array.add(new EventMessage(new UUID(0, 0).toString(), "eventId", "senderId", "messageId", new DateTime(0), null));
        array.add(new EventMessage(new UUID(0, 1).toString(), "eventId", "senderId", "messageId", new DateTime(0), null));
        array.add(new EventMessage(new UUID(0, 0).toString(), "eventId1", "senderId", "messageId", new DateTime(0), null));
        array.add(new EventMessage(new UUID(0, 0).toString(), "eventId", "senderId1", "messageId", new DateTime(0), null));
        array.add(new EventMessage(new UUID(0, 0).toString(), "eventId", "senderId", "messageId1", new DateTime(0), null));
        array.add(new EventMessage(new UUID(0, 0).toString(), "eventId", "senderId", "messageId", new DateTime(1), null));
        array.add(new EventMessage(new UUID(0, 0).toString(), "eventId", "senderId", "messageId", new DateTime(0), new DateTime(1)));
        return array;
    }
View Full Code Here

        Collections.sort(list, comparator);
    }

    private Event createEvent(String id, int beginYear, int beginMonth, int beginDay, int beginHour, int beginMin) {
        Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("JST"), Locale.JAPANESE);
        DateTime createdAt = new DateTime(calendar.getTimeInMillis());

        calendar.clear();
        calendar.set(Calendar.YEAR, beginYear);
        calendar.set(Calendar.MONTH, beginMonth - 1);
        calendar.set(Calendar.DAY_OF_MONTH, beginDay);
        calendar.set(Calendar.HOUR_OF_DAY, beginHour);
        calendar.set(Calendar.MINUTE, beginMin);

        DateTime beginDate = new DateTime(calendar.getTimeInMillis());

        Event event = new Event(id, "title", "summary", "category", beginDate, null,
                "url", "place", "address", "description", "hashTag", "ownerId", null, null,
                "passcode", false, null, new ArrayList<String>(), null, createdAt, null, 0);
        return event;
View Full Code Here

public class MessageTestDataProvider extends TestDataProvider<Message> {
    @Override
    public Message create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, pkSalt.hashCode());
        return new Message(uuid, "subject", "body", new DateTime(objNumber), null);
    }
View Full Code Here

    }

    @Override
    public List<Message> createSamples() {
        List<Message> array = new ArrayList<Message>();
        array.add(new Message(new UUID(0, 0), "subject", "body", new DateTime(0), null));
        array.add(new Message(new UUID(0, 1), "subject", "body", new DateTime(0), null));
        array.add(new Message(new UUID(0, 0), "subject1", "body", new DateTime(0), null));
        array.add(new Message(new UUID(0, 0), "subject", "body1", new DateTime(0), null));
        array.add(new Message(new UUID(0, 0), "subject", "body", new DateTime(1L), null));
        array.add(new Message(new UUID(0, 0), "subject", "body", new DateTime(0), new DateTime(0)));
        return array;
    }
View Full Code Here

        UUID uuid = new UUID(pkNumber, ("eventticket" + pkSalt).hashCode());
        return new EventTicket(uuid, DEFAULT_EVENT_ID, 0, "name" + objNumber,
                TicketApplicationStart.ANYTIME, 0, null,
                TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null,
                TicketReservationEnd.TILL_NHOUR_BEFORE, 3, null,
                TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null);
    }
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.