Commit 2f91c12f by olly Committed by Oliver Woodman

Drop prefix test- from test methods under v2/extensions

This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300530329
parent 2bd4d61b
...@@ -82,7 +82,7 @@ public class CastPlayerTest { ...@@ -82,7 +82,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testSetPlayWhenReady_masksRemoteState() { public void setPlayWhenReady_masksRemoteState() {
when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult);
assertThat(castPlayer.getPlayWhenReady()).isFalse(); assertThat(castPlayer.getPlayWhenReady()).isFalse();
...@@ -107,7 +107,7 @@ public class CastPlayerTest { ...@@ -107,7 +107,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testSetPlayWhenReadyMasking_updatesUponResultChange() { public void setPlayWhenReadyMasking_updatesUponResultChange() {
when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult);
assertThat(castPlayer.getPlayWhenReady()).isFalse(); assertThat(castPlayer.getPlayWhenReady()).isFalse();
...@@ -129,7 +129,7 @@ public class CastPlayerTest { ...@@ -129,7 +129,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testSetPlayWhenReady_correctChangeReasonOnPause() { public void setPlayWhenReady_correctChangeReasonOnPause() {
when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult);
when(mockRemoteMediaClient.pause()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.pause()).thenReturn(mockPendingResult);
castPlayer.play(); castPlayer.play();
...@@ -147,7 +147,7 @@ public class CastPlayerTest { ...@@ -147,7 +147,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testPlayWhenReady_changesOnStatusUpdates() { public void playWhenReady_changesOnStatusUpdates() {
assertThat(castPlayer.getPlayWhenReady()).isFalse(); assertThat(castPlayer.getPlayWhenReady()).isFalse();
when(mockRemoteMediaClient.isPaused()).thenReturn(false); when(mockRemoteMediaClient.isPaused()).thenReturn(false);
remoteMediaClientListener.onStatusUpdated(); remoteMediaClientListener.onStatusUpdated();
...@@ -157,7 +157,7 @@ public class CastPlayerTest { ...@@ -157,7 +157,7 @@ public class CastPlayerTest {
} }
@Test @Test
public void testSetRepeatMode_masksRemoteState() { public void setRepeatMode_masksRemoteState() {
when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult); when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult);
assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF); assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF);
...@@ -180,7 +180,7 @@ public class CastPlayerTest { ...@@ -180,7 +180,7 @@ public class CastPlayerTest {
} }
@Test @Test
public void testSetRepeatMode_updatesUponResultChange() { public void setRepeatMode_updatesUponResultChange() {
when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult); when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult);
castPlayer.setRepeatMode(Player.REPEAT_MODE_ONE); castPlayer.setRepeatMode(Player.REPEAT_MODE_ONE);
...@@ -202,7 +202,7 @@ public class CastPlayerTest { ...@@ -202,7 +202,7 @@ public class CastPlayerTest {
} }
@Test @Test
public void testRepeatMode_changesOnStatusUpdates() { public void repeatMode_changesOnStatusUpdates() {
assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF); assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF);
when(mockMediaStatus.getQueueRepeatMode()).thenReturn(MediaStatus.REPEAT_MODE_REPEAT_SINGLE); when(mockMediaStatus.getQueueRepeatMode()).thenReturn(MediaStatus.REPEAT_MODE_REPEAT_SINGLE);
remoteMediaClientListener.onStatusUpdated(); remoteMediaClientListener.onStatusUpdated();
......
...@@ -39,7 +39,7 @@ public class CastTimelineTrackerTest { ...@@ -39,7 +39,7 @@ public class CastTimelineTrackerTest {
/** Tests that duration of the current media info is correctly propagated to the timeline. */ /** Tests that duration of the current media info is correctly propagated to the timeline. */
@Test @Test
public void testGetCastTimelinePersistsDuration() { public void getCastTimelinePersistsDuration() {
CastTimelineTracker tracker = new CastTimelineTracker(); CastTimelineTracker tracker = new CastTimelineTracker();
RemoteMediaClient remoteMediaClient = RemoteMediaClient remoteMediaClient =
......
...@@ -48,18 +48,18 @@ public final class ByteArrayUploadDataProviderTest { ...@@ -48,18 +48,18 @@ public final class ByteArrayUploadDataProviderTest {
} }
@Test @Test
public void testGetLength() { public void getLength() {
assertThat(byteArrayUploadDataProvider.getLength()).isEqualTo(TEST_DATA.length); assertThat(byteArrayUploadDataProvider.getLength()).isEqualTo(TEST_DATA.length);
} }
@Test @Test
public void testReadFullBuffer() throws IOException { public void readFullBuffer() throws IOException {
byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer); byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer);
assertThat(byteBuffer.array()).isEqualTo(TEST_DATA); assertThat(byteBuffer.array()).isEqualTo(TEST_DATA);
} }
@Test @Test
public void testReadPartialBuffer() throws IOException { public void readPartialBuffer() throws IOException {
byte[] firstHalf = Arrays.copyOf(TEST_DATA, TEST_DATA.length / 2); byte[] firstHalf = Arrays.copyOf(TEST_DATA, TEST_DATA.length / 2);
byte[] secondHalf = Arrays.copyOfRange(TEST_DATA, TEST_DATA.length / 2, TEST_DATA.length); byte[] secondHalf = Arrays.copyOfRange(TEST_DATA, TEST_DATA.length / 2, TEST_DATA.length);
byteBuffer = ByteBuffer.allocate(TEST_DATA.length / 2); byteBuffer = ByteBuffer.allocate(TEST_DATA.length / 2);
...@@ -75,7 +75,7 @@ public final class ByteArrayUploadDataProviderTest { ...@@ -75,7 +75,7 @@ public final class ByteArrayUploadDataProviderTest {
} }
@Test @Test
public void testRewind() throws IOException { public void rewind() throws IOException {
// Read all the data. // Read all the data.
byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer); byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer);
assertThat(byteBuffer.array()).isEqualTo(TEST_DATA); assertThat(byteBuffer.array()).isEqualTo(TEST_DATA);
......
...@@ -36,7 +36,7 @@ public class FlacExtractorTest { ...@@ -36,7 +36,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSample() throws Exception { public void sample() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear.flac", /* file= */ "flac/bear.flac",
...@@ -45,7 +45,7 @@ public class FlacExtractorTest { ...@@ -45,7 +45,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithId3HeaderAndId3Enabled() throws Exception { public void sampleWithId3HeaderAndId3Enabled() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_with_id3.flac", /* file= */ "flac/bear_with_id3.flac",
...@@ -54,7 +54,7 @@ public class FlacExtractorTest { ...@@ -54,7 +54,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithId3HeaderAndId3Disabled() throws Exception { public void sampleWithId3HeaderAndId3Disabled() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
() -> new FlacExtractor(FlacExtractor.FLAG_DISABLE_ID3_METADATA), () -> new FlacExtractor(FlacExtractor.FLAG_DISABLE_ID3_METADATA),
/* file= */ "flac/bear_with_id3.flac", /* file= */ "flac/bear_with_id3.flac",
...@@ -63,7 +63,7 @@ public class FlacExtractorTest { ...@@ -63,7 +63,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleUnseekable() throws Exception { public void sampleUnseekable() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_no_seek_table_no_num_samples.flac", /* file= */ "flac/bear_no_seek_table_no_num_samples.flac",
...@@ -72,7 +72,7 @@ public class FlacExtractorTest { ...@@ -72,7 +72,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithVorbisComments() throws Exception { public void sampleWithVorbisComments() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_with_vorbis_comments.flac", /* file= */ "flac/bear_with_vorbis_comments.flac",
...@@ -81,7 +81,7 @@ public class FlacExtractorTest { ...@@ -81,7 +81,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithPicture() throws Exception { public void sampleWithPicture() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_with_picture.flac", /* file= */ "flac/bear_with_picture.flac",
...@@ -90,7 +90,7 @@ public class FlacExtractorTest { ...@@ -90,7 +90,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testOneMetadataBlock() throws Exception { public void oneMetadataBlock() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_one_metadata_block.flac", /* file= */ "flac/bear_one_metadata_block.flac",
...@@ -99,7 +99,7 @@ public class FlacExtractorTest { ...@@ -99,7 +99,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testNoMinMaxFrameSize() throws Exception { public void noMinMaxFrameSize() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_no_min_max_frame_size.flac", /* file= */ "flac/bear_no_min_max_frame_size.flac",
...@@ -108,7 +108,7 @@ public class FlacExtractorTest { ...@@ -108,7 +108,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testNoNumSamples() throws Exception { public void noNumSamples() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_no_num_samples.flac", /* file= */ "flac/bear_no_num_samples.flac",
...@@ -117,7 +117,7 @@ public class FlacExtractorTest { ...@@ -117,7 +117,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testUncommonSampleRate() throws Exception { public void uncommonSampleRate() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_uncommon_sample_rate.flac", /* file= */ "flac/bear_uncommon_sample_rate.flac",
......
...@@ -126,7 +126,7 @@ public class ImaAdsLoaderTest { ...@@ -126,7 +126,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testBuilder_overridesPlayerType() { public void builder_overridesPlayerType() {
when(imaSdkSettings.getPlayerType()).thenReturn("test player type"); when(imaSdkSettings.getPlayerType()).thenReturn("test player type");
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
...@@ -134,7 +134,7 @@ public class ImaAdsLoaderTest { ...@@ -134,7 +134,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStart_setsAdUiViewGroup() { public void start_setsAdUiViewGroup() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -143,7 +143,7 @@ public class ImaAdsLoaderTest { ...@@ -143,7 +143,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStart_withPlaceholderContent_initializedAdsLoader() { public void start_withPlaceholderContent_initializedAdsLoader() {
Timeline placeholderTimeline = new DummyTimeline(/* tag= */ null); Timeline placeholderTimeline = new DummyTimeline(/* tag= */ null);
setupPlayback(placeholderTimeline, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(placeholderTimeline, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -153,7 +153,7 @@ public class ImaAdsLoaderTest { ...@@ -153,7 +153,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStart_updatesAdPlaybackState() { public void start_updatesAdPlaybackState() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -165,14 +165,14 @@ public class ImaAdsLoaderTest { ...@@ -165,14 +165,14 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStartAfterRelease() { public void startAfterRelease() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.release(); imaAdsLoader.release();
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
} }
@Test @Test
public void testStartAndCallbacksAfterRelease() { public void startAndCallbacksAfterRelease() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.release(); imaAdsLoader.release();
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -199,7 +199,7 @@ public class ImaAdsLoaderTest { ...@@ -199,7 +199,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testPlayback_withPrerollAd_marksAdAsPlayed() { public void playback_withPrerollAd_marksAdAsPlayed() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
// Load the preroll ad. // Load the preroll ad.
...@@ -239,7 +239,7 @@ public class ImaAdsLoaderTest { ...@@ -239,7 +239,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStop_unregistersAllVideoControlOverlays() { public void stop_unregistersAllVideoControlOverlays() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
imaAdsLoader.requestAds(adViewGroup); imaAdsLoader.requestAds(adViewGroup);
......
...@@ -48,7 +48,7 @@ public class OpusPlaybackTest { ...@@ -48,7 +48,7 @@ public class OpusPlaybackTest {
} }
@Test @Test
public void testBasicPlayback() throws Exception { public void basicPlayback() throws Exception {
playUri(BEAR_OPUS_URI); playUri(BEAR_OPUS_URI);
} }
......
...@@ -57,12 +57,12 @@ public class VpxPlaybackTest { ...@@ -57,12 +57,12 @@ public class VpxPlaybackTest {
} }
@Test @Test
public void testBasicPlayback() throws Exception { public void basicPlayback() throws Exception {
playUri(BEAR_URI); playUri(BEAR_URI);
} }
@Test @Test
public void testOddDimensionsPlayback() throws Exception { public void oddDimensionsPlayback() throws Exception {
playUri(BEAR_ODD_DIMENSIONS_URI); playUri(BEAR_ODD_DIMENSIONS_URI);
} }
...@@ -77,7 +77,7 @@ public class VpxPlaybackTest { ...@@ -77,7 +77,7 @@ public class VpxPlaybackTest {
} }
@Test @Test
public void testInvalidBitstream() { public void invalidBitstream() {
try { try {
playUri(INVALID_BITSTREAM_URI); playUri(INVALID_BITSTREAM_URI);
fail(); fail();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment