Search in sources :

Example 1 with RSS2Generator

use of de.test.antennapod.util.syndication.feedgenerator.RSS2Generator in project AntennaPod by AntennaPod.

the class FeedHandlerTest method testRSS2Basic.

public void testRSS2Basic() throws IOException, UnsupportedFeedtypeException, SAXException, ParserConfigurationException {
    Feed f1 = createTestFeed(10, false, true, true);
    Feed f2 = runFeedTest(f1, new RSS2Generator(), "UTF-8", RSS2Generator.FEATURE_WRITE_GUID);
    feedValid(f1, f2, Feed.TYPE_RSS2);
}
Also used : RSS2Generator(de.test.antennapod.util.syndication.feedgenerator.RSS2Generator) Feed(de.danoeh.antennapod.core.feed.Feed)

Example 2 with RSS2Generator

use of de.test.antennapod.util.syndication.feedgenerator.RSS2Generator in project AntennaPod by AntennaPod.

the class UITestUtils method hostFeed.

private String hostFeed(Feed feed) throws IOException {
    File feedFile = new File(hostedFeedDir, feed.getTitle());
    FileOutputStream out = new FileOutputStream(feedFile);
    RSS2Generator generator = new RSS2Generator();
    generator.writeFeed(feed, out, "UTF-8", 0);
    out.close();
    int id = server.serveFile(feedFile);
    Assert.assertTrue(id != -1);
    return String.format("%s/files/%d", HTTPBin.BASE_URL, id);
}
Also used : FileOutputStream(java.io.FileOutputStream) RSS2Generator(de.test.antennapod.util.syndication.feedgenerator.RSS2Generator) File(java.io.File)

Aggregations

RSS2Generator (de.test.antennapod.util.syndication.feedgenerator.RSS2Generator)2 Feed (de.danoeh.antennapod.core.feed.Feed)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1