Package de.jetwick.util

Examples of de.jetwick.util.MyDate.toDate()


        twSearch.store(new JTweet(1L, "wikileaks is not a wtf", new JUser("userA")), false);
        twSearch.store(new JTweet(2L, "news about wikileaks", new JUser("userB")), false);

        // find dup is restricted to the last hour so use a current date
        MyDate dt = new MyDate();
        JTweet tw3 = new JTweet(3L, "wtf means wikileaks task force", new JUser("userC")).setCreatedAt(dt.toDate());
        JTweet tw4 = new JTweet(4L, "wtf wikileaks task force", new JUser("userD")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw5 = new JTweet(5L, "RT @userC: wtf means wikileaks task force", new JUser("userE")).setCreatedAt(dt.plusMinutes(1).toDate());       
        twSearch.queueObjects(Arrays.asList(tw3, tw4, tw5));
        twSearch.forceEmptyQueueAndRefresh();
        assertEquals("should be empty. should NOT find tweet 4 because it is younger", 0, tw3.getDuplicates().size());
View Full Code Here


    @Test
    public void testSuggestFilterRemoval() {
        MyDate md = new MyDate();
        twSearch.testUpdate(Arrays.asList(
                createTweet(1L, "RT @user3: test this first tweet", "peter").setCreatedAt(md.toDate()),
                createTweet(2L, "test others", "peter2").setCreatedAt(md.toDate()),
                createTweet(3L, "testnot this", "peter3").setCreatedAt(md.minusHours(2).toDate()),
                createTweet(4L, "test this", "peter4").setCreatedAt(md.toDate())));

        JetwickQuery q = new TweetQuery(false).addIsOriginalTweetFilter().
View Full Code Here

    @Test
    public void testSuggestFilterRemoval() {
        MyDate md = new MyDate();
        twSearch.testUpdate(Arrays.asList(
                createTweet(1L, "RT @user3: test this first tweet", "peter").setCreatedAt(md.toDate()),
                createTweet(2L, "test others", "peter2").setCreatedAt(md.toDate()),
                createTweet(3L, "testnot this", "peter3").setCreatedAt(md.minusHours(2).toDate()),
                createTweet(4L, "test this", "peter4").setCreatedAt(md.toDate())));

        JetwickQuery q = new TweetQuery(false).addIsOriginalTweetFilter().
                addLatestDateFilter(1).
View Full Code Here

        MyDate md = new MyDate();
        twSearch.testUpdate(Arrays.asList(
                createTweet(1L, "RT @user3: test this first tweet", "peter").setCreatedAt(md.toDate()),
                createTweet(2L, "test others", "peter2").setCreatedAt(md.toDate()),
                createTweet(3L, "testnot this", "peter3").setCreatedAt(md.minusHours(2).toDate()),
                createTweet(4L, "test this", "peter4").setCreatedAt(md.toDate())));

        JetwickQuery q = new TweetQuery(false).addIsOriginalTweetFilter().
                addLatestDateFilter(1).
                addUserFilter("peter");
        Collection<String> keys = twSearch.suggestRemoval(q);
View Full Code Here

    @Test
    public void testSuggestFilterRemoval2() {
        MyDate md = new MyDate();
        twSearch.testUpdate(Arrays.asList(
                createTweet(1L, "RT @user3: test this first tweet", "peter1").setCreatedAt(md.toDate()),
                createTweet(2L, "test others", "peter2").setCreatedAt(md.toDate()),
                createTweet(3L, "testnot this", "peter3").setCreatedAt(md.minusHours(2).toDate()),
                createTweet(4L, "test this", "peter4").setCreatedAt(md.toDate())));

        JetwickQuery q = new TweetQuery(false).addIsOriginalTweetFilter().
View Full Code Here

    @Test
    public void testSuggestFilterRemoval2() {
        MyDate md = new MyDate();
        twSearch.testUpdate(Arrays.asList(
                createTweet(1L, "RT @user3: test this first tweet", "peter1").setCreatedAt(md.toDate()),
                createTweet(2L, "test others", "peter2").setCreatedAt(md.toDate()),
                createTweet(3L, "testnot this", "peter3").setCreatedAt(md.minusHours(2).toDate()),
                createTweet(4L, "test this", "peter4").setCreatedAt(md.toDate())));

        JetwickQuery q = new TweetQuery(false).addIsOriginalTweetFilter().
                addLatestDateFilter(1).
View Full Code Here

        MyDate md = new MyDate();
        twSearch.testUpdate(Arrays.asList(
                createTweet(1L, "RT @user3: test this first tweet", "peter1").setCreatedAt(md.toDate()),
                createTweet(2L, "test others", "peter2").setCreatedAt(md.toDate()),
                createTweet(3L, "testnot this", "peter3").setCreatedAt(md.minusHours(2).toDate()),
                createTweet(4L, "test this", "peter4").setCreatedAt(md.toDate())));

        JetwickQuery q = new TweetQuery(false).addIsOriginalTweetFilter().
                addLatestDateFilter(1).
                addUserFilter("peter");
        Collection<String> keys = twSearch.suggestRemoval(q);
View Full Code Here

            // first day           
            rfb.addUnboundedTo(Helper.toLocalDateTime(date.castToDay().toDate()));

            for (int i = 0; i < 7; i++) {
                // 'from' must be smaller than 'to'!
                Date oldDate = date.toDate();
                rfb.addRange(Helper.toLocalDateTime(date.minusDays(1).toDate()),
                        Helper.toLocalDateTime(oldDate));
            }

            // oldest
View Full Code Here

                rfb.addRange(Helper.toLocalDateTime(date.minusDays(1).toDate()),
                        Helper.toLocalDateTime(oldDate));
            }

            // oldest
            rfb.addUnboundedFrom(Helper.toLocalDateTime(date.toDate()));
            srb.addFacet(rfb);
        }

        return srb;
    }
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.