diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-30 12:39:51 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-30 18:30:48 +0100 |
commit | 4bdf95bd455a0b32e370a063d69ad5613ba78ac0 (patch) | |
tree | 468484cde6d0a2bf9ea0346e523dfdf77362826b /app/src/androidTest | |
parent | e00f08963b61589418eb823f579fd49567fdae34 (diff) | |
download | AntennaPod-4bdf95bd455a0b32e370a063d69ad5613ba78ac0.zip |
Change feed lastModified/lastUpdate to String
Diffstat (limited to 'app/src/androidTest')
11 files changed, 36 insertions, 43 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java b/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java index 5836bb699..ee454ce8a 100644 --- a/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/handler/FeedHandlerTest.java @@ -162,7 +162,7 @@ public class FeedHandlerTest extends InstrumentationTestCase { if (withImage) { image = new FeedImage(0, "image", null, "http://example.com/picture", false); } - Feed feed = new Feed(0, new Date(), "title", "http://example.com", "This is the description", + Feed feed = new Feed(0, null, "title", "http://example.com", "This is the description", "http://example.com/payment", "Daniel", "en", null, "http://example.com/feed", image, file.getAbsolutePath(), "http://example.com/feed", true); feed.setItems(new ArrayList<FeedItem>()); diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java index d7a170c17..7862e986d 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java @@ -115,7 +115,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { private Playable writeTestPlayable(String downloadUrl, String fileUrl) { final Context c = getInstrumentation().getTargetContext(); - Feed f = new Feed(0, new Date(), "f", "l", "d", null, null, null, null, "i", null, null, "l", false); + Feed f = new Feed(0, null, "f", "l", "d", null, null, null, null, "i", null, null, "l", false); FeedPreferences prefs = new FeedPreferences(f.getId(), false, FeedPreferences.AutoDeleteAction.NO, null, null); f.setPreferences(prefs); f.setItems(new ArrayList<>()); diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java index f06d2f2a6..5c3d32960 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java @@ -48,7 +48,7 @@ public class PlaybackServiceTaskManagerTest extends InstrumentationTestCase { private List<FeedItem> writeTestQueue(String pref) { final Context c = getInstrumentation().getTargetContext(); final int NUM_ITEMS = 10; - Feed f = new Feed(0, new Date(), "title", "link", "d", null, null, null, null, "id", null, "null", "url", false); + Feed f = new Feed(0, null, "title", "link", "d", null, null, null, null, "id", null, "null", "url", false); f.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS; i++) { f.getItems().add(new FeedItem(0, pref + i, pref + i, "link", new Date(), FeedItem.PLAYED, f)); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java b/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java index afdaeead0..7300df395 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBCleanupTests.java @@ -87,7 +87,7 @@ public class DBCleanupTests extends InstrumentationTestCase { public void testPerformAutoCleanupShouldDelete() throws IOException { final int NUM_ITEMS = EPISODE_CACHE_SIZE * 2; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); feed.setItems(items); List<File> files = new ArrayList<>(); @@ -143,7 +143,7 @@ public class DBCleanupTests extends InstrumentationTestCase { public void testPerformAutoCleanupHandleUnplayed() throws IOException { final int NUM_ITEMS = EPISODE_CACHE_SIZE * 2; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<FeedItem>(); feed.setItems(items); List<File> files = new ArrayList<File>(); @@ -159,7 +159,7 @@ public class DBCleanupTests extends InstrumentationTestCase { public void testPerformAutoCleanupShouldNotDeleteBecauseInQueue() throws IOException { final int NUM_ITEMS = EPISODE_CACHE_SIZE * 2; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); feed.setItems(items); List<File> files = new ArrayList<>(); @@ -198,7 +198,7 @@ public class DBCleanupTests extends InstrumentationTestCase { public void testPerformAutoCleanupShouldNotDeleteBecauseFavorite() throws IOException { final int NUM_ITEMS = EPISODE_CACHE_SIZE * 2; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); feed.setItems(items); List<File> files = new ArrayList<>(); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBNullCleanupAlgorithmTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBNullCleanupAlgorithmTest.java index 18a8d63d1..7205b42c4 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBNullCleanupAlgorithmTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBNullCleanupAlgorithmTest.java @@ -82,7 +82,7 @@ public class DBNullCleanupAlgorithmTest extends InstrumentationTestCase { public void testPerformAutoCleanupShouldNotDelete() throws IOException { final int NUM_ITEMS = EPISODE_CACHE_SIZE * 2; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); feed.setItems(items); List<File> files = new ArrayList<>(); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java index 890897f43..3bd508eaf 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java @@ -32,7 +32,7 @@ public class DBQueueCleanupAlgorithmTest extends DBCleanupTests { public void testPerformAutoCleanupHandleUnplayed() throws IOException { final int NUM_ITEMS = EPISODE_CACHE_SIZE * 2; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); feed.setItems(items); List<File> files = new ArrayList<>(); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java index 3988669ce..0fc3b1892 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java @@ -54,10 +54,10 @@ public class DBReaderTest extends InstrumentationTestCase { PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); - Feed feed1 = new Feed(0, new Date(), "A", "link", "d", null, null, null, "rss", "A", null, "", "", true); - Feed feed2 = new Feed(0, new Date(), "b", "link", "d", null, null, null, "rss", "b", null, "", "", true); - Feed feed3 = new Feed(0, new Date(), "C", "link", "d", null, null, null, "rss", "C", null, "", "", true); - Feed feed4 = new Feed(0, new Date(), "d", "link", "d", null, null, null, "rss", "d", null, "", "", true); + Feed feed1 = new Feed(0, null, "A", "link", "d", null, null, null, "rss", "A", null, "", "", true); + Feed feed2 = new Feed(0, null, "b", "link", "d", null, null, null, "rss", "b", null, "", "", true); + Feed feed3 = new Feed(0, null, "C", "link", "d", null, null, null, "rss", "C", null, "", "", true); + Feed feed4 = new Feed(0, null, "d", "link", "d", null, null, null, "rss", "d", null, "", "", true); adapter.setCompleteFeed(feed1); adapter.setCompleteFeed(feed2); adapter.setCompleteFeed(feed3); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java index 1894d6585..5b2393d45 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java @@ -1,13 +1,9 @@ package de.test.antennapod.storage; import android.content.Context; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; import android.test.FlakyTest; import android.test.InstrumentationTestCase; -import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -15,14 +11,11 @@ import java.util.List; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; -import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.PodDBAdapter; -import static de.test.antennapod.storage.DBTestUtils.saveFeedlist; - /** * Test class for DBTasks */ @@ -57,7 +50,7 @@ public class DBTasksTest extends InstrumentationTestCase { public void testUpdateFeedNewFeed() { final int NUM_ITEMS = 10; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS; i++) { feed.getItems().add(new FeedItem(0, "item " + i, "id " + i, "link " + i, new Date(), FeedItem.UNPLAYED, feed)); @@ -75,8 +68,8 @@ public class DBTasksTest extends InstrumentationTestCase { /** Two feeds with the same title, but different download URLs should be treated as different feeds. */ public void testUpdateFeedSameTitle() { - Feed feed1 = new Feed("url1", new Date(), "title"); - Feed feed2 = new Feed("url2", new Date(), "title"); + Feed feed1 = new Feed("url1", null, "title"); + Feed feed2 = new Feed("url2", null, "title"); feed1.setItems(new ArrayList<>()); feed2.setItems(new ArrayList<>()); @@ -91,7 +84,7 @@ public class DBTasksTest extends InstrumentationTestCase { final int NUM_ITEMS_OLD = 10; final int NUM_ITEMS_NEW = 10; - final Feed feed = new Feed("url", new Date(), "title"); + final Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS_OLD; i++) { feed.getItems().add(new FeedItem(0, "item " + i, "id " + i, "link " + i, new Date(i), FeedItem.PLAYED, feed)); diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java b/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java index 0af8afa83..78b807710 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java @@ -44,7 +44,7 @@ public class DBTestUtils { PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); for (int i = 0; i < numFeeds; i++) { - Feed f = new Feed(0, new Date(), "feed " + i, "link" + i, "descr", null, null, + Feed f = new Feed(0, null, "feed " + i, "link" + i, "descr", null, null, null, null, "id" + i, null, null, "url" + i, false, new FlattrStatus(), false, null, null, false); f.setItems(new ArrayList<>()); for (int j = 0; j < numItems; j++) { diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java index eaae9323c..b767f4bb6 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java @@ -65,7 +65,7 @@ public class DBWriterTest extends InstrumentationTestCase { final int PLAYED_DURATION = 60; final int DURATION = 100; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); feed.setItems(items); FeedItem item = new FeedItem(0, "Item", "Item", "url", new Date(), FeedItem.PLAYED, feed); @@ -95,7 +95,7 @@ public class DBWriterTest extends InstrumentationTestCase { assertTrue(dest.createNewFile()); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); feed.setItems(items); FeedItem item = new FeedItem(0, "Item", "Item", "url", new Date(), FeedItem.PLAYED, feed); @@ -124,7 +124,7 @@ public class DBWriterTest extends InstrumentationTestCase { File destFolder = getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER); assertNotNull(destFolder); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); // create Feed image @@ -197,7 +197,7 @@ public class DBWriterTest extends InstrumentationTestCase { File destFolder = getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER); assertNotNull(destFolder); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); feed.setImage(null); @@ -253,7 +253,7 @@ public class DBWriterTest extends InstrumentationTestCase { File destFolder = getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER); assertNotNull(destFolder); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(null); // create Feed image @@ -290,7 +290,7 @@ public class DBWriterTest extends InstrumentationTestCase { File destFolder = getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER); assertNotNull(destFolder); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); // create Feed image @@ -342,7 +342,7 @@ public class DBWriterTest extends InstrumentationTestCase { File destFolder = getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER); assertNotNull(destFolder); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); // create Feed image @@ -400,7 +400,7 @@ public class DBWriterTest extends InstrumentationTestCase { File destFolder = getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER); assertNotNull(destFolder); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); // create Feed image @@ -472,7 +472,7 @@ public class DBWriterTest extends InstrumentationTestCase { File destFolder = getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER); assertNotNull(destFolder); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<FeedItem>()); // create Feed image @@ -528,7 +528,7 @@ public class DBWriterTest extends InstrumentationTestCase { private FeedMedia playbackHistorySetup(Date playbackCompletionDate) { final Context context = getInstrumentation().getTargetContext(); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<FeedItem>()); FeedItem item = new FeedItem(0, "title", "id", "link", new Date(), FeedItem.PLAYED, feed); FeedMedia media = new FeedMedia(0, item, 10, 0, 1, "mime", null, "url", false, playbackCompletionDate, 0, 0); @@ -571,7 +571,7 @@ public class DBWriterTest extends InstrumentationTestCase { private Feed queueTestSetupMultipleItems(final int NUM_ITEMS) throws InterruptedException, ExecutionException, TimeoutException { final Context context = getInstrumentation().getTargetContext(); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS; i++) { FeedItem item = new FeedItem(0, "title " + i, "id " + i, "link " + i, new Date(), FeedItem.PLAYED, feed); @@ -598,7 +598,7 @@ public class DBWriterTest extends InstrumentationTestCase { public void testAddQueueItemSingleItem() throws InterruptedException, ExecutionException, TimeoutException { final Context context = getInstrumentation().getTargetContext(); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); FeedItem item = new FeedItem(0, "title", "id", "link", new Date(), FeedItem.PLAYED, feed); feed.getItems().add(item); @@ -622,7 +622,7 @@ public class DBWriterTest extends InstrumentationTestCase { public void testAddQueueItemSingleItemAlreadyInQueue() throws InterruptedException, ExecutionException, TimeoutException { final Context context = getInstrumentation().getTargetContext(); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); FeedItem item = new FeedItem(0, "title", "id", "link", new Date(), FeedItem.PLAYED, feed); feed.getItems().add(item); @@ -688,7 +688,7 @@ public class DBWriterTest extends InstrumentationTestCase { public void testRemoveQueueItem() throws InterruptedException, ExecutionException, TimeoutException { final int NUM_ITEMS = 10; final Context context = getInstrumentation().getTargetContext(); - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS; i++) { FeedItem item = new FeedItem(0, "title " + i, "id " + i, "link " + i, new Date(), FeedItem.PLAYED, feed); @@ -733,7 +733,7 @@ public class DBWriterTest extends InstrumentationTestCase { public void testMoveQueueItem() throws InterruptedException, ExecutionException, TimeoutException { final int NUM_ITEMS = 10; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS; i++) { FeedItem item = new FeedItem(0, "title " + i, "id " + i, "link " + i, new Date(), FeedItem.PLAYED, feed); @@ -779,7 +779,7 @@ public class DBWriterTest extends InstrumentationTestCase { public void testMarkFeedRead() throws InterruptedException, ExecutionException, TimeoutException { final int NUM_ITEMS = 10; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<FeedItem>()); for (int i = 0; i < NUM_ITEMS; i++) { FeedItem item = new FeedItem(0, "title " + i, "id " + i, "link " + i, new Date(), FeedItem.UNPLAYED, feed); @@ -805,7 +805,7 @@ public class DBWriterTest extends InstrumentationTestCase { public void testMarkAllItemsReadSameFeed() throws InterruptedException, ExecutionException, TimeoutException { final int NUM_ITEMS = 10; - Feed feed = new Feed("url", new Date(), "title"); + Feed feed = new Feed("url", null, "title"); feed.setItems(new ArrayList<>()); for (int i = 0; i < NUM_ITEMS; i++) { FeedItem item = new FeedItem(0, "title " + i, "id " + i, "link " + i, new Date(), FeedItem.UNPLAYED, feed); diff --git a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java index 13abbb1cc..432d4a4e6 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -143,7 +143,7 @@ public class UITestUtils { for (int i = 0; i < NUM_FEEDS; i++) { File bitmapFile = newBitmapFile("image" + i); FeedImage image = new FeedImage(0, "image " + i, null, hostFile(bitmapFile), false); - Feed feed = new Feed(0, new Date(), "Title " + i, "http://example.com/" + i, "Description of feed " + i, + Feed feed = new Feed(0, null, "Title " + i, "http://example.com/" + i, "Description of feed " + i, "http://example.com/pay/feed" + i, "author " + i, "en", Feed.TYPE_RSS2, "feed" + i, image, null, "http://example.com/feed/src/" + i, false); image.setOwner(feed); |