Package in.partake.base

Examples of in.partake.base.DateTime


public class EventActivityTestDataProvider extends TestDataProvider<EventActivity> {
    @Override
    public EventActivity create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, pkSalt.hashCode());
        return new EventActivity(uuid.toString(), "eventId", "title", "content", new DateTime(0));
    }
View Full Code Here


    }

    @Override
    public List<EventActivity> createSamples() {
        List<EventActivity> array = new ArrayList<EventActivity>();
        array.add(new EventActivity(new UUID(0, 0).toString(), "eventId", "title", "content", new DateTime(0)));
        array.add(new EventActivity(new UUID(0, 1).toString(), "eventId", "title", "content", new DateTime(0)));
        array.add(new EventActivity(new UUID(0, 0).toString(), "eventId1", "title", "content", new DateTime(0)));
        array.add(new EventActivity(new UUID(0, 0).toString(), "eventId", "title1", "content", new DateTime(0)));
        array.add(new EventActivity(new UUID(0, 0).toString(), "eventId", "title", "content1", new DateTime(0)));
        array.add(new EventActivity(new UUID(0, 0).toString(), "eventId", "title", "content", new DateTime(1)));
        return array;
    }
View Full Code Here

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

    }

    @Before
    public void createSamples() {
        samples = new EventComment[] {
            new EventComment("id1", "eventId1", "userId1", "comment1", false, new DateTime(0)),
            new EventComment("id2", "eventId2", "userId2", "comment2", true, new DateTime(1)),
        };
    }
View Full Code Here

    }

    @Override
    public List<UserSentMessage> createSamples() {
        List<UserSentMessage> array = new ArrayList<UserSentMessage>();
        array.add(new UserSentMessage(new UUID(0, 0), "senderId", new ArrayList<String>(), "eventId", "messageId", new DateTime(0L), null));
        array.add(new UserSentMessage(new UUID(0, 1), "senderId", new ArrayList<String>(), "eventId", "messageId", new DateTime(0L), null));
        array.add(new UserSentMessage(new UUID(0, 0), "senderId1", new ArrayList<String>(), "eventId", "messageId", new DateTime(0L), null));
        array.add(new UserSentMessage(new UUID(0, 0), "senderId", Arrays.asList(new String[] { "hoge" }), "eventId", "messageId", new DateTime(0L), null));
        array.add(new UserSentMessage(new UUID(0, 0), "senderId", new ArrayList<String>(), "eventId1", "messageId", new DateTime(0L), null));
        array.add(new UserSentMessage(new UUID(0, 0), "senderId", new ArrayList<String>(), "eventId", "messageId1", new DateTime(0L), null));
        array.add(new UserSentMessage(new UUID(0, 0), "senderId", new ArrayList<String>(), "eventId", "messageId", new DateTime(1L), null));
        array.add(new UserSentMessage(new UUID(0, 0), "senderId", new ArrayList<String>(), "eventId", "messageId", new DateTime(0L), new DateTime(2L)));
        return array;
    }
View Full Code Here

public class UserTestDataProvider extends TestDataProvider<User> {

    @Override
    public User create(long pkNumber, String pkSalt, int objNumber) {
        UUID id = new UUID(pkNumber, ("user" + pkSalt).hashCode());
        return new User(id.toString(), "screenName" + objNumber, "http://www.example.com/", new DateTime(0), null, false);
    }
View Full Code Here

    }

    @Override
    public List<User> createSamples() {
        List<User> array = new ArrayList<User>();
        array.add(new User("id", "screenName", "http://www.example.com/", new DateTime(0), null, false));
        array.add(new User("id1", "screenName", "http://www.example.com/", new DateTime(0), null, false));
        array.add(new User("id", "screenName1", "http://www.example.com/", new DateTime(0), null, false));
        array.add(new User("id", "screenName", "http://www.example.com/hoge", new DateTime(0), null, false));
        array.add(new User("id", "screenName", "http://www.example.com/", new DateTime(1), null, false));
        array.add(new User("id", "screenName", "http://www.example.com/", new DateTime(0), new DateTime(0), false));
        return array;
    }
View Full Code Here

    }

    @Test
    public void sortAllSameValues() {
        List<UserTicketEx> list = Arrays.asList(new UserTicketEx[] {
                new UserTicketEx(new UserTicket("id1", "userID", new UUID(0, 0), "eventId", "comment", null, null, null, null, new DateTime(0), new DateTime(0), null), user),
                new UserTicketEx(new UserTicket("id2", "userID", new UUID(0, 0), "eventId", "comment", null, null, null, null, new DateTime(0), new DateTime(0), null), user),
        });

        Collections.sort(list, comparator);
        Assert.assertTrue(list.get(0).getAppliedAt().compareTo(list.get(1).getAppliedAt()) == 0);
        Assert.assertTrue(list.get(0).getUserId().compareTo(list.get(1).getUserId()) == 0);
View Full Code Here

    }

    @Test
    public void sortParicipationAndNull() {
        List<UserTicketEx> list = Arrays.asList(new UserTicketEx[] {
                new UserTicketEx(new UserTicket("id", "userID", new UUID(0, 0), "eventId", "comment", null, null, null, null, new DateTime(0), new DateTime(0), new DateTime(0)), user),
                null
        });

        Collections.sort(list, comparator);
        Assert.assertNull(list.get(0));
View Full Code Here

    // throwing NullPointerException is needed? really?
    @Test(expected = NullPointerException.class)
    public void sortNullId() {
        List<UserTicketEx> list = Arrays.asList(new UserTicketEx[] {
                new UserTicketEx(new UserTicket(null, null, null, null, "comment", ParticipationStatus.CANCELLED, ModificationStatus.CHANGED, null, null, null, new DateTime(0), null), user),
                new UserTicketEx(new UserTicket(null, null, null, null, "comment", ParticipationStatus.CANCELLED, ModificationStatus.CHANGED, null, null, null, new DateTime(0), null), user),
        });
        Collections.sort(list, comparator);
    }
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.