_ctx = SpringFactory.getXmlWebApplicationContext();
_service = (FeedService) _ctx.getBean("magicbox.feedService");
}
public void testGetFeed() {
DBAnnunci dbannunci = new DBAnnunci();
dbannunci.preparaDb();
try {
SyndFeed synF = _service.getFeed(Constant.FEED_TEXT);
assertNotNull(synF);
assertEquals(synF.getEntries().size(), 9);
assertEquals(((SyndEntryImpl) synF.getEntries().get(0)).getTitle(),
"Saluto");
assertEquals(((SyndEntryImpl) synF.getEntries().get(1)).getTitle(),
"fgdjg");
assertEquals(((SyndEntryImpl) synF.getEntries().get(2)).getTitle(),
"Saluti");
assertEquals(((SyndEntryImpl) synF.getEntries().get(3)).getTitle(),
"saludos");
assertEquals(((SyndEntryImpl) synF.getEntries().get(4)).getTitle(),
"dew");
assertEquals(((SyndEntryImpl) synF.getEntries().get(5)).getTitle(),
"Alta definizione");
assertEquals(((SyndEntryImpl) synF.getEntries().get(6)).getTitle(),
"Espana");
assertEquals(((SyndEntryImpl) synF.getEntries().get(7)).getTitle(),
"Ei fu siccome immobile");
assertEquals(((SyndEntryImpl) synF.getEntries().get(8)).getTitle(),
"pix");
} catch (ParseException e) {
e.printStackTrace();
}
dbannunci.pulisciDb();
}