Fixed FeedHandlerTest
This commit is contained in:
parent
0a9735e7da
commit
022a7f6981
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue