Package org.joda.time

Examples of org.joda.time.DateTime.minusDays()


            VEvent event = (VEvent) object;
            assertThat(event.getSummary().getValue(), is("テスト" + i));
            assertThat(event.getDescription().getValue(), is("テスト説明文" + i));
            assertThat(event.getUrl().getValue(), is("http://ryu22e.org/" + i));
            DateTime datetime = new DateTime(2011, 1, 1, 0, 0, 0, 0);
            datetime = datetime.minusDays(i);
            assertThat(event.getStartDate().getDate(), is(notNullValue()));
            assertThat(
                DateUtil.toString(event.getStartDate().getDate()),
                is(DateUtil.toString(datetime.toDate())));
            assertThat(event.getEndDate(), is(notNullValue()));
View Full Code Here


   
    @Test
    public void recalculateModificationDateShouldSetModificationDateAsTheLatestDateAmongAllPosts() {
        DateTime lastModificationDate = new DateTime();
       
        topic.getFirstPost().setCreationDate(lastModificationDate.minusDays(1));
        topic.getPosts().get(1).setCreationDate(lastModificationDate);
        Post post3 = new Post();
        post3.setCreationDate(lastModificationDate.minusDays(2));
       
        topic.addPost(post3);
View Full Code Here

        DateTime lastModificationDate = new DateTime();
       
        topic.getFirstPost().setCreationDate(lastModificationDate.minusDays(1));
        topic.getPosts().get(1).setCreationDate(lastModificationDate);
        Post post3 = new Post();
        post3.setCreationDate(lastModificationDate.minusDays(2));
       
        topic.addPost(post3);
       
        topic.updateModificationDate();
        topic.recalculateModificationDate();
View Full Code Here

    @Test
    public void hasUpdatesShouldReturnFalseInCaseOfNoUpdatesExist() {
        DateTime lastModificationDate = new DateTime();

        topic.getFirstPost().setCreationDate(lastModificationDate.minusDays(1));
        topic.getPosts().get(1).setCreationDate(lastModificationDate);

        topic.setLastReadPostDate(topic.getLastPost().getCreationDate());
        assertFalse(topic.isHasUpdates());
    }
View Full Code Here

    @Test
    public void getFirstUnreadPostIdShouldReturnTheNextPostAfterLastRead() {
        DateTime lastModificationDate = new DateTime();

        topic.getFirstPost().setCreationDate(lastModificationDate.minusDays(1));
        topic.getPosts().get(1).setCreationDate(lastModificationDate);

        topic.setLastReadPostDate(topic.getFirstPost().getCreationDate());

        long id = topic.getFirstUnreadPostId();
View Full Code Here

    @Test
    public void getFirstUnreadPostIdShouldReturnFirstPostIdIfAllPostAreRead() {
        DateTime lastModificationDate = new DateTime();

        topic.getFirstPost().setCreationDate(lastModificationDate.minusDays(1));
        topic.getPosts().get(1).setCreationDate(lastModificationDate);

        long id = topic.getFirstUnreadPostId();

        assertEquals(post1.getId(), id);
View Full Code Here

    }
   
    @Test
    public void testGetLastTouchedDatePostWasModified() {
        DateTime modifiedDate = new DateTime();
        post.setCreationDate(modifiedDate.minusDays(1));
        post.setModificationDate(modifiedDate);
       
        assertEquals(post.getLastTouchedDate(), modifiedDate);
    }
   
View Full Code Here

    public static void testJanitorWithUnmarking() {
        Collection<Resource> crawledResources = new ArrayList<Resource>();
        Map<String, Resource> trackedResources = new HashMap<String, Resource>();
        int n = 10;
        DateTime now = DateTime.now();
        Date markTime = new Date(now.minusDays(5).getMillis());
        Date notifyTime = new Date(now.minusDays(4).getMillis());
        Date terminationTime = new Date(now.minusDays(1).getMillis());
        for (Resource r : generateTestingResources(n)) {
            if (Integer.parseInt(r.getId()) % 3 == 0) {
                trackedResources.put(r.getId(), r);
View Full Code Here

        Collection<Resource> crawledResources = new ArrayList<Resource>();
        Map<String, Resource> trackedResources = new HashMap<String, Resource>();
        int n = 10;
        DateTime now = DateTime.now();
        Date markTime = new Date(now.minusDays(5).getMillis());
        Date notifyTime = new Date(now.minusDays(4).getMillis());
        Date terminationTime = new Date(now.minusDays(1).getMillis());
        for (Resource r : generateTestingResources(n)) {
            if (Integer.parseInt(r.getId()) % 3 == 0) {
                trackedResources.put(r.getId(), r);
                r.setState(CleanupState.MARKED);
View Full Code Here

        Map<String, Resource> trackedResources = new HashMap<String, Resource>();
        int n = 10;
        DateTime now = DateTime.now();
        Date markTime = new Date(now.minusDays(5).getMillis());
        Date notifyTime = new Date(now.minusDays(4).getMillis());
        Date terminationTime = new Date(now.minusDays(1).getMillis());
        for (Resource r : generateTestingResources(n)) {
            if (Integer.parseInt(r.getId()) % 3 == 0) {
                trackedResources.put(r.getId(), r);
                r.setState(CleanupState.MARKED);
                r.setMarkTime(markTime);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.