diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-19 10:56:42 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-19 10:56:42 +0200 |
commit | a86cf89183b091f995b9ad046b7f8af5e1a0c55a (patch) | |
tree | a42c32040b6566b494dedefadeb2d0415f01a2c3 /src/instrumentationTest/de/test/antennapod | |
parent | 6e1a533bf7e56e6af722f5696c09619745564504 (diff) | |
download | AntennaPod-a86cf89183b091f995b9ad046b7f8af5e1a0c55a.zip |
Fixed HttpDownloaderTest
Diffstat (limited to 'src/instrumentationTest/de/test/antennapod')
-rw-r--r-- | src/instrumentationTest/de/test/antennapod/service/download/HttpDownloaderTest.java | 43 |
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(); |