Package de.jetwick.util

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


        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());
        assertEquals("should find tweet 3", 1, tw4.getDuplicates().size());
View Full Code Here


        // 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());
        assertEquals("should find tweet 3", 1, tw4.getDuplicates().size());
View Full Code Here

        twSearch.forceEmptyQueueAndRefresh();
        assertEquals("should be empty. should NOT find tweet 4 because it is younger", 0, tw3.getDuplicates().size());
        assertEquals("should find tweet 3", 1, tw4.getDuplicates().size());

        Map<Long, JTweet> map = new LinkedHashMap<Long, JTweet>();
        JTweet tw = new JTweet(10L, "wtf wikileaks task force", new JUser("peter")).setCreatedAt(dt.plusMinutes(1).toDate());
        map.put(10L, tw);
        twSearch.findDuplicates(map);
        assertEquals("should find tweets 3 and 4", 2, tw.getDuplicates().size());
    }
   
View Full Code Here

    }
   
    @Test
    public void testSpamDuplicates() {
        MyDate dt = new MyDate();
        JTweet tw1 = new JTweet(1L, "2488334. Increase your twitter followers now! Buy Twitter Followers", new JUser("userA")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw2 = new JTweet(2L, "349366. Increase your twitter followers now! Buy Twitter Followers", new JUser("userB")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw3 = new JTweet(31L, "2040312. Increase your twitter followers now! Buy Twitter Followers", new JUser("userC")).setCreatedAt(dt.plusMinutes(1).toDate());       
        twSearch.queueObjects(Arrays.asList(tw1, tw2, tw3));
        twSearch.forceEmptyQueueAndRefresh();
View Full Code Here

   
    @Test
    public void testSpamDuplicates() {
        MyDate dt = new MyDate();
        JTweet tw1 = new JTweet(1L, "2488334. Increase your twitter followers now! Buy Twitter Followers", new JUser("userA")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw2 = new JTweet(2L, "349366. Increase your twitter followers now! Buy Twitter Followers", new JUser("userB")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw3 = new JTweet(31L, "2040312. Increase your twitter followers now! Buy Twitter Followers", new JUser("userC")).setCreatedAt(dt.plusMinutes(1).toDate());       
        twSearch.queueObjects(Arrays.asList(tw1, tw2, tw3));
        twSearch.forceEmptyQueueAndRefresh();

        assertEquals(0, tw1.getDuplicates().size());
View Full Code Here

    @Test
    public void testSpamDuplicates() {
        MyDate dt = new MyDate();
        JTweet tw1 = new JTweet(1L, "2488334. Increase your twitter followers now! Buy Twitter Followers", new JUser("userA")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw2 = new JTweet(2L, "349366. Increase your twitter followers now! Buy Twitter Followers", new JUser("userB")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw3 = new JTweet(31L, "2040312. Increase your twitter followers now! Buy Twitter Followers", new JUser("userC")).setCreatedAt(dt.plusMinutes(1).toDate());       
        twSearch.queueObjects(Arrays.asList(tw1, tw2, tw3));
        twSearch.forceEmptyQueueAndRefresh();

        assertEquals(0, tw1.getDuplicates().size());
        assertEquals(1, tw2.getDuplicates().size());
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.