diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-07-28 17:35:09 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-07-28 17:35:09 -0400 |
commit | 65daa76d51b2301c183f70b20f3e5a26d80135ef (patch) | |
tree | 3ce00c678be1034fb0c6d5559fc9d4d2620c5ed2 /app | |
parent | d1ef7f63ff3e66f95c510939717aa935cadb2f7b (diff) | |
parent | c2beb98ae8d8252ebd6f082da2d75f66471a308d (diff) | |
download | AntennaPod-65daa76d51b2301c183f70b20f3e5a26d80135ef.zip |
Merge pull request #1036 from TomHennen/fix_timeofdayrefresh
Fix Time of Day Refresh
Diffstat (limited to 'app')
4 files changed, 2 insertions, 67 deletions
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 1b77baea0..11a34813a 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java @@ -42,38 +42,6 @@ public class DBReaderTest extends InstrumentationTestCase { adapter.close(); } - 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, new FlattrStatus(), false, null, null, false); - feed.setItems(new ArrayList<FeedItem>()); - PodDBAdapter adapter = new PodDBAdapter(context); - adapter.open(); - adapter.setCompleteFeed(feed); - adapter.close(); - - assertTrue(feed.getId() != 0); - List<Feed> expiredFeeds = DBReader.getExpiredFeedsList(context, expirationTime); - assertNotNull(expiredFeeds); - if (shouldReturn) { - assertTrue(expiredFeeds.size() == 1); - assertTrue(expiredFeeds.get(0).getId() == feed.getId()); - } else { - assertTrue(expiredFeeds.isEmpty()); - } - } - - public void testGetExpiredFeedsListShouldReturnFeed() { - final long expirationTime = 1000 * 60 * 60; // 1 hour - expiredFeedListTestHelper(System.currentTimeMillis() - expirationTime - 1, expirationTime, true); - } - - public void testGetExpiredFeedsListShouldNotReturnFeed() { - final long expirationTime = 1000 * 60 * 60; // 1 hour - expiredFeedListTestHelper(System.currentTimeMillis() - expirationTime / 2, expirationTime, false); - } - - public void testGetFeedList() { final Context context = getInstrumentation().getTargetContext(); List<Feed> feeds = saveFeedlist(context, 10, 0, false); 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 ac4a709d7..944fc7792 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBTasksTest.java @@ -299,37 +299,4 @@ public class DBTasksTest extends InstrumentationTestCase { lastDate = item.getPubDate(); } } - - private void expiredFeedListTestHelper(long lastUpdate, long expirationTime, boolean shouldReturn) { - UserPreferences.setUpdateInterval(TimeUnit.MILLISECONDS.toHours(expirationTime)); - Feed feed = new Feed(0, new Date(lastUpdate), "feed", "link", "descr", null, - null, null, null, "feed", null, null, "url", false, new FlattrStatus(), false, null, null, false); - feed.setItems(new ArrayList<FeedItem>()); - PodDBAdapter adapter = new PodDBAdapter(context); - adapter.open(); - adapter.setCompleteFeed(feed); - adapter.close(); - - assertTrue(feed.getId() != 0); - List<Feed> expiredFeeds = DBTasks.getExpiredFeeds(context); - assertNotNull(expiredFeeds); - if (shouldReturn) { - assertTrue(expiredFeeds.size() == 1); - assertTrue(expiredFeeds.get(0).getId() == feed.getId()); - } else { - assertTrue(expiredFeeds.isEmpty()); - } - } - - @FlakyTest(tolerance = 3) - public void testGetExpiredFeedsTestShouldReturn() { - final long expirationTime = 1000 * 60 * 60; - expiredFeedListTestHelper(System.currentTimeMillis() - expirationTime - 1, expirationTime, true); - } - - @FlakyTest(tolerance = 3) - public void testGetExpiredFeedsTestShouldNotReturn() { - final long expirationTime = 1000 * 60 * 60; - expiredFeedListTestHelper(System.currentTimeMillis() - expirationTime / 2, expirationTime, false); - } } diff --git a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java index 0326174e3..65c962f01 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java @@ -78,7 +78,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv openNavDrawer(); solo.clickOnText(solo.getString(R.string.add_feed_label)); solo.enterText(0, feed.getDownload_url()); - solo.clickOnButton(0); + solo.clickOnButton(solo.getString(R.string.confirm_label)); solo.waitForActivity(DefaultOnlineFeedViewActivity.class); solo.waitForView(R.id.butSubscribe); assertEquals(solo.getString(R.string.subscribe_label), solo.getButton(0).getText().toString()); diff --git a/app/src/main/java/de/danoeh/antennapod/receiver/ConnectivityActionReceiver.java b/app/src/main/java/de/danoeh/antennapod/receiver/ConnectivityActionReceiver.java index f55a7603f..a3a200058 100644 --- a/app/src/main/java/de/danoeh/antennapod/receiver/ConnectivityActionReceiver.java +++ b/app/src/main/java/de/danoeh/antennapod/receiver/ConnectivityActionReceiver.java @@ -15,7 +15,7 @@ import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.NetworkUtils; public class ConnectivityActionReceiver extends BroadcastReceiver { - private static final String TAG = "ConnectivityActionReceiver"; + private static final String TAG = "ConnectivityActionRecvr"; @Override public void onReceive(final Context context, Intent intent) { |