diff options
author | Domingos Lopes <domingos86lopes@gmail.com> | 2016-03-20 00:42:21 -0400 |
---|---|---|
committer | Domingos Lopes <domingos86lopes+github@gmail.com> | 2016-04-23 21:39:52 -0400 |
commit | 88d47c178c033ab8e111e59ddeeda4e674f5b474 (patch) | |
tree | a502a9b0cb6157278c11fc14b08ac52e428c16f0 /app/src/androidTest | |
parent | 6224f80c898e5cf78719e266fb719d424295ec83 (diff) | |
download | AntennaPod-88d47c178c033ab8e111e59ddeeda4e674f5b474.zip |
Make PlaybackServiceMediaPlayer an abstract class and move implementation independent methods inside it
Diffstat (limited to 'app/src/androidTest')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java | 54 |
1 files changed, 27 insertions, 27 deletions
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 7255d921f..5b816ce0a 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 @@ -20,7 +20,7 @@ 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.feed.FeedPreferences; -import de.danoeh.antennapod.core.service.playback.IPlaybackServiceMediaPlayer; +import de.danoeh.antennapod.core.service.playback.PlaybackServiceMediaPlayer; import de.danoeh.antennapod.core.service.playback.LocalPSMP; import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.storage.PodDBAdapter; @@ -112,7 +112,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testInit() { final Context c = getInstrumentation().getTargetContext(); - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, defaultCallback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, defaultCallback); psmp.shutdown(); } @@ -138,7 +138,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectStreamNoStartNoPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(2); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -201,7 +201,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null); psmp.playMediaObject(p, true, false, false); boolean res = countDownLatch.await(LATCH_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -217,7 +217,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectStreamStartNoPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(2); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -279,7 +279,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null); psmp.playMediaObject(p, true, true, false); @@ -296,7 +296,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectStreamNoStartPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(4); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -361,7 +361,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null); psmp.playMediaObject(p, true, false, true); boolean res = countDownLatch.await(LATCH_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -376,7 +376,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectStreamStartPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(5); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -445,7 +445,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null); psmp.playMediaObject(p, true, true, true); boolean res = countDownLatch.await(LATCH_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -459,7 +459,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectLocalNoStartNoPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(2); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -522,7 +522,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL); psmp.playMediaObject(p, false, false, false); boolean res = countDownLatch.await(LATCH_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -537,7 +537,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectLocalStartNoPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(2); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -599,7 +599,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL); psmp.playMediaObject(p, false, true, false); boolean res = countDownLatch.await(LATCH_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -614,7 +614,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectLocalNoStartPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(4); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -679,7 +679,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL); psmp.playMediaObject(p, false, false, true); boolean res = countDownLatch.await(LATCH_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -693,7 +693,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { public void testPlayMediaObjectLocalStartPrepare() throws InterruptedException { final Context c = getInstrumentation().getTargetContext(); final CountDownLatch countDownLatch = new CountDownLatch(5); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { try { @@ -762,7 +762,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL); psmp.playMediaObject(p, false, true, true); boolean res = countDownLatch.await(LATCH_TIMEOUT_SECONDS, TimeUnit.SECONDS); @@ -774,7 +774,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { } - private final IPlaybackServiceMediaPlayer.PSMPCallback defaultCallback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + private final PlaybackServiceMediaPlayer.PSMPCallback defaultCallback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { checkPSMPInfo(newInfo); @@ -824,7 +824,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { final int latchCount = (stream && reinit) ? 2 : 1; final CountDownLatch countDownLatch = new CountDownLatch(latchCount); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { checkPSMPInfo(newInfo); @@ -900,7 +900,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL); if (initialState == PlayerStatus.PLAYING) { psmp.playMediaObject(p, stream, true, true); @@ -955,7 +955,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { (initialState == PlayerStatus.PREPARED) ? 1 : 0; final CountDownLatch countDownLatch = new CountDownLatch(latchCount); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { checkPSMPInfo(newInfo); @@ -1016,7 +1016,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); if (initialState == PlayerStatus.PREPARED || initialState == PlayerStatus.PLAYING || initialState == PlayerStatus.PAUSED) { boolean startWhenPrepared = (initialState != PlayerStatus.PREPARED); psmp.playMediaObject(writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL), false, startWhenPrepared, true); @@ -1048,7 +1048,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { final Context c = getInstrumentation().getTargetContext(); final int latchCount = 1; final CountDownLatch countDownLatch = new CountDownLatch(latchCount); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { checkPSMPInfo(newInfo); @@ -1107,7 +1107,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL); if (initialState == PlayerStatus.INITIALIZED || initialState == PlayerStatus.PLAYING @@ -1153,7 +1153,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { final Context c = getInstrumentation().getTargetContext(); final int latchCount = 2; final CountDownLatch countDownLatch = new CountDownLatch(latchCount); - IPlaybackServiceMediaPlayer.PSMPCallback callback = new IPlaybackServiceMediaPlayer.PSMPCallback() { + PlaybackServiceMediaPlayer.PSMPCallback callback = new PlaybackServiceMediaPlayer.PSMPCallback() { @Override public void statusChanged(LocalPSMP.PSMPInfo newInfo) { checkPSMPInfo(newInfo); @@ -1211,7 +1211,7 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase { return false; } }; - IPlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); + PlaybackServiceMediaPlayer psmp = new LocalPSMP(c, callback); Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL); boolean prepareImmediately = initialState != PlayerStatus.INITIALIZED; boolean startImmediately = initialState != PlayerStatus.PREPARED; |