Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.FeedSubscription


    assertEquals(false, feed.isAutoImport());
    assertEquals("foobar stuff",feed.getMatchText())
  }

  public void testCreateFeedSubscription() throws Exception{
    FeedSubscription feed = new FeedSubscription();
    feed.setBookmark(new Bookmark(302));
    feed.setAutoImport(true);
    feed.setLastSync(null);
    feed.setMatchText("pop");
   
    int id = feedDao.createSubscription(feed);
    assertTrue(id>0);
    feed = feedDao.getSubscription(id);
    assertEquals(302,feed.getBookmark().getId());
    assertEquals("pop",feed.getMatchText());
   
    int id2 = feedDao.createSubscription(feed);
    assertEquals(id,id2);
  }
View Full Code Here


    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

  }
 
  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

    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

    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

    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

 
  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

    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

    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

    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

TOP

Related Classes of com.gnizr.db.dao.FeedSubscription

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.