Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.FeedSubscription


    action.setFeedUrl(feedUrl);
    action.setFeedTitle("java feed");
    String code = action.execute();
    assertEquals(ActionSupport.SUCCESS, code);
   
    FeedSubscription feed = feedManager.getSubscription(new User("hchen1"),feedUrl );
    assertNotNull(feed);
    assertEquals(feedUrl,feed.getBookmark().getLink().getUrl());
  }
View Full Code Here


    action.setFeedTitle("fjdskla");

    String code = action.execute();
    assertEquals(ActionSupport.SUCCESS,code);
   
    FeedSubscription feed = action.getFeed();
    assertEquals(20,feed.getId());
    assertEquals("Slashdot Feed",feed.getBookmark().getTitle());   
  }
View Full Code Here

    action.setFeedTitle("fjdskla");
   
    String code = action.doDeleteSubscription();
    assertEquals(ActionSupport.SUCCESS,code);
   
    FeedSubscription feed = feedManager.getSubscription(new User("hchen1"),feedUrl );
    assertNull(feed);
  }
View Full Code Here

      }
    }
  }
 
  public void testAddImportFolder() throws Exception{
    List<Folder> folders = feedDao.listImportFolder(new FeedSubscription(10));
    assertEquals(2,folders.size());
   
    List<Folder> f2add = new ArrayList<Folder>();
    f2add.add(new Folder(3));
   
    int cnt = feedDao.addImportFolders(new FeedSubscription(10), f2add);
    assertEquals(1,cnt);
   
    folders = feedDao.listImportFolder(new FeedSubscription(10));
    assertEquals(3,folders.size())
   
    cnt = feedDao.addImportFolders(new FeedSubscription(10), f2add);
    folders = feedDao.listImportFolder(new FeedSubscription(10));
    assertEquals(3,folders.size())
  }
View Full Code Here

    folders = feedDao.listImportFolder(new FeedSubscription(10));
    assertEquals(3,folders.size())
  }
 
  public void testRemoveImportFolder() throws Exception{
    List<Folder> folders = feedDao.listImportFolder(new FeedSubscription(20));
    assertEquals(3,folders.size());
   
    List<Folder> f2rm = new ArrayList<Folder>();
    f2rm.add(new Folder(3));
   
    int cnt = feedDao.removeImportFolders(new FeedSubscription(20), f2rm);
    assertEquals(1,cnt);
   
    folders = feedDao.listImportFolder(new FeedSubscription(20));
    assertEquals(2,folders.size());   
    f2rm.add(new Folder(1));
    f2rm.add(new Folder(2));
   
    cnt = feedDao.removeImportFolders(new FeedSubscription(20), f2rm);
    assertEquals(2,cnt);
   
    folders = feedDao.listImportFolder(new FeedSubscription(20));
    assertEquals(0,folders.size());   
  }
View Full Code Here

  public void testPageSubscriptionByOwnerId() throws Exception{
    DaoResult<FeedSubscription> result = feedDao.pageSubscription(new User(1),0,10);
    assertEquals(1,result.getSize());
    assertEquals(1,result.getResult().size());
   
    FeedSubscription feed = result.getResult().get(0);
    assertEquals(3,feed.getImportFolders().size());
   
   
    FeedSubscription newFeed = new FeedSubscription();
    newFeed.setBookmark(new Bookmark(302));
    newFeed.setAutoImport(false);
    newFeed.setMatchText("999");
   
    int id = feedDao.createSubscription(newFeed);
    assertTrue(id > 0);
   
    result = feedDao.pageSubscription(new User(1),0,10);
View Full Code Here

  protected void tearDown() throws Exception {
    super.tearDown();
  }
 
  public void testDoCrawl1() throws Exception{
    FeedSubscription slashgeo = feedManager.getSubscription(400);
    assertNotNull(slashgeo);
    FeedCrawlResult result = crawler.doCrawl(slashgeo);
    assertNotNull(result);   
    assertEquals(25,result.getEntries().size());
    boolean foundGeoRss = false;
View Full Code Here

    }
    assertTrue(foundGeoRss);
  }
 
  public void testDoCrawl2() throws Exception{
    FeedSubscription feed402 = feedManager.getSubscription(402);
    FeedCrawlResult result = crawler.doCrawl(feed402);
    assertEquals(159,result.getEntries().size());
    boolean foundGeoRss = false;
    for(BookmarkEntry e: result.getEntries()){
      if(e.getPointMarkers().isEmpty() == false){
View Full Code Here

  protected IDataSet getDataSet() throws Exception {
    return new FlatXmlDataSet(TestFeedSubscriptionDBDao.class.getResourceAsStream("/dbunit/feeddbdao/TestFeedSubscriptionDBDao1-input.xml"));
  }
 
  public void testGetFeedSubscriptionById() throws Exception{
    FeedSubscription feed = feedDao.getSubscription(10);
    assertNotNull(feed);
    assertEquals(10,feed.getId());
    assertEquals(2,feed.getBookmark().getUser().getId());
    assertEquals(202,feed.getBookmark().getLink().getId());
    List<String> tags = feed.getBookmark().getTagList();
    assertTrue(tags.contains("news"));
    assertTrue(tags.contains("cnn"));
   
    assertEquals(true, feed.isAutoImport());
    assertEquals("",feed.getMatchText());
 
    assertEquals(2,feed.getImportFolders().size());
    assertTrue(feed.getImportFolders().contains("my folder1"));
    assertTrue(feed.getImportFolders().contains("my folder2"));
   
    feed = feedDao.getSubscription(30);
    assertNull(feed);
   
    feed = feedDao.getSubscription(20);
    assertNotNull(feed);
    assertEquals(false, feed.isAutoImport());
    assertEquals("foobar stuff",feed.getMatchText());
  }
View Full Code Here

    assertEquals("foobar stuff",feed.getMatchText());
  }
 
  public void testGetFeedSubscriptionByUserIdFeedUrl() throws Exception{
    String url = "http://rss.slashdot.org/Slashdot/slashdot";
    FeedSubscription feed = feedDao.getSubscription(new User(1),url);
    assertNotNull(feed);
    assertEquals(20,feed.getId());
    assertEquals(1,feed.getBookmark().getUser().getId());
    assertEquals(203,feed.getBookmark().getLink().getId());
    assertEquals(3,feed.getImportFolders().size());
     
    assertEquals(false, feed.isAutoImport());
    assertEquals("foobar stuff",feed.getMatchText())
  }
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.