summaryrefslogtreecommitdiff
path: root/src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java')
-rw-r--r--src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java43
1 files changed, 9 insertions, 34 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java b/src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java
index 2cd5734d5..f91592869 100644
--- a/src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java
+++ b/src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java
@@ -47,42 +47,16 @@ public class HttpDownloaderTest extends AndroidTestCase {
assertNotNull(status);
assertTrue(status.isSuccessful() == expectedResult);
assertTrue(status.isDone());
- assertTrue(new File(feedFile.getFile_url()).exists());
+ // the file should not exist if the download has failed
+ assertTrue(new File(feedFile.getFile_url()).exists() == expectedResult);
}
- public void testRandomUrls() {
- final String[] urls = {
- "http://radiobox.omroep.nl/programme/read_programme_podcast/9168/read.rss",
- "http://content.zdf.de/podcast/zdf_heute/heute_a.xml",
- "http://rss.sciam.com/sciam/60secsciencepodcast",
- "http://rss.sciam.com/sciam/60-second-mind",
- "http://rss.sciam.com/sciam/60-second-space",
- "http://rss.sciam.com/sciam/60-second-health",
- "http://rss.sciam.com/sciam/60-second-tech",
- "http://risky.biz/feeds/risky-business",
- "http://risky.biz/feeds/rb2",
- "http://podcast.hr-online.de/lateline/podcast.xml",
- "http://bitlove.org/nsemak/mikrodilettanten/feed",
- "http://bitlove.org/moepmoeporg/riotburnz/feed",
- "http://bitlove.org/moepmoeporg/schachcast/feed",
- "http://bitlove.org/moepmoeporg/sundaymoaning/feed",
- "http://bitlove.org/motofunk/anekdotkast/feed",
- "http://bitlove.org/motofunk/motofunk/feed",
- "http://bitlove.org/nerdinand/zch/feed",
- "http://podcast.homerj.de/podcasts.xml",
- "http://www.dradio.de/rss/podcast/sendungen/wissenschaftundbildung/",
- "http://www.dradio.de/rss/podcast/sendungen/wirtschaftundverbraucher/",
- "http://www.dradio.de/rss/podcast/sendungen/literatur/",
- "http://www.dradio.de/rss/podcast/sendungen/sport/",
- "http://www.dradio.de/rss/podcast/sendungen/wirtschaftundgesellschaft/",
- "http://www.dradio.de/rss/podcast/sendungen/filmederwoche/",
- "http://www.blacksweetstories.com/feed/podcast/",
- "http://feeds.5by5.tv/buildanalyze",
- "http://bitlove.org/ranzzeit/ranz/feed"
- };
- for (int i = 0; i < urls.length; i++) {
- download(urls[i], Integer.toString(i), true);
- }
+ public void testPassingHttp() {
+ download("http://httpbin.org/status/200", "test200", true);
+ }
+
+ public void testPassingHttps() {
+ download("https://httpbin.org/status/200", "test200", true);
}
public void testRedirect() {
@@ -111,6 +85,7 @@ public class HttpDownloaderTest extends AndroidTestCase {
downloader.call();
}
};
+ t.start();
downloader.cancel();
try {
t.join();