feed2 = DynamicDAO.save(tempFeed);
} catch (PersistenceException e) {
fail(e.getMessage());
return;
}
final News initialNews1 = (News) createNews(feed1);
initialNews1.setState(State.NEW);
final News initialNews2 = (News) createNews(feed2);
initialNews2.setState(State.NEW);
final NewsReference[] newsRef = new NewsReference[1];
newsAdapter = new NewsAdapter() {
@Override
public void entitiesAdded(Set<NewsEvent> events) {
assertEquals(1, events.size());
newsRef[0] = new NewsReference(events.iterator().next().getEntity().getId());
}
};
DynamicDAO.addEntityListener(INews.class, newsAdapter);
INews newsItem1 = null;
NewsReference newsRef1 = null;
INews newsItem2 = null;
NewsReference newsRef2 = null;
NewsReference newsRef3 = null;
try {
DynamicDAO.save(feed1);
newsRef1 = newsRef[0];
newsItem1 = newsRef1.resolve();
feed2 = DynamicDAO.save(feed2);
newsRef2 = newsRef[0];
newsItem2 = newsRef2.resolve();
final News initialNews3 = (News) createNews(feed2);
initialNews3.setTitle("Some other title");
initialNews3.setGuid(null);
initialNews3.setLink(null);
initialNews3.setState(State.NEW);
DynamicDAO.save(feed2);
newsRef3 = newsRef[0];
} catch (PersistenceException e) {
fail(e.getMessage());
return;