use of com.rometools.rome.feed.synd.SyndEntryImpl in project rssriver by dadoonet.
the class RssToJsonTest method shouldHaveRawContent.
@Test
public void shouldHaveRawContent() throws Exception {
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(getClass().getResource("/dcrainmaker/rss.xml")));
assertThat(feed.getEntries().size(), greaterThan(0));
for (Object o : feed.getEntries()) {
SyndEntryImpl message = (SyndEntryImpl) o;
XContentBuilder xcb = toJson(message, null, null, true);
assertThat(xcb, notNullValue());
assertThat(xcb.string(), containsString("<p>"));
logger.info(xcb.string());
}
}
use of com.rometools.rome.feed.synd.SyndEntryImpl in project asterixdb by apache.
the class RSSFeedServlet method getFeed.
protected SyndFeed getFeed(IServletRequest req) throws IOException, FeedException, ParseException {
SyndFeed feed = new SyndFeedImpl();
feed.setTitle("Sample Feed (created with ROME)");
feed.setLink("http://rome.dev.java.net");
feed.setDescription("This feed has been created using ROME (Java syndication utilities");
List<SyndEntry> entries = new ArrayList<>();
SyndEntry entry;
SyndContent description;
entry = new SyndEntryImpl();
entry.setTitle("AsterixDB 0.8.7");
entry.setLink("http://http://asterixdb.apache.org/docs/0.8.7-incubating/index.html");
entry.setPublishedDate(DATE_PARSER.parse("2012-06-08"));
description = new SyndContentImpl();
description.setType("text/plain");
description.setValue("AsterixDB 0.8.7 Release");
entry.setDescription(description);
entries.add(entry);
entry = new SyndEntryImpl();
entry.setTitle("Couchbase 4.1");
entry.setLink("http://blog.couchbase.com/2015/december/introducing-couchbase-server-4.1");
entry.setPublishedDate(DATE_PARSER.parse("2015-12-09"));
description = new SyndContentImpl();
description.setType("text/plain");
description.setValue("Couchbase Server 4.1 Release. Bug fixes, minor API changes and some new features");
entry.setDescription(description);
entries.add(entry);
entry = new SyndEntryImpl();
entry.setTitle("ROME v0.3");
entry.setLink("http://wiki.java.net/bin/view/Javawsxml/rome03");
entry.setPublishedDate(DATE_PARSER.parse("2004-07-27"));
description = new SyndContentImpl();
description.setType("text/html");
description.setValue("<p>Bug fixes, API changes, some new features and some Unit testing</p>" + "<p>For details check the <a href=\"https://rometools.jira.com/wiki/display/ROME/Change+Log#" + "ChangeLog-Changesmadefromv0.3tov0.4\">Changes Log for 0.3</a></p>");
entry.setDescription(description);
entries.add(entry);
entry = new SyndEntryImpl();
entry.setTitle("ROME v0.4");
entry.setLink("http://wiki.java.net/bin/view/Javawsxml/rome04");
entry.setPublishedDate(DATE_PARSER.parse("2004-09-24"));
description = new SyndContentImpl();
description.setType("text/html");
description.setValue("<p>Bug fixes, API changes, some new features, Unit testing completed</p>" + "<p>For details check the <a href=\"https://rometools.jira.com/wiki/display/ROME/Change+Log#" + "ChangeLog-Changesmadefromv0.4tov0.5\">Changes Log for 0.4</a></p>");
entry.setDescription(description);
entries.add(entry);
feed.setEntries(entries);
return feed;
}
Aggregations