diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-02-17 21:40:04 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-02-17 21:40:04 +0100 |
commit | 02653918f0290dcff582987b52cd99c6ea707ed9 (patch) | |
tree | 41b1c62d9a4a839f543186b604f280d659fbb11a /src/instrumentationTest/de | |
parent | a2f841c43e95c8b3743788e7bbc505c90045e73b (diff) | |
parent | 33b1f107441dc83cc3917078cf9164f00e7ff8b1 (diff) | |
download | AntennaPod-02653918f0290dcff582987b52cd99c6ea707ed9.zip |
Merge branch 'flattr_queue_autoflattr' into develop (#331)
Other changes:
- Changed FlattrStatusFetcher into Thread-subclass
- Changed auto-flattr mechanism so that it's compatible with the updated PlaybackService
- Changed a couple of strings
Conflicts:
src/de/danoeh/antennapod/storage/DBReader.java
src/de/danoeh/antennapod/storage/DBWriter.java
src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java
src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java
Diffstat (limited to 'src/instrumentationTest/de')
5 files changed, 17 insertions, 13 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java b/src/instrumentationTest/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java index fac293693..8a270715f 100644 --- a/src/instrumentationTest/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java +++ b/src/instrumentationTest/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java @@ -108,7 +108,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { f.setItems(new ArrayList<FeedItem>()); FeedItem i = new FeedItem(0, "t", "i", "l", new Date(), false, f); f.getItems().add(i); - FeedMedia media = new FeedMedia(0, i, 0, 0, 0, "audio/wav", fileUrl, downloadUrl, fileUrl != null, null); + FeedMedia media = new FeedMedia(0, i, 0, 0, 0, "audio/wav", fileUrl, downloadUrl, fileUrl != null, null, 0); i.setMedia(media); PodDBAdapter adapter = new PodDBAdapter(c); adapter.open(); diff --git a/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java b/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java index a214e55bc..78fe3b701 100644 --- a/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java +++ b/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java @@ -7,6 +7,8 @@ import de.danoeh.antennapod.feed.FeedItem; import de.danoeh.antennapod.feed.FeedMedia; import de.danoeh.antennapod.storage.DBReader; import de.danoeh.antennapod.storage.PodDBAdapter; +import de.danoeh.antennapod.util.flattr.FlattrStatus; +import static instrumentationTest.de.test.antennapod.storage.DBTestUtils.*; import java.util.ArrayList; import java.util.Date; @@ -41,7 +43,7 @@ public class DBReaderTest extends InstrumentationTestCase { private void expiredFeedListTestHelper(long lastUpdate, long expirationTime, boolean shouldReturn) { final Context context = getInstrumentation().getTargetContext(); Feed feed = new Feed(0, new Date(lastUpdate), "feed", "link", "descr", null, - null, null, null, "feed", null, null, "url", false); + null, null, null, "feed", null, null, "url", false, new FlattrStatus()); feed.setItems(new ArrayList<FeedItem>()); PodDBAdapter adapter = new PodDBAdapter(context); adapter.open(); diff --git a/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java b/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java index e9b871867..2372757ce 100644 --- a/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java +++ b/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java @@ -11,6 +11,7 @@ import de.danoeh.antennapod.preferences.UserPreferences; import de.danoeh.antennapod.storage.DBReader; import de.danoeh.antennapod.storage.DBTasks; import de.danoeh.antennapod.storage.PodDBAdapter; +import de.danoeh.antennapod.util.flattr.FlattrStatus; import java.io.File; import java.io.IOException; @@ -76,7 +77,7 @@ public class DBTasksTest extends InstrumentationTestCase { File f = new File(destFolder, "file " + i); assertTrue(f.createNewFile()); files.add(f); - item.setMedia(new FeedMedia(0, item, 1, 0, 1L, "m", f.getAbsolutePath(), "url", true, new Date(NUM_ITEMS - i))); + item.setMedia(new FeedMedia(0, item, 1, 0, 1L, "m", f.getAbsolutePath(), "url", true, new Date(NUM_ITEMS - i), 0)); items.add(item); } @@ -114,7 +115,7 @@ public class DBTasksTest extends InstrumentationTestCase { assertTrue(f.createNewFile()); assertTrue(f.exists()); files.add(f); - item.setMedia(new FeedMedia(0, item, 1, 0, 1L, "m", f.getAbsolutePath(), "url", true, new Date(NUM_ITEMS - i))); + item.setMedia(new FeedMedia(0, item, 1, 0, 1L, "m", f.getAbsolutePath(), "url", true, new Date(NUM_ITEMS - i), 0)); items.add(item); } @@ -148,7 +149,7 @@ public class DBTasksTest extends InstrumentationTestCase { assertTrue(f.createNewFile()); assertTrue(f.exists()); files.add(f); - item.setMedia(new FeedMedia(0, item, 1, 0, 1L, "m", f.getAbsolutePath(), "url", true, new Date(NUM_ITEMS - i))); + item.setMedia(new FeedMedia(0, item, 1, 0, 1L, "m", f.getAbsolutePath(), "url", true, new Date(NUM_ITEMS - i), 0)); items.add(item); } @@ -279,7 +280,7 @@ public class DBTasksTest extends InstrumentationTestCase { final Context context = getInstrumentation().getTargetContext(); UserPreferences.setUpdateInterval(context, expirationTime); Feed feed = new Feed(0, new Date(lastUpdate), "feed", "link", "descr", null, - null, null, null, "feed", null, null, "url", false); + null, null, null, "feed", null, null, "url", false, new FlattrStatus()); feed.setItems(new ArrayList<FeedItem>()); PodDBAdapter adapter = new PodDBAdapter(context); adapter.open(); diff --git a/src/instrumentationTest/de/test/antennapod/storage/DBTestUtils.java b/src/instrumentationTest/de/test/antennapod/storage/DBTestUtils.java index fbb7b0386..7e9e1b908 100644 --- a/src/instrumentationTest/de/test/antennapod/storage/DBTestUtils.java +++ b/src/instrumentationTest/de/test/antennapod/storage/DBTestUtils.java @@ -6,6 +6,7 @@ import de.danoeh.antennapod.feed.FeedItem; import de.danoeh.antennapod.feed.FeedMedia; import de.danoeh.antennapod.storage.PodDBAdapter; import de.danoeh.antennapod.util.comparator.FeedItemPubdateComparator; +import de.danoeh.antennapod.util.flattr.FlattrStatus; import junit.framework.Assert; import java.util.ArrayList; @@ -31,7 +32,7 @@ public class DBTestUtils { adapter.open(); for (int i = 0; i < numFeeds; i++) { Feed f = new Feed(0, new Date(), "feed " + i, "link" + i, "descr", null, null, - null, null, "id" + i, null, null, "url" + i, false); + null, null, "id" + i, null, null, "url" + i, false, new FlattrStatus()); f.setItems(new ArrayList<FeedItem>()); for (int j = 0; j < numItems; j++) { FeedItem item = new FeedItem(0, "item " + j, "id" + j, "link" + j, new Date(), diff --git a/src/instrumentationTest/de/test/antennapod/storage/DBWriterTest.java b/src/instrumentationTest/de/test/antennapod/storage/DBWriterTest.java index 429903cba..679ae1ad3 100644 --- a/src/instrumentationTest/de/test/antennapod/storage/DBWriterTest.java +++ b/src/instrumentationTest/de/test/antennapod/storage/DBWriterTest.java @@ -64,7 +64,7 @@ public class DBWriterTest extends InstrumentationTestCase { feed.setItems(items); FeedItem item = new FeedItem(0, "Item", "Item", "url", new Date(), true, feed); - FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", dest.getAbsolutePath(), "download_url", true, null); + FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", dest.getAbsolutePath(), "download_url", true, null, 0); item.setMedia(media); items.add(item); @@ -108,7 +108,7 @@ public class DBWriterTest extends InstrumentationTestCase { assertTrue(enc.createNewFile()); itemFiles.add(enc); - FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", true, null); + FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", true, null, 0); item.setMedia(media); } @@ -169,7 +169,7 @@ public class DBWriterTest extends InstrumentationTestCase { assertTrue(enc.createNewFile()); itemFiles.add(enc); - FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", true, null); + FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", true, null, 0); item.setMedia(media); } @@ -317,7 +317,7 @@ public class DBWriterTest extends InstrumentationTestCase { File enc = new File(destFolder, "file " + i); itemFiles.add(enc); - FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", false, null); + FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", false, null, 0); item.setMedia(media); } @@ -389,7 +389,7 @@ public class DBWriterTest extends InstrumentationTestCase { File enc = new File(destFolder, "file " + i); itemFiles.add(enc); - FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", false, null); + FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", false, null, 0); item.setMedia(media); } @@ -430,7 +430,7 @@ public class DBWriterTest extends InstrumentationTestCase { Feed feed = new Feed("url", new Date(), "title"); feed.setItems(new ArrayList<FeedItem>()); FeedItem item = new FeedItem(0, "title", "id", "link", new Date(), true, feed); - FeedMedia media = new FeedMedia(0, item, 10, 0, 1, "mime", null, "url", false, playbackCompletionDate); + FeedMedia media = new FeedMedia(0, item, 10, 0, 1, "mime", null, "url", false, playbackCompletionDate, 0); feed.getItems().add(item); item.setMedia(media); PodDBAdapter adapter = new PodDBAdapter(context); |