Fixed FeedHandlerTest

This commit is contained in:
ByteHamster 2019-03-23 10:45:50 +01:00
parent 0a9735e7da
commit 022a7f6981
3 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package de.test.antennapod.handler;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.test.InstrumentationTestCase;
import org.xml.sax.SAXException;
@ -36,7 +37,7 @@ public class FeedHandlerTest extends InstrumentationTestCase {
protected void setUp() throws Exception {
super.setUp();
Context context = getInstrumentation().getContext();
Context context = InstrumentationRegistry.getTargetContext();
File destDir = context.getExternalFilesDir(FEEDS_DIR);
assertNotNull(destDir);

View File

@ -56,6 +56,11 @@ public class AtomGenerator implements FeedGenerator{
xml.text(feed.getDescription());
xml.endTag(null, "subtitle");
}
if (feed.getImageUrl() != null) {
xml.startTag(null, "logo");
xml.text(feed.getImageUrl());
xml.endTag(null, "logo");
}
if (feed.getPaymentLink() != null) {
GeneratorUtil.addPaymentLink(xml, feed.getPaymentLink(), false);

View File

@ -54,6 +54,13 @@ public class RSS2Generator implements FeedGenerator{
xml.text(feed.getLanguage());
xml.endTag(null, "language");
}
if (feed.getImageUrl() != null) {
xml.startTag(null, "image");
xml.startTag(null, "url");
xml.text(feed.getImageUrl());
xml.endTag(null, "url");
xml.endTag(null, "image");
}
if (feed.getPaymentLink() != null) {
GeneratorUtil.addPaymentLink(xml, feed.getPaymentLink(), true);