summaryrefslogtreecommitdiff
path: root/src/instrumentationTest/de/test
diff options
context:
space:
mode:
authorTom Hennen <tom.hennen@gmail.com>2013-09-09 18:20:15 -0400
committerTom Hennen <tom.hennen@gmail.com>2013-09-09 18:20:15 -0400
commitc960a65189014fddbf7336c028385b350fdca504 (patch)
tree482ce1490a92d738b16aff8c9bec5ba189872a68 /src/instrumentationTest/de/test
parentd538e3899c65992870e1866b1d27fc7cd5385ce7 (diff)
parent02926a6e5ffa968d08efeae5012a0ecf41a6f33a (diff)
downloadAntennaPod-c960a65189014fddbf7336c028385b350fdca504.zip
Merge branch 'develop' of https://github.com/danieloeh/AntennaPod into pause-on-interrupt
Diffstat (limited to 'src/instrumentationTest/de/test')
-rw-r--r--src/instrumentationTest/de/test/antennapod/gpodnet/GPodnetServiceTest.java114
1 files changed, 114 insertions, 0 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/gpodnet/GPodnetServiceTest.java b/src/instrumentationTest/de/test/antennapod/gpodnet/GPodnetServiceTest.java
new file mode 100644
index 000000000..a96fc7aab
--- /dev/null
+++ b/src/instrumentationTest/de/test/antennapod/gpodnet/GPodnetServiceTest.java
@@ -0,0 +1,114 @@
+package instrumentationTest.de.test.antennapod.gpodnet;
+
+import android.test.AndroidTestCase;
+import android.util.Log;
+import de.danoeh.antennapod.gpoddernet.GpodnetService;
+import de.danoeh.antennapod.gpoddernet.GpodnetServiceException;
+import de.danoeh.antennapod.gpoddernet.model.GpodnetDevice;
+import de.danoeh.antennapod.gpoddernet.model.GpodnetTag;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Test class for GpodnetService
+ */
+public class GPodnetServiceTest extends AndroidTestCase {
+
+ private GpodnetService service;
+
+ private static final String USER = "";
+ private static final String PW = "";
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ service = new GpodnetService();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private void authenticate() throws GpodnetServiceException {
+ service.authenticate(USER, PW);
+ }
+
+ public void testUploadSubscription() throws GpodnetServiceException {
+ authenticate();
+ ArrayList<String> l = new ArrayList<String>();
+ l.add("http://bitsundso.de/feed");
+ service.uploadSubscriptions(USER, "radio", l);
+ }
+
+ public void testUploadSubscription2() throws GpodnetServiceException {
+ authenticate();
+ ArrayList<String> l = new ArrayList<String>();
+ l.add("http://bitsundso.de/feed");
+ l.add("http://gamesundso.de/feed");
+ service.uploadSubscriptions(USER, "radio", l);
+ }
+
+ public void testUploadChanges() throws GpodnetServiceException {
+ authenticate();
+ String[] URLS = {"http://bitsundso.de/feed", "http://gamesundso.de/feed", "http://cre.fm/feed/mp3/", "http://freakshow.fm/feed/m4a/"};
+ List<String> subscriptions = Arrays.asList(URLS[0], URLS[1]);
+ List<String> removed = Arrays.asList(URLS[0]);
+ List<String> added = Arrays.asList(URLS[2], URLS[3]);
+ service.uploadSubscriptions(USER, "radio", subscriptions);
+ service.uploadChanges(USER, "radio", added, removed);
+ }
+
+ public void testGetSubscriptionChanges() throws GpodnetServiceException {
+ authenticate();
+ service.getSubscriptionChanges(USER, "radio", 1362322610L);
+ }
+
+ public void testGetSubscriptionsOfUser()
+ throws GpodnetServiceException {
+ authenticate();
+ service.getSubscriptionsOfUser(USER);
+ }
+
+ public void testGetSubscriptionsOfDevice()
+ throws GpodnetServiceException {
+ authenticate();
+ service.getSubscriptionsOfDevice(USER, "radio");
+ }
+
+ public void testConfigureDevices() throws GpodnetServiceException {
+ authenticate();
+ service.configureDevice(USER, "foo", "This is an updated caption",
+ GpodnetDevice.DeviceType.LAPTOP);
+ }
+
+ public void testGetDevices() throws GpodnetServiceException {
+ authenticate();
+ service.getDevices(USER);
+ }
+
+ public void testGetSuggestions() throws GpodnetServiceException {
+ authenticate();
+ service.getSuggestions(10);
+ }
+
+ public void testTags() throws GpodnetServiceException {
+ service.getTopTags(20);
+ }
+
+ public void testPodcastForTags() throws GpodnetServiceException {
+ List<GpodnetTag> tags = service.getTopTags(20);
+ service.getPodcastsForTag(tags.get(1),
+ 10);
+ }
+
+ public void testSearch() throws GpodnetServiceException {
+ service.searchPodcasts("linux", 64);
+ }
+
+ public void testToplist() throws GpodnetServiceException {
+ service.getPodcastToplist(10);
+ }
+}