/**
* @throws Exception
*/
@Test
public void testSetNewsStateOnPlanet() throws Exception {
NewsListener newsListener = null;
try {
NewsService service = Controller.getDefault().getNewsService();
IFeed feed1 = fFactory.createFeed(null, new URI("http://www.feed.com"));
IFeed feed2 = fFactory.createFeed(null, new URI("http://www.feed2.com"));
INews news1 = fFactory.createNews(null, feed1, new Date());
news1.setLink(new URI("www.link.com"));
INews news2 = fFactory.createNews(null, feed2, new Date());
news2.setLink(new URI("www.link.com"));
fFactory.createNews(null, feed1, new Date());
fFactory.createNews(null, feed2, new Date());
feed1 = DynamicDAO.save(feed1);
feed2 = DynamicDAO.save(feed2);
assertEquals(2, service.getUnreadCount(news1.getFeedReference()));
assertEquals(2, service.getNewCount(news1.getFeedReference()));
assertEquals(2, service.getUnreadCount(news2.getFeedReference()));
assertEquals(2, service.getNewCount(news2.getFeedReference()));
final long feed1ID = feed1.getId();
final long feed2ID = feed2.getId();
final long news1ID = feed1.getNews().get(0).getId();
final long news2ID = feed2.getNews().get(0).getId();
newsListener = new NewsListener() {
public void entitiesAdded(Set<NewsEvent> events) {
fail("Unexpected Event!");
}
public void entitiesDeleted(Set<NewsEvent> events) {