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());
}