Examples of FeedSubscription


Examples of com.gnizr.db.dao.FeedSubscription

    int id2 = feedDao.createSubscription(feed);
    assertEquals(id,id2);
  }
 
  public void testDeleteFeedSubscription() throws Exception{
    FeedSubscription f = feedDao.getSubscription(new User(1), "http://rss.slashdot.org/Slashdot/slashdot");
    assertNotNull(f);
   
    boolean okay = feedDao.deleteSubscription(new User(1), "http://rss.slashdot.org/Slashdot/slashdot");
    assertTrue(okay);
    
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

  }
 
  public void testUpdateFeedSubscription() throws Exception{
    Date now = GregorianCalendar.getInstance().getTime();
   
    FeedSubscription feed = feedDao.getSubscription(10);
    assertEquals(300,feed.getBookmark().getId());
    assertEquals("",feed.getMatchText());
    assertEquals(true,feed.isAutoImport());
    assertTrue(now.after(feed.getLastSync()));
    assertNull(feed.getPubDate());
   
    feed.setBookmark(new Bookmark(302));
    feed.setMatchText("abcd 123");
    feed.setAutoImport(false);
    feed.setLastSync(now);
    feed.setPubDate(now);
   
    boolean okay = feedDao.updateSubscription(feed);
    assertTrue(okay);
   
    feed = feedDao.getSubscription(10);
    assertEquals(302,feed.getBookmark().getId());
    assertEquals("abcd 123",feed.getMatchText());
    assertEquals(false,feed.isAutoImport());
    assertNotNull(feed.getPubDate())
  }
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

    assertEquals(false,feed.isAutoImport());
    assertNotNull(feed.getPubDate())
  }
 
  public void testListImportFolders() throws Exception{
    List<Folder> folders = feedDao.listImportFolder(new FeedSubscription(10));
    assertEquals(2,folders.size());
   
    folders = feedDao.listImportFolder(new FeedSubscription(20));
    assertEquals(3,folders.size());
   
    for(Folder f : folders){
      if(f.getId() == 1){
        assertEquals(2,f.getUser().getId());
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

    return new FlatXmlDataSet(TestFeedSubscriptionManager.class
        .getResourceAsStream("/TestFeedSubscriptionManager-input.xml"));
  }
 
  public void testGetSubscriptionById() throws Exception{
    FeedSubscription feed = feedManager.getSubscription(20);
    assertNotNull(feed);
    assertEquals(301,feed.getBookmark().getId());
    assertEquals("foobar stuff",feed.getMatchText());
  }
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

    assertEquals(301,feed.getBookmark().getId());
    assertEquals("foobar stuff",feed.getMatchText());
  }
 
  public void testGetSubscriptionByOwnerIdFeedUrl() throws Exception{
    FeedSubscription feed = feedManager.getSubscription(new User("hchen1"), "http://rss.slashdot.org/Slashdot/slashdot");
    assertEquals(301,feed.getBookmark().getId());
    assertEquals(20,feed.getId());
   
    feed = feedManager.getSubscription(new User("jsmith"), "http://rss.cnn.com/rss/cnn_topstories.rss");
    assertEquals(10,feed.getId());
    assertEquals(300,feed.getBookmark().getId());
  }
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

 
  public void testCreateSubscription() throws Exception{
    User user = new User("jsmith");
    String feedUrl = "http://foo.com/rss";
    String feedTitle = "hello foo.com rss";
    FeedSubscription feed = feedManager.createSubscription(user, feedUrl, feedTitle);
    assertNotNull(feed);
    assertEquals(feedUrl,feed.getBookmark().getLink().getUrl());
    assertEquals(feedTitle, feed.getBookmark().getTitle());
    assertEquals(2,feed.getBookmark().getUser().getId());   
   
    user = new User("hchen1");
    feedUrl = "http://rss.slashdot.org/Slashdot/slashdot";
    feedTitle = "xyz";
    feed = feedManager.createSubscription(user, feedUrl, feedTitle);
    assertNotNull(feed);
    assertEquals(feedUrl,feed.getBookmark().getLink().getUrl());
    assertEquals("Slashdot Feed",feed.getBookmark().getTitle());
    assertEquals(20,feed.getId());
  }
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

    assertEquals("Slashdot Feed",feed.getBookmark().getTitle());
    assertEquals(20,feed.getId());
  }
 
  public void testDeleteSubscription() throws Exception{
    FeedSubscription feed = feedManager.getSubscription(20);
    assertNotNull(feed);
   
    boolean okay = feedManager.deleteSubscription(new User("hchen1"),
        "http://rss.slashdot.org/Slashdot/slashdot");
    assertTrue(okay);
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

    feed = feedManager.getSubscription(20);
    assertNull(feed);
  }

  public void testUpdateSubscription() throws Exception{
    FeedSubscription feed = feedManager.getSubscription(20);
    assertNotNull(feed);
    assertFalse(feed.isAutoImport());
    assertEquals("foobar stuff",feed.getMatchText())
   
    feed.setAutoImport(true);
    feed.setMatchText("abcdefg");
   
    boolean okay = feedManager.updateSubscription(feed);
    assertTrue(okay);
   
    feed =  feedManager.getSubscription(20);
    assertNotNull(feed);
    assertTrue(feed.isAutoImport());
    assertEquals("abcdefg",feed.getMatchText())
  }
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

    assertEquals(3,cnt);
   
    List<Folder> folders = feedManager.listImportFolder(feedOwner, feedUrl);
    assertEquals(3,folders.size());
   
    FeedSubscription feed = feedManager.getSubscription(feedOwner, feedUrl);
    assertEquals(feedUrl,feed.getBookmark().getLink().getUrl());
    assertEquals(feedTitle,feed.getBookmark().getTitle());
  }
View Full Code Here

Examples of com.gnizr.db.dao.FeedSubscription

              }
            }
          }                   
        }
        if(feedLastUpdated != null){
          FeedSubscription feed = new FeedSubscription(srcFeed);
          feed.setLastSync(feedLastUpdated);
          feed.setPubDate(feedPubDate);
          feedSubscriptionManager.updateSubscription(feed);
          logger.debug("set FeedSubscription lastUpdate to: " + feedLastUpdated);
        }else{
          logger.error("feedLastUpdate is NULL");
        }
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.