Commit 95ba4f85 by olly Committed by Oliver Woodman

Drop prefix test- from core test methods

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: 296169886
parent 7e6a1418
Showing with 457 additions and 462 deletions
......@@ -46,37 +46,37 @@ public final class ContentDataSourceTest {
private static final String DATA_PATH = "mp3/1024_incrementing_bytes.mp3";
@Test
public void testRead() throws Exception {
public void read() throws Exception {
assertData(0, C.LENGTH_UNSET, false);
}
@Test
public void testReadPipeMode() throws Exception {
public void readPipeMode() throws Exception {
assertData(0, C.LENGTH_UNSET, true);
}
@Test
public void testReadFixedLength() throws Exception {
public void readFixedLength() throws Exception {
assertData(0, 100, false);
}
@Test
public void testReadFromOffsetToEndOfInput() throws Exception {
public void readFromOffsetToEndOfInput() throws Exception {
assertData(1, C.LENGTH_UNSET, false);
}
@Test
public void testReadFromOffsetToEndOfInputPipeMode() throws Exception {
public void readFromOffsetToEndOfInputPipeMode() throws Exception {
assertData(1, C.LENGTH_UNSET, true);
}
@Test
public void testReadFromOffsetFixedLength() throws Exception {
public void readFromOffsetFixedLength() throws Exception {
assertData(1, 100, false);
}
@Test
public void testReadInvalidUri() throws Exception {
public void readInvalidUri() throws Exception {
ContentDataSource dataSource =
new ContentDataSource(InstrumentationRegistry.getTargetContext());
Uri contentUri = TestContentProvider.buildUri("does/not.exist", false);
......
......@@ -44,7 +44,7 @@ public class DefaultLoadControlTest {
}
@Test
public void testShouldContinueLoading_untilMaxBufferExceeded() {
public void shouldContinueLoading_untilMaxBufferExceeded() {
createDefaultLoadControl();
assertThat(loadControl.shouldContinueLoading(/* bufferedDurationUs= */ 0, SPEED)).isTrue();
......@@ -54,7 +54,7 @@ public class DefaultLoadControlTest {
}
@Test
public void testShouldNotContinueLoadingOnceBufferingStopped_untilBelowMinBuffer() {
public void shouldNotContinueLoadingOnceBufferingStopped_untilBelowMinBuffer() {
createDefaultLoadControl();
assertThat(loadControl.shouldContinueLoading(MAX_BUFFER_US, SPEED)).isFalse();
......@@ -79,7 +79,7 @@ public class DefaultLoadControlTest {
}
@Test
public void testShouldContinueLoadingWithTargetBufferBytesReached_untilMinBufferReached() {
public void shouldContinueLoadingWithTargetBufferBytesReached_untilMinBufferReached() {
createDefaultLoadControl();
makeSureTargetBufferBytesReached();
......@@ -90,7 +90,7 @@ public class DefaultLoadControlTest {
}
@Test
public void testShouldNeverContinueLoading_ifMaxBufferReachedAndNotPrioritizeTimeOverSize() {
public void shouldNeverContinueLoading_ifMaxBufferReachedAndNotPrioritizeTimeOverSize() {
builder.setPrioritizeTimeOverSizeThresholds(false);
createDefaultLoadControl();
// Put loadControl in buffering state.
......@@ -104,7 +104,7 @@ public class DefaultLoadControlTest {
}
@Test
public void testShouldContinueLoadingWithMinBufferReached_inFastPlayback() {
public void shouldContinueLoadingWithMinBufferReached_inFastPlayback() {
createDefaultLoadControl();
// At normal playback speed, we stop buffering when the buffer reaches the minimum.
......@@ -114,7 +114,7 @@ public class DefaultLoadControlTest {
}
@Test
public void testShouldNotContinueLoadingWithMaxBufferReached_inFastPlayback() {
public void shouldNotContinueLoadingWithMaxBufferReached_inFastPlayback() {
createDefaultLoadControl();
assertThat(loadControl.shouldContinueLoading(MAX_BUFFER_US, /* playbackSpeed= */ 100f))
......@@ -122,7 +122,7 @@ public class DefaultLoadControlTest {
}
@Test
public void testStartsPlayback_whenMinBufferSizeReached() {
public void startsPlayback_whenMinBufferSizeReached() {
createDefaultLoadControl();
assertThat(loadControl.shouldStartPlayback(MIN_BUFFER_US, SPEED, /* rebuffering= */ false))
......
......@@ -51,7 +51,7 @@ public class PlaylistTest {
}
@Test
public void testEmptyPlaylist_expectConstantTimelineInstanceEMPTY() {
public void emptyPlaylist_expectConstantTimelineInstanceEMPTY() {
ShuffleOrder.DefaultShuffleOrder shuffleOrder =
new ShuffleOrder.DefaultShuffleOrder(/* length= */ 0);
List<Playlist.MediaSourceHolder> fakeHolders = createFakeHolders();
......@@ -73,7 +73,7 @@ public class PlaylistTest {
}
@Test
public void testPrepareAndReprepareAfterRelease_expectSourcePreparationAfterPlaylistPrepare() {
public void prepareAndReprepareAfterRelease_expectSourcePreparationAfterPlaylistPrepare() {
MediaSource mockMediaSource1 = mock(MediaSource.class);
MediaSource mockMediaSource2 = mock(MediaSource.class);
playlist.setMediaSources(
......@@ -110,7 +110,7 @@ public class PlaylistTest {
}
@Test
public void testSetMediaSources_playlistUnprepared_notUsingLazyPreparation() {
public void setMediaSources_playlistUnprepared_notUsingLazyPreparation() {
ShuffleOrder.DefaultShuffleOrder shuffleOrder =
new ShuffleOrder.DefaultShuffleOrder(/* length= */ 2);
MediaSource mockMediaSource1 = mock(MediaSource.class);
......@@ -152,7 +152,7 @@ public class PlaylistTest {
}
@Test
public void testSetMediaSources_playlistPrepared_notUsingLazyPreparation() {
public void setMediaSources_playlistPrepared_notUsingLazyPreparation() {
ShuffleOrder.DefaultShuffleOrder shuffleOrder =
new ShuffleOrder.DefaultShuffleOrder(/* length= */ 2);
MediaSource mockMediaSource1 = mock(MediaSource.class);
......@@ -190,7 +190,7 @@ public class PlaylistTest {
}
@Test
public void testAddMediaSources_playlistUnprepared_notUsingLazyPreparation_expectUnprepared() {
public void addMediaSources_playlistUnprepared_notUsingLazyPreparation_expectUnprepared() {
MediaSource mockMediaSource1 = mock(MediaSource.class);
MediaSource mockMediaSource2 = mock(MediaSource.class);
List<Playlist.MediaSourceHolder> mediaSources =
......@@ -224,7 +224,7 @@ public class PlaylistTest {
}
@Test
public void testAddMediaSources_playlistPrepared_notUsingLazyPreparation_expectPrepared() {
public void addMediaSources_playlistPrepared_notUsingLazyPreparation_expectPrepared() {
MediaSource mockMediaSource1 = mock(MediaSource.class);
MediaSource mockMediaSource2 = mock(MediaSource.class);
playlist.prepare(/* mediaTransferListener= */ null);
......@@ -244,7 +244,7 @@ public class PlaylistTest {
}
@Test
public void testMoveMediaSources() {
public void moveMediaSources() {
ShuffleOrder.DefaultShuffleOrder shuffleOrder =
new ShuffleOrder.DefaultShuffleOrder(/* length= */ 4);
List<Playlist.MediaSourceHolder> holders = createFakeHolders();
......@@ -283,7 +283,7 @@ public class PlaylistTest {
}
@Test
public void testRemoveMediaSources_whenUnprepared_expectNoRelease() {
public void removeMediaSources_whenUnprepared_expectNoRelease() {
MediaSource mockMediaSource1 = mock(MediaSource.class);
MediaSource mockMediaSource2 = mock(MediaSource.class);
MediaSource mockMediaSource3 = mock(MediaSource.class);
......@@ -315,7 +315,7 @@ public class PlaylistTest {
}
@Test
public void testRemoveMediaSources_whenPrepared_expectRelease() {
public void removeMediaSources_whenPrepared_expectRelease() {
MediaSource mockMediaSource1 = mock(MediaSource.class);
MediaSource mockMediaSource2 = mock(MediaSource.class);
MediaSource mockMediaSource3 = mock(MediaSource.class);
......@@ -346,7 +346,7 @@ public class PlaylistTest {
}
@Test
public void testRelease_playlistUnprepared_expectSourcesNotReleased() {
public void release_playlistUnprepared_expectSourcesNotReleased() {
MediaSource mockMediaSource = mock(MediaSource.class);
Playlist.MediaSourceHolder mediaSourceHolder =
new Playlist.MediaSourceHolder(mockMediaSource, /* useLazyPreparation= */ false);
......@@ -363,7 +363,7 @@ public class PlaylistTest {
}
@Test
public void testRelease_playlistPrepared_expectSourcesReleasedNotRemoved() {
public void release_playlistPrepared_expectSourcesReleasedNotRemoved() {
MediaSource mockMediaSource = mock(MediaSource.class);
Playlist.MediaSourceHolder mediaSourceHolder =
new Playlist.MediaSourceHolder(mockMediaSource, /* useLazyPreparation= */ false);
......@@ -381,7 +381,7 @@ public class PlaylistTest {
}
@Test
public void testClearPlaylist_expectSourcesReleasedAndRemoved() {
public void clearPlaylist_expectSourcesReleasedAndRemoved() {
ShuffleOrder.DefaultShuffleOrder shuffleOrder =
new ShuffleOrder.DefaultShuffleOrder(/* length= */ 4);
MediaSource mockMediaSource1 = mock(MediaSource.class);
......@@ -401,14 +401,14 @@ public class PlaylistTest {
}
@Test
public void testSetMediaSources_expectTimelineUsesCustomShuffleOrder() {
public void setMediaSources_expectTimelineUsesCustomShuffleOrder() {
Timeline timeline =
playlist.setMediaSources(createFakeHolders(), new FakeShuffleOrder(/* length=*/ 4));
assertTimelineUsesFakeShuffleOrder(timeline);
}
@Test
public void testAddMediaSources_expectTimelineUsesCustomShuffleOrder() {
public void addMediaSources_expectTimelineUsesCustomShuffleOrder() {
Timeline timeline =
playlist.addMediaSources(
/* index= */ 0, createFakeHolders(), new FakeShuffleOrder(PLAYLIST_SIZE));
......@@ -416,7 +416,7 @@ public class PlaylistTest {
}
@Test
public void testMoveMediaSources_expectTimelineUsesCustomShuffleOrder() {
public void moveMediaSources_expectTimelineUsesCustomShuffleOrder() {
ShuffleOrder shuffleOrder = new ShuffleOrder.DefaultShuffleOrder(/* length= */ PLAYLIST_SIZE);
playlist.addMediaSources(/* index= */ 0, createFakeHolders(), shuffleOrder);
Timeline timeline =
......@@ -426,7 +426,7 @@ public class PlaylistTest {
}
@Test
public void testMoveMediaSourceRange_expectTimelineUsesCustomShuffleOrder() {
public void moveMediaSourceRange_expectTimelineUsesCustomShuffleOrder() {
ShuffleOrder shuffleOrder = new ShuffleOrder.DefaultShuffleOrder(/* length= */ PLAYLIST_SIZE);
playlist.addMediaSources(/* index= */ 0, createFakeHolders(), shuffleOrder);
Timeline timeline =
......@@ -439,7 +439,7 @@ public class PlaylistTest {
}
@Test
public void testRemoveMediaSourceRange_expectTimelineUsesCustomShuffleOrder() {
public void removeMediaSourceRange_expectTimelineUsesCustomShuffleOrder() {
ShuffleOrder shuffleOrder = new ShuffleOrder.DefaultShuffleOrder(/* length= */ PLAYLIST_SIZE);
playlist.addMediaSources(/* index= */ 0, createFakeHolders(), shuffleOrder);
Timeline timeline =
......@@ -449,7 +449,7 @@ public class PlaylistTest {
}
@Test
public void testSetShuffleOrder_expectTimelineUsesCustomShuffleOrder() {
public void setShuffleOrder_expectTimelineUsesCustomShuffleOrder() {
playlist.setMediaSources(
createFakeHolders(), new ShuffleOrder.DefaultShuffleOrder(/* length= */ PLAYLIST_SIZE));
assertTimelineUsesFakeShuffleOrder(
......
......@@ -29,12 +29,12 @@ import org.junit.runner.RunWith;
public class TimelineTest {
@Test
public void testEmptyTimeline() {
public void emptyTimeline() {
TimelineAsserts.assertEmpty(Timeline.EMPTY);
}
@Test
public void testSinglePeriodTimeline() {
public void singlePeriodTimeline() {
Timeline timeline = new FakeTimeline(new TimelineWindowDefinition(1, 111));
TimelineAsserts.assertWindowTags(timeline, 111);
TimelineAsserts.assertPeriodCounts(timeline, 1);
......@@ -48,7 +48,7 @@ public class TimelineTest {
}
@Test
public void testMultiPeriodTimeline() {
public void multiPeriodTimeline() {
Timeline timeline = new FakeTimeline(new TimelineWindowDefinition(5, 111));
TimelineAsserts.assertWindowTags(timeline, 111);
TimelineAsserts.assertPeriodCounts(timeline, 5);
......@@ -62,7 +62,7 @@ public class TimelineTest {
}
@Test
public void testWindowEquals() {
public void windowEquals() {
Timeline.Window window = new Timeline.Window();
assertThat(window).isEqualTo(new Timeline.Window());
......@@ -151,7 +151,7 @@ public class TimelineTest {
}
@Test
public void testWindowHashCode() {
public void windowHashCode() {
Timeline.Window window = new Timeline.Window();
Timeline.Window otherWindow = new Timeline.Window();
assertThat(window.hashCode()).isEqualTo(otherWindow.hashCode());
......@@ -163,7 +163,7 @@ public class TimelineTest {
}
@Test
public void testPeriodEquals() {
public void periodEquals() {
Timeline.Period period = new Timeline.Period();
assertThat(period).isEqualTo(new Timeline.Period());
......@@ -199,7 +199,7 @@ public class TimelineTest {
}
@Test
public void testPeriodHashCode() {
public void periodHashCode() {
Timeline.Period period = new Timeline.Period();
Timeline.Period otherPeriod = new Timeline.Period();
assertThat(period.hashCode()).isEqualTo(otherPeriod.hashCode());
......
......@@ -127,7 +127,7 @@ public final class AnalyticsCollectorTest {
private EventWindowAndPeriodId window1Period0Seq1;
@Test
public void testEmptyTimeline() throws Exception {
public void emptyTimeline() throws Exception {
FakeMediaSource mediaSource =
new FakeMediaSource(
Timeline.EMPTY,
......@@ -144,7 +144,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testSinglePeriod() throws Exception {
public void singlePeriod() throws Exception {
FakeMediaSource mediaSource =
new FakeMediaSource(
SINGLE_PERIOD_TIMELINE,
......@@ -187,7 +187,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testAutomaticPeriodTransition() throws Exception {
public void automaticPeriodTransition() throws Exception {
MediaSource mediaSource =
new ConcatenatingMediaSource(
new FakeMediaSource(
......@@ -248,7 +248,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testPeriodTransitionWithRendererChange() throws Exception {
public void periodTransitionWithRendererChange() throws Exception {
MediaSource mediaSource =
new ConcatenatingMediaSource(
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT),
......@@ -303,7 +303,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testSeekToOtherPeriod() throws Exception {
public void seekToOtherPeriod() throws Exception {
MediaSource mediaSource =
new ConcatenatingMediaSource(
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT),
......@@ -368,7 +368,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testSeekBackAfterReadingAhead() throws Exception {
public void seekBackAfterReadingAhead() throws Exception {
MediaSource mediaSource =
new ConcatenatingMediaSource(
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT),
......@@ -454,7 +454,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testPrepareNewSource() throws Exception {
public void prepareNewSource() throws Exception {
MediaSource mediaSource1 =
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
MediaSource mediaSource2 =
......@@ -532,7 +532,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testReprepareAfterError() throws Exception {
public void reprepareAfterError() throws Exception {
MediaSource mediaSource =
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
ActionSchedule actionSchedule =
......@@ -603,7 +603,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testDynamicTimelineChange() throws Exception {
public void dynamicTimelineChange() throws Exception {
MediaSource childMediaSource =
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
final ConcatenatingMediaSource concatenatedMediaSource =
......@@ -683,7 +683,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testPlaylistOperations() throws Exception {
public void playlistOperations() throws Exception {
MediaSource fakeMediaSource =
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
ActionSchedule actionSchedule =
......@@ -755,7 +755,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testAdPlayback() throws Exception {
public void adPlayback() throws Exception {
long contentDurationsUs = 10 * C.MICROS_PER_SECOND;
AtomicReference<AdPlaybackState> adPlaybackState =
new AtomicReference<>(
......@@ -988,7 +988,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testSeekAfterMidroll() throws Exception {
public void seekAfterMidroll() throws Exception {
Timeline adTimeline =
new FakeTimeline(
new TimelineWindowDefinition(
......@@ -1107,7 +1107,7 @@ public final class AnalyticsCollectorTest {
}
@Test
public void testNotifyExternalEvents() throws Exception {
public void notifyExternalEvents() throws Exception {
MediaSource mediaSource = new FakeMediaSource(SINGLE_PERIOD_TIMELINE);
ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest")
......
......@@ -49,7 +49,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testEnabledProcessor_isActive() throws Exception {
public void enabledProcessor_isActive() throws Exception {
// Given an enabled processor.
silenceSkippingAudioProcessor.setEnabled(true);
......@@ -61,7 +61,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testDisabledProcessor_isNotActive() throws Exception {
public void disabledProcessor_isNotActive() throws Exception {
// Given a disabled processor.
silenceSkippingAudioProcessor.setEnabled(false);
......@@ -73,7 +73,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testDefaultProcessor_isNotEnabled() throws Exception {
public void defaultProcessor_isNotEnabled() throws Exception {
// Given a processor in its default state.
// When reconfigured.
silenceSkippingAudioProcessor.configure(AUDIO_FORMAT);
......@@ -83,7 +83,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testSkipInSilentSignal_skipsEverything() throws Exception {
public void skipInSilentSignal_skipsEverything() throws Exception {
// Given a signal with only noise.
InputBufferProvider inputBufferProvider =
getInputBufferProviderForAlternatingSilenceAndNoise(
......@@ -105,7 +105,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testSkipInNoisySignal_skipsNothing() throws Exception {
public void skipInNoisySignal_skipsNothing() throws Exception {
// Given a signal with only silence.
InputBufferProvider inputBufferProvider =
getInputBufferProviderForAlternatingSilenceAndNoise(
......@@ -129,8 +129,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testSkipInAlternatingTestSignal_hasCorrectOutputAndSkippedFrameCounts()
throws Exception {
public void skipInAlternatingTestSignal_hasCorrectOutputAndSkippedFrameCounts() throws Exception {
// Given a signal that alternates between silence and noise.
InputBufferProvider inputBufferProvider =
getInputBufferProviderForAlternatingSilenceAndNoise(
......@@ -154,7 +153,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testSkipWithSmallerInputBufferSize_hasCorrectOutputAndSkippedFrameCounts()
public void skipWithSmallerInputBufferSize_hasCorrectOutputAndSkippedFrameCounts()
throws Exception {
// Given a signal that alternates between silence and noise.
InputBufferProvider inputBufferProvider =
......@@ -179,7 +178,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testSkipWithLargerInputBufferSize_hasCorrectOutputAndSkippedFrameCounts()
public void skipWithLargerInputBufferSize_hasCorrectOutputAndSkippedFrameCounts()
throws Exception {
// Given a signal that alternates between silence and noise.
InputBufferProvider inputBufferProvider =
......@@ -204,7 +203,7 @@ public final class SilenceSkippingAudioProcessorTest {
}
@Test
public void testSkipThenFlush_resetsSkippedFrameCount() throws Exception {
public void skipThenFlush_resetsSkippedFrameCount() throws Exception {
// Given a signal that alternates between silence and noise.
InputBufferProvider inputBufferProvider =
getInputBufferProviderForAlternatingSilenceAndNoise(
......
......@@ -78,21 +78,21 @@ public class SimpleDecoderAudioRendererTest {
@Config(sdk = 19)
@Test
public void testSupportsFormatAtApi19() {
public void supportsFormatAtApi19() {
assertThat(audioRenderer.supportsFormat(FORMAT))
.isEqualTo(ADAPTIVE_NOT_SEAMLESS | TUNNELING_NOT_SUPPORTED | FORMAT_HANDLED);
}
@Config(sdk = 21)
@Test
public void testSupportsFormatAtApi21() {
public void supportsFormatAtApi21() {
// From API 21, tunneling is supported.
assertThat(audioRenderer.supportsFormat(FORMAT))
.isEqualTo(ADAPTIVE_NOT_SEAMLESS | TUNNELING_SUPPORTED | FORMAT_HANDLED);
}
@Test
public void testImmediatelyReadEndOfStreamPlaysAudioSinkToEndOfStream() throws Exception {
public void immediatelyReadEndOfStreamPlaysAudioSinkToEndOfStream() throws Exception {
audioRenderer.enable(
RendererConfiguration.DEFAULT,
new Format[] {FORMAT},
......
......@@ -48,7 +48,7 @@ public final class SonicAudioProcessorTest {
}
@Test
public void testReconfigureWithSameSampleRate() throws Exception {
public void reconfigureWithSameSampleRate() throws Exception {
// When configured for resampling from 44.1 kHz to 48 kHz, the output sample rate is correct.
sonicAudioProcessor.setOutputSampleRateHz(48000);
AudioFormat outputAudioFormat = sonicAudioProcessor.configure(AUDIO_FORMAT_44100_HZ);
......@@ -65,7 +65,7 @@ public final class SonicAudioProcessorTest {
}
@Test
public void testNoSampleRateChange() throws Exception {
public void noSampleRateChange() throws Exception {
// Configure for resampling 44.1 kHz to 48 kHz.
sonicAudioProcessor.setOutputSampleRateHz(48000);
sonicAudioProcessor.configure(AUDIO_FORMAT_44100_HZ);
......@@ -78,7 +78,7 @@ public final class SonicAudioProcessorTest {
}
@Test
public void testIsActiveWithSpeedChange() throws Exception {
public void isActiveWithSpeedChange() throws Exception {
sonicAudioProcessor.setSpeed(1.5f);
sonicAudioProcessor.configure(AUDIO_FORMAT_44100_HZ);
sonicAudioProcessor.flush();
......@@ -86,13 +86,13 @@ public final class SonicAudioProcessorTest {
}
@Test
public void testIsNotActiveWithNoChange() throws Exception {
public void isNotActiveWithNoChange() throws Exception {
sonicAudioProcessor.configure(AUDIO_FORMAT_44100_HZ);
assertThat(sonicAudioProcessor.isActive()).isFalse();
}
@Test
public void testDoesNotSupportNon16BitInput() throws Exception {
public void doesNotSupportNon16BitInput() throws Exception {
try {
sonicAudioProcessor.configure(
new AudioFormat(
......
......@@ -69,7 +69,7 @@ public final class ClearKeyUtilTest {
@Config(sdk = 26)
@Test
public void testAdjustSingleKeyResponseDataV26() {
public void adjustSingleKeyResponseDataV26() {
// Everything but the keys should be removed. Within each key only the k, kid and kty parameters
// should remain. Any "-" and "_" characters in the k and kid values should be replaced with "+"
// and "/".
......@@ -87,7 +87,7 @@ public final class ClearKeyUtilTest {
@Config(sdk = 26)
@Test
public void testAdjustMultiKeyResponseDataV26() {
public void adjustMultiKeyResponseDataV26() {
// Everything but the keys should be removed. Within each key only the k, kid and kty parameters
// should remain. Any "-" and "_" characters in the k and kid values should be replaced with "+"
// and "/".
......@@ -107,14 +107,14 @@ public final class ClearKeyUtilTest {
@Config(sdk = 27)
@Test
public void testAdjustResponseDataV27() {
public void adjustResponseDataV27() {
// Response should be unchanged.
assertThat(ClearKeyUtil.adjustResponseData(SINGLE_KEY_RESPONSE)).isEqualTo(SINGLE_KEY_RESPONSE);
}
@Config(sdk = 26)
@Test
public void testAdjustRequestDataV26() {
public void adjustRequestDataV26() {
// We expect "+" and "/" to be replaced with "-" and "_" respectively, for "kids".
byte[] expected =
Util.getUtf8Bytes(
......@@ -130,7 +130,7 @@ public final class ClearKeyUtilTest {
@Config(sdk = 27)
@Test
public void testAdjustRequestDataV27() {
public void adjustRequestDataV27() {
// Request should be unchanged.
assertThat(ClearKeyUtil.adjustRequestData(KEY_REQUEST)).isEqualTo(KEY_REQUEST);
}
......
......@@ -65,7 +65,7 @@ public class OfflineLicenseHelperTest {
}
@Test
public void testDownloadRenewReleaseKey() throws Exception {
public void downloadRenewReleaseKey() throws Exception {
setStubLicenseAndPlaybackDurationValues(1000, 200);
byte[] keySetId = {2, 5, 8};
......@@ -86,7 +86,7 @@ public class OfflineLicenseHelperTest {
}
@Test
public void testDownloadLicenseFailsIfNullInitData() throws Exception {
public void downloadLicenseFailsIfNullInitData() throws Exception {
try {
offlineLicenseHelper.downloadLicense(null);
fail();
......@@ -96,7 +96,7 @@ public class OfflineLicenseHelperTest {
}
@Test
public void testDownloadLicenseFailsIfNoKeySetIdIsReturned() throws Exception {
public void downloadLicenseFailsIfNoKeySetIdIsReturned() throws Exception {
setStubLicenseAndPlaybackDurationValues(1000, 200);
try {
......@@ -108,7 +108,7 @@ public class OfflineLicenseHelperTest {
}
@Test
public void testDownloadLicenseDoesNotFailIfDurationNotAvailable() throws Exception {
public void downloadLicenseDoesNotFailIfDurationNotAvailable() throws Exception {
setDefaultStubKeySetId();
byte[] offlineLicenseKeySetId = offlineLicenseHelper.downloadLicense(newDrmInitData());
......@@ -117,7 +117,7 @@ public class OfflineLicenseHelperTest {
}
@Test
public void testGetLicenseDurationRemainingSec() throws Exception {
public void getLicenseDurationRemainingSec() throws Exception {
long licenseDuration = 1000;
int playbackDuration = 200;
setStubLicenseAndPlaybackDurationValues(licenseDuration, playbackDuration);
......@@ -133,7 +133,7 @@ public class OfflineLicenseHelperTest {
}
@Test
public void testGetLicenseDurationRemainingSecExpiredLicense() throws Exception {
public void getLicenseDurationRemainingSecExpiredLicense() throws Exception {
long licenseDuration = 0;
int playbackDuration = 0;
setStubLicenseAndPlaybackDurationValues(licenseDuration, playbackDuration);
......
......@@ -42,7 +42,7 @@ public final class SpliceInfoDecoderTest {
}
@Test
public void testWrappedAroundTimeSignalCommand() {
public void wrappedAroundTimeSignalCommand() {
byte[] rawTimeSignalSection = new byte[] {
0, // table_id.
(byte) 0x80, // section_syntax_indicator, private_indicator, reserved, section_length(4).
......
......@@ -56,7 +56,7 @@ public class ActionFileTest {
}
@Test
public void testLoadNoDataThrowsIOException() throws Exception {
public void loadNoDataThrowsIOException() throws Exception {
ActionFile actionFile = getActionFile("offline/action_file_no_data.exi");
try {
actionFile.load();
......@@ -67,7 +67,7 @@ public class ActionFileTest {
}
@Test
public void testLoadIncompleteHeaderThrowsIOException() throws Exception {
public void loadIncompleteHeaderThrowsIOException() throws Exception {
ActionFile actionFile = getActionFile("offline/action_file_incomplete_header.exi");
try {
actionFile.load();
......@@ -78,7 +78,7 @@ public class ActionFileTest {
}
@Test
public void testLoadZeroActions() throws Exception {
public void loadZeroActions() throws Exception {
ActionFile actionFile = getActionFile("offline/action_file_zero_actions.exi");
DownloadRequest[] actions = actionFile.load();
assertThat(actions).isNotNull();
......@@ -86,7 +86,7 @@ public class ActionFileTest {
}
@Test
public void testLoadOneAction() throws Exception {
public void loadOneAction() throws Exception {
ActionFile actionFile = getActionFile("offline/action_file_one_action.exi");
DownloadRequest[] actions = actionFile.load();
assertThat(actions).hasLength(1);
......@@ -94,7 +94,7 @@ public class ActionFileTest {
}
@Test
public void testLoadTwoActions() throws Exception {
public void loadTwoActions() throws Exception {
ActionFile actionFile = getActionFile("offline/action_file_two_actions.exi");
DownloadRequest[] actions = actionFile.load();
assertThat(actions).hasLength(2);
......@@ -103,7 +103,7 @@ public class ActionFileTest {
}
@Test
public void testLoadUnsupportedVersion() throws Exception {
public void loadUnsupportedVersion() throws Exception {
ActionFile actionFile = getActionFile("offline/action_file_unsupported_version.exi");
try {
actionFile.load();
......
......@@ -45,7 +45,7 @@ public class DownloadRequestTest {
}
@Test
public void testMergeRequests_withDifferentIds_fails() {
public void mergeRequests_withDifferentIds_fails() {
DownloadRequest request1 =
new DownloadRequest(
"id1",
......@@ -71,7 +71,7 @@ public class DownloadRequestTest {
}
@Test
public void testMergeRequests_withDifferentTypes_fails() {
public void mergeRequests_withDifferentTypes_fails() {
DownloadRequest request1 =
new DownloadRequest(
"id1",
......@@ -97,7 +97,7 @@ public class DownloadRequestTest {
}
@Test
public void testMergeRequest_withSameRequest() {
public void mergeRequest_withSameRequest() {
DownloadRequest request1 = createRequest(uri1, new StreamKey(0, 0, 0));
DownloadRequest mergedRequest = request1.copyWithMergedRequest(request1);
......@@ -105,7 +105,7 @@ public class DownloadRequestTest {
}
@Test
public void testMergeRequests_withEmptyStreamKeys() {
public void mergeRequests_withEmptyStreamKeys() {
DownloadRequest request1 = createRequest(uri1, new StreamKey(0, 0, 0));
DownloadRequest request2 = createRequest(uri1);
......@@ -118,7 +118,7 @@ public class DownloadRequestTest {
}
@Test
public void testMergeRequests_withOverlappingStreamKeys() {
public void mergeRequests_withOverlappingStreamKeys() {
StreamKey streamKey1 = new StreamKey(0, 1, 2);
StreamKey streamKey2 = new StreamKey(3, 4, 5);
StreamKey streamKey3 = new StreamKey(6, 7, 8);
......@@ -134,7 +134,7 @@ public class DownloadRequestTest {
}
@Test
public void testMergeRequests_withDifferentFields() {
public void mergeRequests_withDifferentFields() {
byte[] data1 = new byte[] {0, 1, 2};
byte[] data2 = new byte[] {3, 4, 5};
DownloadRequest request1 =
......@@ -167,7 +167,7 @@ public class DownloadRequestTest {
}
@Test
public void testParcelable() {
public void parcelable() {
ArrayList<StreamKey> streamKeys = new ArrayList<>();
streamKeys.add(new StreamKey(1, 2, 3));
streamKeys.add(new StreamKey(4, 5, 6));
......@@ -191,7 +191,7 @@ public class DownloadRequestTest {
@SuppressWarnings("EqualsWithItself")
@Test
public void testEquals() {
public void equals() {
DownloadRequest request1 = createRequest(uri1);
assertThat(request1.equals(request1)).isTrue();
......
......@@ -27,7 +27,7 @@ import org.junit.runner.RunWith;
public class StreamKeyTest {
@Test
public void testParcelable() {
public void parcelable() {
StreamKey streamKeyToParcel = new StreamKey(1, 2, 3);
Parcel parcel = Parcel.obtain();
streamKeyToParcel.writeToParcel(parcel, 0);
......
......@@ -62,7 +62,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testNoClipping() throws IOException {
public void noClipping() throws IOException {
Timeline timeline =
new SinglePeriodTimeline(
TEST_PERIOD_DURATION_US,
......@@ -81,7 +81,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingUnseekableWindowThrows() throws IOException {
public void clippingUnseekableWindowThrows() throws IOException {
Timeline timeline =
new SinglePeriodTimeline(
TEST_PERIOD_DURATION_US,
......@@ -101,7 +101,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingStart() throws IOException {
public void clippingStart() throws IOException {
Timeline timeline =
new SinglePeriodTimeline(
TEST_PERIOD_DURATION_US,
......@@ -118,7 +118,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingEnd() throws IOException {
public void clippingEnd() throws IOException {
Timeline timeline =
new SinglePeriodTimeline(
TEST_PERIOD_DURATION_US,
......@@ -135,7 +135,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingStartAndEndInitial() throws IOException {
public void clippingStartAndEndInitial() throws IOException {
// Timeline that's dynamic and not seekable. A child source might report such a timeline prior
// to it having loaded sufficient data to establish its duration and seekability. Such timelines
// should not result in clipping failure.
......@@ -153,7 +153,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingToEndOfSourceWithDurationSetsDuration() throws IOException {
public void clippingToEndOfSourceWithDurationSetsDuration() throws IOException {
// Create a child timeline that has a known duration.
Timeline timeline =
new SinglePeriodTimeline(
......@@ -170,7 +170,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingToEndOfSourceWithUnsetDurationDoesNotSetDuration() throws IOException {
public void clippingToEndOfSourceWithUnsetDurationDoesNotSetDuration() throws IOException {
// Create a child timeline that has an unknown duration.
Timeline timeline =
new SinglePeriodTimeline(
......@@ -187,7 +187,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingStartAndEnd() throws IOException {
public void clippingStartAndEnd() throws IOException {
Timeline timeline =
new SinglePeriodTimeline(
TEST_PERIOD_DURATION_US,
......@@ -205,7 +205,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testClippingFromDefaultPosition() throws IOException {
public void clippingFromDefaultPosition() throws IOException {
Timeline timeline =
new SinglePeriodTimeline(
/* periodDurationUs= */ 3 * TEST_PERIOD_DURATION_US,
......@@ -228,7 +228,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testAllowDynamicUpdatesWithOverlappingLiveWindow() throws IOException {
public void allowDynamicUpdatesWithOverlappingLiveWindow() throws IOException {
Timeline timeline1 =
new SinglePeriodTimeline(
/* periodDurationUs= */ 2 * TEST_PERIOD_DURATION_US,
......@@ -279,7 +279,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testAllowDynamicUpdatesWithNonOverlappingLiveWindow() throws IOException {
public void allowDynamicUpdatesWithNonOverlappingLiveWindow() throws IOException {
Timeline timeline1 =
new SinglePeriodTimeline(
/* periodDurationUs= */ 2 * TEST_PERIOD_DURATION_US,
......@@ -330,7 +330,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testDisallowDynamicUpdatesWithOverlappingLiveWindow() throws IOException {
public void disallowDynamicUpdatesWithOverlappingLiveWindow() throws IOException {
Timeline timeline1 =
new SinglePeriodTimeline(
/* periodDurationUs= */ 2 * TEST_PERIOD_DURATION_US,
......@@ -382,7 +382,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testDisallowDynamicUpdatesWithNonOverlappingLiveWindow() throws IOException {
public void disallowDynamicUpdatesWithNonOverlappingLiveWindow() throws IOException {
Timeline timeline1 =
new SinglePeriodTimeline(
/* periodDurationUs= */ 2 * TEST_PERIOD_DURATION_US,
......@@ -432,7 +432,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testWindowAndPeriodIndices() throws IOException {
public void windowAndPeriodIndices() throws IOException {
Timeline timeline =
new FakeTimeline(
new TimelineWindowDefinition(1, 111, true, false, TEST_PERIOD_DURATION_US));
......@@ -452,7 +452,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testEventTimeWithinClippedRange() throws IOException {
public void eventTimeWithinClippedRange() throws IOException {
MediaLoadData mediaLoadData =
getClippingMediaSourceMediaLoadData(
/* clippingStartUs= */ TEST_CLIP_AMOUNT_US,
......@@ -465,7 +465,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testEventTimeOutsideClippedRange() throws IOException {
public void eventTimeOutsideClippedRange() throws IOException {
MediaLoadData mediaLoadData =
getClippingMediaSourceMediaLoadData(
/* clippingStartUs= */ TEST_CLIP_AMOUNT_US,
......@@ -478,7 +478,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testUnsetEventTime() throws IOException {
public void unsetEventTime() throws IOException {
MediaLoadData mediaLoadData =
getClippingMediaSourceMediaLoadData(
/* clippingStartUs= */ TEST_CLIP_AMOUNT_US,
......@@ -490,7 +490,7 @@ public final class ClippingMediaSourceTest {
}
@Test
public void testEventTimeWithUnsetDuration() throws IOException {
public void eventTimeWithUnsetDuration() throws IOException {
MediaLoadData mediaLoadData =
getClippingMediaSourceMediaLoadData(
/* clippingStartUs= */ TEST_CLIP_AMOUNT_US,
......
......@@ -31,7 +31,7 @@ public final class CompositeSequenceableLoaderTest {
* position among all sub-loaders.
*/
@Test
public void testGetBufferedPositionUsReturnsMinimumLoaderBufferedPosition() {
public void getBufferedPositionUsReturnsMinimumLoaderBufferedPosition() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2000);
FakeSequenceableLoader loader2 =
......@@ -46,7 +46,7 @@ public final class CompositeSequenceableLoaderTest {
* position that is not {@link C#TIME_END_OF_SOURCE} among all sub-loaders.
*/
@Test
public void testGetBufferedPositionUsReturnsMinimumNonEndOfSourceLoaderBufferedPosition() {
public void getBufferedPositionUsReturnsMinimumNonEndOfSourceLoaderBufferedPosition() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2000);
FakeSequenceableLoader loader2 =
......@@ -61,11 +61,11 @@ public final class CompositeSequenceableLoaderTest {
}
/**
* Tests that {@link CompositeSequenceableLoader#getBufferedPositionUs()} returns
* {@link C#TIME_END_OF_SOURCE} when all sub-loaders have buffered till end-of-source.
* Tests that {@link CompositeSequenceableLoader#getBufferedPositionUs()} returns {@link
* C#TIME_END_OF_SOURCE} when all sub-loaders have buffered till end-of-source.
*/
@Test
public void testGetBufferedPositionUsReturnsEndOfSourceWhenAllLoaderBufferedTillEndOfSource() {
public void getBufferedPositionUsReturnsEndOfSourceWhenAllLoaderBufferedTillEndOfSource() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(
/* bufferedPositionUs */ C.TIME_END_OF_SOURCE,
......@@ -84,7 +84,7 @@ public final class CompositeSequenceableLoaderTest {
* load position among all sub-loaders.
*/
@Test
public void testGetNextLoadPositionUsReturnMinimumLoaderNextLoadPositionUs() {
public void getNextLoadPositionUsReturnMinimumLoaderNextLoadPositionUs() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2001);
FakeSequenceableLoader loader2 =
......@@ -99,7 +99,7 @@ public final class CompositeSequenceableLoaderTest {
* load position that is not {@link C#TIME_END_OF_SOURCE} among all sub-loaders.
*/
@Test
public void testGetNextLoadPositionUsReturnMinimumNonEndOfSourceLoaderNextLoadPositionUs() {
public void getNextLoadPositionUsReturnMinimumNonEndOfSourceLoaderNextLoadPositionUs() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2000);
FakeSequenceableLoader loader2 =
......@@ -113,11 +113,11 @@ public final class CompositeSequenceableLoaderTest {
}
/**
* Tests that {@link CompositeSequenceableLoader#getNextLoadPositionUs()} returns
* {@link C#TIME_END_OF_SOURCE} when all sub-loaders have next load position at end-of-source.
* Tests that {@link CompositeSequenceableLoader#getNextLoadPositionUs()} returns {@link
* C#TIME_END_OF_SOURCE} when all sub-loaders have next load position at end-of-source.
*/
@Test
public void testGetNextLoadPositionUsReturnsEndOfSourceWhenAllLoaderLoadingLastChunk() {
public void getNextLoadPositionUsReturnsEndOfSourceWhenAllLoaderLoadingLastChunk() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(
/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ C.TIME_END_OF_SOURCE);
......@@ -135,7 +135,7 @@ public final class CompositeSequenceableLoaderTest {
* current playback position.
*/
@Test
public void testContinueLoadingOnlyAllowFurthestBehindLoaderToLoadIfNotBehindPlaybackPosition() {
public void continueLoadingOnlyAllowFurthestBehindLoaderToLoadIfNotBehindPlaybackPosition() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2000);
FakeSequenceableLoader loader2 =
......@@ -149,11 +149,11 @@ public final class CompositeSequenceableLoaderTest {
}
/**
* Tests that {@link CompositeSequenceableLoader#continueLoading(long)} allows all loaders
* with next load position behind current playback position to continue loading.
* Tests that {@link CompositeSequenceableLoader#continueLoading(long)} allows all loaders with
* next load position behind current playback position to continue loading.
*/
@Test
public void testContinueLoadingReturnAllowAllLoadersBehindPlaybackPositionToLoad() {
public void continueLoadingReturnAllowAllLoadersBehindPlaybackPositionToLoad() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2000);
FakeSequenceableLoader loader2 =
......@@ -170,11 +170,11 @@ public final class CompositeSequenceableLoaderTest {
}
/**
* Tests that {@link CompositeSequenceableLoader#continueLoading(long)} does not allow loader
* with next load position at end-of-source to continue loading.
* Tests that {@link CompositeSequenceableLoader#continueLoading(long)} does not allow loader with
* next load position at end-of-source to continue loading.
*/
@Test
public void testContinueLoadingOnlyNotAllowEndOfSourceLoaderToLoad() {
public void continueLoadingOnlyNotAllowEndOfSourceLoaderToLoad() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(
/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ C.TIME_END_OF_SOURCE);
......@@ -191,11 +191,11 @@ public final class CompositeSequenceableLoaderTest {
/**
* Tests that {@link CompositeSequenceableLoader#continueLoading(long)} returns true if the loader
* with minimum next load position can make progress if next load positions are not behind
* current playback position.
* with minimum next load position can make progress if next load positions are not behind current
* playback position.
*/
@Test
public void testContinueLoadingReturnTrueIfFurthestBehindLoaderCanMakeProgress() {
public void continueLoadingReturnTrueIfFurthestBehindLoaderCanMakeProgress() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2000);
FakeSequenceableLoader loader2 =
......@@ -214,7 +214,7 @@ public final class CompositeSequenceableLoaderTest {
* minimum next load position.
*/
@Test
public void testContinueLoadingReturnTrueIfLoaderBehindPlaybackPositionCanMakeProgress() {
public void continueLoadingReturnTrueIfLoaderBehindPlaybackPositionCanMakeProgress() {
FakeSequenceableLoader loader1 =
new FakeSequenceableLoader(/* bufferedPositionUs */ 1000, /* nextLoadPositionUs */ 2000);
FakeSequenceableLoader loader2 =
......
......@@ -47,7 +47,7 @@ public class LoopingMediaSourceTest {
}
@Test
public void testSingleLoopTimeline() throws IOException {
public void singleLoopTimeline() throws IOException {
Timeline timeline = getLoopingTimeline(multiWindowTimeline, 1);
TimelineAsserts.assertWindowTags(timeline, 111, 222, 333);
TimelineAsserts.assertPeriodCounts(timeline, 1, 1, 1);
......@@ -66,7 +66,7 @@ public class LoopingMediaSourceTest {
}
@Test
public void testMultiLoopTimeline() throws IOException {
public void multiLoopTimeline() throws IOException {
Timeline timeline = getLoopingTimeline(multiWindowTimeline, 3);
TimelineAsserts.assertWindowTags(timeline, 111, 222, 333, 111, 222, 333, 111, 222, 333);
TimelineAsserts.assertPeriodCounts(timeline, 1, 1, 1, 1, 1, 1, 1, 1, 1);
......@@ -87,7 +87,7 @@ public class LoopingMediaSourceTest {
}
@Test
public void testInfiniteLoopTimeline() throws IOException {
public void infiniteLoopTimeline() throws IOException {
Timeline timeline = getLoopingTimeline(multiWindowTimeline, Integer.MAX_VALUE);
TimelineAsserts.assertWindowTags(timeline, 111, 222, 333);
TimelineAsserts.assertPeriodCounts(timeline, 1, 1, 1);
......@@ -105,7 +105,7 @@ public class LoopingMediaSourceTest {
}
@Test
public void testEmptyTimelineLoop() throws IOException {
public void emptyTimelineLoop() throws IOException {
Timeline timeline = getLoopingTimeline(Timeline.EMPTY, 1);
TimelineAsserts.assertEmpty(timeline);
......@@ -117,17 +117,17 @@ public class LoopingMediaSourceTest {
}
@Test
public void testSingleLoopPeriodCreation() throws Exception {
public void singleLoopPeriodCreation() throws Exception {
testMediaPeriodCreation(multiWindowTimeline, /* loopCount= */ 1);
}
@Test
public void testMultiLoopPeriodCreation() throws Exception {
public void multiLoopPeriodCreation() throws Exception {
testMediaPeriodCreation(multiWindowTimeline, /* loopCount= */ 3);
}
@Test
public void testInfiniteLoopPeriodCreation() throws Exception {
public void infiniteLoopPeriodCreation() throws Exception {
testMediaPeriodCreation(multiWindowTimeline, /* loopCount= */ Integer.MAX_VALUE);
}
......
......@@ -37,7 +37,7 @@ import org.robolectric.annotation.LooperMode;
public class MergingMediaSourceTest {
@Test
public void testMergingDynamicTimelines() throws IOException {
public void mergingDynamicTimelines() throws IOException {
FakeTimeline firstTimeline =
new FakeTimeline(new TimelineWindowDefinition(true, true, C.TIME_UNSET));
FakeTimeline secondTimeline =
......@@ -46,14 +46,14 @@ public class MergingMediaSourceTest {
}
@Test
public void testMergingStaticTimelines() throws IOException {
public void mergingStaticTimelines() throws IOException {
FakeTimeline firstTimeline = new FakeTimeline(new TimelineWindowDefinition(true, false, 20));
FakeTimeline secondTimeline = new FakeTimeline(new TimelineWindowDefinition(true, false, 10));
testMergingMediaSourcePrepare(firstTimeline, secondTimeline);
}
@Test
public void testMergingTimelinesWithDifferentPeriodCounts() throws IOException {
public void mergingTimelinesWithDifferentPeriodCounts() throws IOException {
FakeTimeline firstTimeline = new FakeTimeline(new TimelineWindowDefinition(1, null));
FakeTimeline secondTimeline = new FakeTimeline(new TimelineWindowDefinition(2, null));
try {
......@@ -65,7 +65,7 @@ public class MergingMediaSourceTest {
}
@Test
public void testMergingMediaSourcePeriodCreation() throws Exception {
public void mergingMediaSourcePeriodCreation() throws Exception {
FakeMediaSource[] mediaSources = new FakeMediaSource[2];
for (int i = 0; i < mediaSources.length; i++) {
mediaSources[i] = new FakeMediaSource(new FakeTimeline(/* windowCount= */ 2));
......
......@@ -32,7 +32,7 @@ public final class ShuffleOrderTest {
public static final long RANDOM_SEED = 1234567890L;
@Test
public void testDefaultShuffleOrder() {
public void defaultShuffleOrder() {
assertShuffleOrderCorrectness(new DefaultShuffleOrder(0, RANDOM_SEED), 0);
assertShuffleOrderCorrectness(new DefaultShuffleOrder(1, RANDOM_SEED), 1);
assertShuffleOrderCorrectness(new DefaultShuffleOrder(5, RANDOM_SEED), 5);
......@@ -55,7 +55,7 @@ public final class ShuffleOrderTest {
}
@Test
public void testDefaultShuffleOrderSideloaded() {
public void defaultShuffleOrderSideloaded() {
int[] shuffledIndices = new int[] {2, 1, 0, 4, 3};
ShuffleOrder shuffleOrder = new DefaultShuffleOrder(shuffledIndices, RANDOM_SEED);
assertThat(shuffleOrder.getFirstIndex()).isEqualTo(2);
......@@ -72,7 +72,7 @@ public final class ShuffleOrderTest {
}
@Test
public void testUnshuffledShuffleOrder() {
public void unshuffledShuffleOrder() {
assertShuffleOrderCorrectness(new UnshuffledShuffleOrder(0), 0);
assertShuffleOrderCorrectness(new UnshuffledShuffleOrder(1), 1);
assertShuffleOrderCorrectness(new UnshuffledShuffleOrder(5), 5);
......@@ -95,7 +95,7 @@ public final class ShuffleOrderTest {
}
@Test
public void testUnshuffledShuffleOrderIsUnshuffled() {
public void unshuffledShuffleOrderIsUnshuffled() {
ShuffleOrder shuffleOrder = new UnshuffledShuffleOrder(5);
assertThat(shuffleOrder.getFirstIndex()).isEqualTo(0);
assertThat(shuffleOrder.getLastIndex()).isEqualTo(4);
......
......@@ -40,7 +40,7 @@ public final class SinglePeriodTimelineTest {
}
@Test
public void testGetPeriodPositionDynamicWindowUnknownDuration() {
public void getPeriodPositionDynamicWindowUnknownDuration() {
SinglePeriodTimeline timeline =
new SinglePeriodTimeline(
C.TIME_UNSET, /* isSeekable= */ false, /* isDynamic= */ true, /* isLive= */ true);
......@@ -54,7 +54,7 @@ public final class SinglePeriodTimelineTest {
}
@Test
public void testGetPeriodPositionDynamicWindowKnownDuration() {
public void getPeriodPositionDynamicWindowKnownDuration() {
long windowDurationUs = 1000;
SinglePeriodTimeline timeline =
new SinglePeriodTimeline(
......
......@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
public final class TrackGroupArrayTest {
@Test
public void testParcelable() {
public void parcelable() {
Format format1 = Format.createSampleFormat("1", MimeTypes.VIDEO_H264);
Format format2 = Format.createSampleFormat("2", MimeTypes.AUDIO_AAC);
Format format3 = Format.createSampleFormat("3", MimeTypes.VIDEO_H264);
......
......@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
public final class TrackGroupTest {
@Test
public void testParcelable() {
public void parcelable() {
Format format1 = Format.createSampleFormat("1", MimeTypes.VIDEO_H264);
Format format2 = Format.createSampleFormat("2", MimeTypes.AUDIO_AAC);
......
......@@ -40,14 +40,14 @@ public final class AdPlaybackStateTest {
}
@Test
public void testSetAdCount() {
public void setAdCount() {
assertThat(state.adGroups[0].count).isEqualTo(C.LENGTH_UNSET);
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1);
assertThat(state.adGroups[0].count).isEqualTo(1);
}
@Test
public void testSetAdUriBeforeAdCount() {
public void setAdUriBeforeAdCount() {
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 1, TEST_URI);
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 2);
......@@ -58,7 +58,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testSetAdErrorBeforeAdCount() {
public void setAdErrorBeforeAdCount() {
state = state.withAdLoadError(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0);
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 2);
......@@ -68,7 +68,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testGetFirstAdIndexToPlayIsZero() {
public void getFirstAdIndexToPlayIsZero() {
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 3);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0, TEST_URI);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 2, TEST_URI);
......@@ -77,7 +77,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testGetFirstAdIndexToPlaySkipsPlayedAd() {
public void getFirstAdIndexToPlaySkipsPlayedAd() {
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 3);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0, TEST_URI);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 2, TEST_URI);
......@@ -90,7 +90,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testGetFirstAdIndexToPlaySkipsSkippedAd() {
public void getFirstAdIndexToPlaySkipsSkippedAd() {
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 3);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0, TEST_URI);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 2, TEST_URI);
......@@ -103,7 +103,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testGetFirstAdIndexToPlaySkipsErrorAds() {
public void getFirstAdIndexToPlaySkipsErrorAds() {
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 3);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0, TEST_URI);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 2, TEST_URI);
......@@ -115,7 +115,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testGetNextAdIndexToPlaySkipsErrorAds() {
public void getNextAdIndexToPlaySkipsErrorAds() {
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 3);
state = state.withAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 1, TEST_URI);
......@@ -125,7 +125,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testSetAdStateTwiceThrows() {
public void setAdStateTwiceThrows() {
state = state.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1);
state = state.withPlayedAd(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0);
try {
......@@ -137,7 +137,7 @@ public final class AdPlaybackStateTest {
}
@Test
public void testSkipAllWithoutAdCount() {
public void skipAllWithoutAdCount() {
state = state.withSkippedAdGroup(0);
state = state.withSkippedAdGroup(1);
assertThat(state.adGroups[0].count).isEqualTo(0);
......
......@@ -46,7 +46,7 @@ public final class SsaDecoderTest {
private static final String POSITIONS_WITHOUT_PLAYRES = "ssa/positioning_without_playres";
@Test
public void testDecodeEmpty() throws IOException {
public void decodeEmpty() throws IOException {
SsaDecoder decoder = new SsaDecoder();
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), EMPTY);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
......@@ -56,7 +56,7 @@ public final class SsaDecoderTest {
}
@Test
public void testDecodeTypical() throws IOException {
public void decodeTypical() throws IOException {
SsaDecoder decoder = new SsaDecoder();
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TYPICAL);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
......@@ -81,7 +81,7 @@ public final class SsaDecoderTest {
}
@Test
public void testDecodeTypicalWithInitializationData() throws IOException {
public void decodeTypicalWithInitializationData() throws IOException {
byte[] headerBytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TYPICAL_HEADER_ONLY);
byte[] formatBytes =
......@@ -101,7 +101,7 @@ public final class SsaDecoderTest {
}
@Test
public void testDecodeOverlappingTimecodes() throws IOException {
public void decodeOverlappingTimecodes() throws IOException {
SsaDecoder decoder = new SsaDecoder();
byte[] bytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), OVERLAPPING_TIMECODES);
......@@ -151,7 +151,7 @@ public final class SsaDecoderTest {
}
@Test
public void testDecodePositions() throws IOException {
public void decodePositions() throws IOException {
SsaDecoder decoder = new SsaDecoder();
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), POSITIONS);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
......@@ -204,7 +204,7 @@ public final class SsaDecoderTest {
}
@Test
public void testDecodeInvalidPositions() throws IOException {
public void decodeInvalidPositions() throws IOException {
SsaDecoder decoder = new SsaDecoder();
byte[] bytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), INVALID_POSITIONS);
......@@ -240,7 +240,7 @@ public final class SsaDecoderTest {
}
@Test
public void testDecodePositionsWithMissingPlayResY() throws IOException {
public void decodePositionsWithMissingPlayResY() throws IOException {
SsaDecoder decoder = new SsaDecoder();
byte[] bytes =
TestUtil.getByteArray(
......@@ -256,7 +256,7 @@ public final class SsaDecoderTest {
}
@Test
public void testDecodeInvalidTimecodes() throws IOException {
public void decodeInvalidTimecodes() throws IOException {
// Parsing should succeed, parsing the third cue only.
SsaDecoder decoder = new SsaDecoder();
byte[] bytes =
......
......@@ -41,7 +41,7 @@ public final class SubripDecoderTest {
private static final String TYPICAL_WITH_TAGS = "subrip/typical_with_tags";
@Test
public void testDecodeEmpty() throws IOException {
public void decodeEmpty() throws IOException {
SubripDecoder decoder = new SubripDecoder();
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), EMPTY_FILE);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
......@@ -51,7 +51,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeTypical() throws IOException {
public void decodeTypical() throws IOException {
SubripDecoder decoder = new SubripDecoder();
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TYPICAL_FILE);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
......@@ -63,7 +63,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeTypicalWithByteOrderMark() throws IOException {
public void decodeTypicalWithByteOrderMark() throws IOException {
SubripDecoder decoder = new SubripDecoder();
byte[] bytes =
TestUtil.getByteArray(
......@@ -77,7 +77,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeTypicalExtraBlankLine() throws IOException {
public void decodeTypicalExtraBlankLine() throws IOException {
SubripDecoder decoder = new SubripDecoder();
byte[] bytes =
TestUtil.getByteArray(
......@@ -91,7 +91,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeTypicalMissingTimecode() throws IOException {
public void decodeTypicalMissingTimecode() throws IOException {
// Parsing should succeed, parsing the first and third cues only.
SubripDecoder decoder = new SubripDecoder();
byte[] bytes =
......@@ -105,7 +105,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeTypicalMissingSequence() throws IOException {
public void decodeTypicalMissingSequence() throws IOException {
// Parsing should succeed, parsing the first and third cues only.
SubripDecoder decoder = new SubripDecoder();
byte[] bytes =
......@@ -119,7 +119,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeTypicalNegativeTimestamps() throws IOException {
public void decodeTypicalNegativeTimestamps() throws IOException {
// Parsing should succeed, parsing the third cue only.
SubripDecoder decoder = new SubripDecoder();
byte[] bytes =
......@@ -132,7 +132,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeTypicalUnexpectedEnd() throws IOException {
public void decodeTypicalUnexpectedEnd() throws IOException {
// Parsing should succeed, parsing the first and second cues only.
SubripDecoder decoder = new SubripDecoder();
byte[] bytes =
......@@ -145,7 +145,7 @@ public final class SubripDecoderTest {
}
@Test
public void testDecodeCueWithTag() throws IOException {
public void decodeCueWithTag() throws IOException {
SubripDecoder decoder = new SubripDecoder();
byte[] bytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TYPICAL_WITH_TAGS);
......
......@@ -65,7 +65,7 @@ public final class TtmlDecoderTest {
private static final String RUBIES_FILE = "ttml/rubies.xml";
@Test
public void testInlineAttributes() throws IOException, SubtitleDecoderException {
public void inlineAttributes() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INLINE_ATTRIBUTES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -84,7 +84,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testInheritInlineAttributes() throws IOException, SubtitleDecoderException {
public void inheritInlineAttributes() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INLINE_ATTRIBUTES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -113,7 +113,7 @@ public final class TtmlDecoderTest {
* @throws IOException thrown if reading subtitle file fails.
*/
@Test
public void testLime() throws IOException, SubtitleDecoderException {
public void lime() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INLINE_ATTRIBUTES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -128,7 +128,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testInheritGlobalStyle() throws IOException, SubtitleDecoderException {
public void inheritGlobalStyle() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_STYLE_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(2);
......@@ -143,7 +143,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testInheritGlobalStyleOverriddenByInlineAttributes()
public void inheritGlobalStyleOverriddenByInlineAttributes()
throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_STYLE_OVERRIDE_TTML_FILE);
......@@ -177,7 +177,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testInheritGlobalAndParent() throws IOException, SubtitleDecoderException {
public void inheritGlobalAndParent() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_GLOBAL_AND_PARENT_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -216,7 +216,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testInheritMultipleStyles() throws IOException, SubtitleDecoderException {
public void inheritMultipleStyles() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_MULTIPLE_STYLES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(12);
......@@ -231,7 +231,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testInheritMultipleStylesWithoutLocalAttributes()
public void inheritMultipleStylesWithoutLocalAttributes()
throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_MULTIPLE_STYLES_TTML_FILE);
......@@ -253,8 +253,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testMergeMultipleStylesWithParentStyle()
throws IOException, SubtitleDecoderException {
public void mergeMultipleStylesWithParentStyle() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_MULTIPLE_STYLES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(12);
......@@ -276,7 +275,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testMultipleRegions() throws IOException, SubtitleDecoderException {
public void multipleRegions() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(MULTIPLE_REGIONS_TTML_FILE);
List<Cue> cues = subtitle.getCues(1_000_000);
......@@ -325,7 +324,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testEmptyStyleAttribute() throws IOException, SubtitleDecoderException {
public void emptyStyleAttribute() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_MULTIPLE_STYLES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(12);
......@@ -338,7 +337,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testNonexistingStyleId() throws IOException, SubtitleDecoderException {
public void nonexistingStyleId() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_MULTIPLE_STYLES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(12);
......@@ -351,7 +350,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testNonExistingAndExistingStyleIdWithRedundantSpaces()
public void nonExistingAndExistingStyleIdWithRedundantSpaces()
throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(INHERIT_MULTIPLE_STYLES_TTML_FILE);
......@@ -366,7 +365,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testMultipleChaining() throws IOException, SubtitleDecoderException {
public void multipleChaining() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(CHAIN_MULTIPLE_STYLES_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(2);
......@@ -390,7 +389,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testNoUnderline() throws IOException, SubtitleDecoderException {
public void noUnderline() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(NO_UNDERLINE_LINETHROUGH_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -406,7 +405,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testNoLinethrough() throws IOException, SubtitleDecoderException {
public void noLinethrough() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(NO_UNDERLINE_LINETHROUGH_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -422,7 +421,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testFontSizeSpans() throws IOException, SubtitleDecoderException {
public void fontSizeSpans() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(FONT_SIZE_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(10);
......@@ -449,7 +448,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testFontSizeWithMissingUnitIsIgnored() throws IOException, SubtitleDecoderException {
public void fontSizeWithMissingUnitIsIgnored() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(FONT_SIZE_MISSING_UNIT_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(2);
......@@ -461,7 +460,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testFontSizeWithInvalidValueIsIgnored() throws IOException, SubtitleDecoderException {
public void fontSizeWithInvalidValueIsIgnored() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(FONT_SIZE_INVALID_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(6);
......@@ -483,7 +482,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testFontSizeWithEmptyValueIsIgnored() throws IOException, SubtitleDecoderException {
public void fontSizeWithEmptyValueIsIgnored() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(FONT_SIZE_EMPTY_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(2);
......@@ -495,7 +494,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testFrameRate() throws IOException, SubtitleDecoderException {
public void frameRate() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(FRAME_RATE_TTML_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -506,7 +505,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testBitmapPercentageRegion() throws IOException, SubtitleDecoderException {
public void bitmapPercentageRegion() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(BITMAP_REGION_FILE);
Cue cue = getOnlyCueAtTimeUs(subtitle, 1_000_000);
......@@ -535,7 +534,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testBitmapPixelRegion() throws IOException, SubtitleDecoderException {
public void bitmapPixelRegion() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(BITMAP_PIXEL_REGION_FILE);
Cue cue = getOnlyCueAtTimeUs(subtitle, 1_000_000);
......@@ -556,7 +555,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testBitmapUnsupportedRegion() throws IOException, SubtitleDecoderException {
public void bitmapUnsupportedRegion() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(BITMAP_UNSUPPORTED_REGION_FILE);
Cue cue = getOnlyCueAtTimeUs(subtitle, 1_000_000);
......@@ -577,7 +576,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testVerticalText() throws IOException, SubtitleDecoderException {
public void verticalText() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(VERTICAL_TEXT_FILE);
Cue firstCue = getOnlyCueAtTimeUs(subtitle, 10_000_000);
......@@ -591,7 +590,7 @@ public final class TtmlDecoderTest {
}
@Test
public void testTextCombine() throws IOException, SubtitleDecoderException {
public void textCombine() throws IOException, SubtitleDecoderException {
TtmlSubtitle subtitle = getSubtitle(TEXT_COMBINE_FILE);
Spanned firstCue = getOnlyCueTextAtTimeUs(subtitle, 10_000_000);
......
......@@ -35,12 +35,12 @@ import org.junit.runner.RunWith;
public final class TtmlRenderUtilTest {
@Test
public void testResolveStyleNoStyleAtAll() {
public void resolveStyleNoStyleAtAll() {
assertThat(resolveStyle(null, null, null)).isNull();
}
@Test
public void testResolveStyleSingleReferentialStyle() {
public void resolveStyleSingleReferentialStyle() {
Map<String, TtmlStyle> globalStyles = getGlobalStyles();
String[] styleIds = {"s0"};
......@@ -49,7 +49,7 @@ public final class TtmlRenderUtilTest {
}
@Test
public void testResolveStyleMultipleReferentialStyles() {
public void resolveStyleMultipleReferentialStyles() {
Map<String, TtmlStyle> globalStyles = getGlobalStyles();
String[] styleIds = {"s0", "s1"};
......@@ -67,7 +67,7 @@ public final class TtmlRenderUtilTest {
}
@Test
public void testResolveMergeSingleReferentialStyleIntoInlineStyle() {
public void resolveMergeSingleReferentialStyleIntoInlineStyle() {
Map<String, TtmlStyle> globalStyles = getGlobalStyles();
String[] styleIds = {"s0"};
TtmlStyle style = new TtmlStyle();
......@@ -83,7 +83,7 @@ public final class TtmlRenderUtilTest {
}
@Test
public void testResolveMergeMultipleReferentialStylesIntoInlineStyle() {
public void resolveMergeMultipleReferentialStylesIntoInlineStyle() {
Map<String, TtmlStyle> globalStyles = getGlobalStyles();
String[] styleIds = {"s0", "s1"};
TtmlStyle style = new TtmlStyle();
......@@ -99,7 +99,7 @@ public final class TtmlRenderUtilTest {
}
@Test
public void testResolveStyleOnlyInlineStyle() {
public void resolveStyleOnlyInlineStyle() {
TtmlStyle inlineStyle = new TtmlStyle();
assertThat(TtmlRenderUtil.resolveStyle(inlineStyle, null, null)).isSameInstanceAs(inlineStyle);
}
......
......@@ -68,7 +68,7 @@ public final class TtmlStyleTest {
.setVerticalType(VERTICAL_TYPE);
@Test
public void testInheritStyle() {
public void inheritStyle() {
TtmlStyle style = new TtmlStyle();
style.inherit(populatedStyle);
......@@ -95,7 +95,7 @@ public final class TtmlStyleTest {
}
@Test
public void testChainStyle() {
public void chainStyle() {
TtmlStyle style = new TtmlStyle();
style.chain(populatedStyle);
......@@ -121,7 +121,7 @@ public final class TtmlStyleTest {
}
@Test
public void testStyle() {
public void style() {
TtmlStyle style = new TtmlStyle();
assertThat(style.getStyle()).isEqualTo(UNSPECIFIED);
......@@ -136,7 +136,7 @@ public final class TtmlStyleTest {
}
@Test
public void testLinethrough() {
public void linethrough() {
TtmlStyle style = new TtmlStyle();
assertThat(style.isLinethrough()).isFalse();
......@@ -147,7 +147,7 @@ public final class TtmlStyleTest {
}
@Test
public void testUnderline() {
public void underline() {
TtmlStyle style = new TtmlStyle();
assertThat(style.isUnderline()).isFalse();
......@@ -158,7 +158,7 @@ public final class TtmlStyleTest {
}
@Test
public void testFontFamily() {
public void fontFamily() {
TtmlStyle style = new TtmlStyle();
assertThat(style.getFontFamily()).isNull();
......@@ -169,7 +169,7 @@ public final class TtmlStyleTest {
}
@Test
public void testFontColor() {
public void fontColor() {
TtmlStyle style = new TtmlStyle();
assertThat(style.hasFontColor()).isFalse();
......@@ -179,7 +179,7 @@ public final class TtmlStyleTest {
}
@Test
public void testFontSize() {
public void fontSize() {
TtmlStyle style = new TtmlStyle();
assertThat(style.getFontSize()).isEqualTo(0);
......@@ -188,7 +188,7 @@ public final class TtmlStyleTest {
}
@Test
public void testFontSizeUnit() {
public void fontSizeUnit() {
TtmlStyle style = new TtmlStyle();
assertThat(style.getFontSizeUnit()).isEqualTo(UNSPECIFIED);
......@@ -197,7 +197,7 @@ public final class TtmlStyleTest {
}
@Test
public void testBackgroundColor() {
public void backgroundColor() {
TtmlStyle style = new TtmlStyle();
assertThat(style.hasBackgroundColor()).isFalse();
......@@ -207,7 +207,7 @@ public final class TtmlStyleTest {
}
@Test
public void testId() {
public void id() {
TtmlStyle style = new TtmlStyle();
assertThat(style.getId()).isNull();
......@@ -236,7 +236,7 @@ public final class TtmlStyleTest {
}
@Test
public void testTextAlign() {
public void textAlign() {
TtmlStyle style = new TtmlStyle();
assertThat(style.getTextAlign()).isNull();
......@@ -247,7 +247,7 @@ public final class TtmlStyleTest {
}
@Test
public void testTextCombine() {
public void textCombine() {
TtmlStyle style = new TtmlStyle();
assertThat(style.getTextCombine()).isFalse();
......
......@@ -54,7 +54,7 @@ public final class Tx3gDecoderTest {
private static final String INITIALIZATION_ALL_DEFAULTS = "tx3g/initialization_all_defaults";
@Test
public void testDecodeNoSubtitle() throws IOException, SubtitleDecoderException {
public void decodeNoSubtitle() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), NO_SUBTITLE);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
......@@ -62,7 +62,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testDecodeJustText() throws IOException, SubtitleDecoderException {
public void decodeJustText() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), SAMPLE_JUST_TEXT);
......@@ -74,7 +74,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testDecodeWithStyl() throws IOException, SubtitleDecoderException {
public void decodeWithStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), SAMPLE_WITH_STYL);
......@@ -91,7 +91,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testDecodeWithStylAllDefaults() throws IOException, SubtitleDecoderException {
public void decodeWithStylAllDefaults() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(
......@@ -104,7 +104,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testDecodeUtf16BeNoStyl() throws IOException, SubtitleDecoderException {
public void decodeUtf16BeNoStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), SAMPLE_UTF16_BE_NO_STYL);
......@@ -116,7 +116,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testDecodeUtf16LeNoStyl() throws IOException, SubtitleDecoderException {
public void decodeUtf16LeNoStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), SAMPLE_UTF16_LE_NO_STYL);
......@@ -128,7 +128,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testDecodeWithMultipleStyl() throws IOException, SubtitleDecoderException {
public void decodeWithMultipleStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(
......@@ -148,7 +148,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testDecodeWithOtherExtension() throws IOException, SubtitleDecoderException {
public void decodeWithOtherExtension() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(
......@@ -165,7 +165,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testInitializationDecodeWithStyl() throws IOException, SubtitleDecoderException {
public void initializationDecodeWithStyl() throws IOException, SubtitleDecoderException {
byte[] initBytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), INITIALIZATION);
Tx3gDecoder decoder = new Tx3gDecoder(Collections.singletonList(initBytes));
......@@ -188,7 +188,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testInitializationDecodeWithTbox() throws IOException, SubtitleDecoderException {
public void initializationDecodeWithTbox() throws IOException, SubtitleDecoderException {
byte[] initBytes =
TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), INITIALIZATION);
Tx3gDecoder decoder = new Tx3gDecoder(Collections.singletonList(initBytes));
......@@ -209,7 +209,7 @@ public final class Tx3gDecoderTest {
}
@Test
public void testInitializationAllDefaultsDecodeWithStyl()
public void initializationAllDefaultsDecodeWithStyl()
throws IOException, SubtitleDecoderException {
byte[] initBytes =
TestUtil.getByteArray(
......
......@@ -38,7 +38,7 @@ public final class CssParserTest {
}
@Test
public void testSkipWhitespacesAndComments() {
public void skipWhitespacesAndComments() {
// Skip only whitespaces
String skipOnlyWhitespaces = " \t\r\n\f End of skip\n /* */";
assertSkipsToEndOfSkip("End of skip", skipOnlyWhitespaces);
......@@ -61,7 +61,7 @@ public final class CssParserTest {
}
@Test
public void testGetInputLimit() {
public void getInputLimit() {
// \r After 3 lines.
String threeLinesThen3Cr = "One Line\nThen other\rAnd finally\r\r\r";
assertInputLimit("", threeLinesThen3Cr);
......@@ -87,7 +87,7 @@ public final class CssParserTest {
}
@Test
public void testParseMethodSimpleInput() {
public void parseMethodSimpleInput() {
WebvttCssStyle expectedStyle = new WebvttCssStyle();
String styleBlock1 = " ::cue { color : black; background-color: PapayaWhip }";
expectedStyle.setFontColor(0xFF000000);
......@@ -106,7 +106,7 @@ public final class CssParserTest {
}
@Test
public void testParseMethodMultipleRulesInBlockInput() {
public void parseMethodMultipleRulesInBlockInput() {
String styleBlock =
"::cue {\n background-color\n:#00fFFe} \n::cue {\n background-color\n:#00000000}\n";
WebvttCssStyle expectedStyle = new WebvttCssStyle();
......@@ -117,7 +117,7 @@ public final class CssParserTest {
}
@Test
public void testMultiplePropertiesInBlock() {
public void multiplePropertiesInBlock() {
String styleBlock = "::cue(#id){text-decoration:underline; background-color:green;"
+ "color:red; font-family:Courier; font-weight:bold}";
WebvttCssStyle expectedStyle = new WebvttCssStyle();
......@@ -132,7 +132,7 @@ public final class CssParserTest {
}
@Test
public void testRgbaColorExpression() {
public void rgbaColorExpression() {
String styleBlock = "::cue(#rgb){background-color: rgba(\n10/* Ugly color */,11\t, 12\n,.1);"
+ "color:rgb(1,1,\n1)}";
WebvttCssStyle expectedStyle = new WebvttCssStyle();
......@@ -144,7 +144,7 @@ public final class CssParserTest {
}
@Test
public void testGetNextToken() {
public void getNextToken() {
String stringInput = " lorem:ipsum\n{dolor}#sit,amet;lorem:ipsum\r\t\f\ndolor(())\n";
ParsableByteArray input = new ParsableByteArray(Util.getUtf8Bytes(stringInput));
StringBuilder builder = new StringBuilder();
......@@ -170,7 +170,7 @@ public final class CssParserTest {
}
@Test
public void testStyleScoreSystem() {
public void styleScoreSystem() {
WebvttCssStyle style = new WebvttCssStyle();
// Universal selector.
assertThat(style.getSpecificityScore("", "", new String[0], "")).isEqualTo(1);
......
......@@ -88,7 +88,7 @@ public final class Mp4WebvttDecoderTest {
// Positive tests.
@Test
public void testSingleCueSample() throws SubtitleDecoderException {
public void singleCueSample() throws SubtitleDecoderException {
Mp4WebvttDecoder decoder = new Mp4WebvttDecoder();
Subtitle result = decoder.decode(SINGLE_CUE_SAMPLE, SINGLE_CUE_SAMPLE.length, false);
// Line feed must be trimmed by the decoder
......@@ -97,7 +97,7 @@ public final class Mp4WebvttDecoderTest {
}
@Test
public void testTwoCuesSample() throws SubtitleDecoderException {
public void twoCuesSample() throws SubtitleDecoderException {
Mp4WebvttDecoder decoder = new Mp4WebvttDecoder();
Subtitle result = decoder.decode(DOUBLE_CUE_SAMPLE, DOUBLE_CUE_SAMPLE.length, false);
Cue firstExpectedCue = WebvttCueParser.newCueForText("Hello World");
......@@ -106,7 +106,7 @@ public final class Mp4WebvttDecoderTest {
}
@Test
public void testNoCueSample() throws SubtitleDecoderException {
public void noCueSample() throws SubtitleDecoderException {
Mp4WebvttDecoder decoder = new Mp4WebvttDecoder();
Subtitle result = decoder.decode(NO_CUE_SAMPLE, NO_CUE_SAMPLE.length, false);
assertThat(result.getEventTimeCount()).isEqualTo(1);
......@@ -117,7 +117,7 @@ public final class Mp4WebvttDecoderTest {
// Negative tests.
@Test
public void testSampleWithIncompleteHeader() {
public void sampleWithIncompleteHeader() {
Mp4WebvttDecoder decoder = new Mp4WebvttDecoder();
try {
decoder.decode(INCOMPLETE_HEADER_SAMPLE, INCOMPLETE_HEADER_SAMPLE.length, false);
......
......@@ -31,7 +31,7 @@ import org.junit.runner.RunWith;
public final class WebvttCueParserTest {
@Test
public void testParseStrictValidClassesAndTrailingTokens() throws Exception {
public void parseStrictValidClassesAndTrailingTokens() throws Exception {
Spanned text = parseCueText("<v.first.loud Esme>"
+ "This <u.style1.style2 some stuff>is</u> text with <b.foo><i.bar>html</i></b> tags");
......@@ -42,7 +42,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseStrictValidUnsupportedTagsStrippedOut() throws Exception {
public void parseStrictValidUnsupportedTagsStrippedOut() throws Exception {
Spanned text = parseCueText("<v.first.loud Esme>This <unsupported>is</unsupported> text with "
+ "<notsupp><invalid>html</invalid></notsupp> tags");
......@@ -51,7 +51,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseRubyTag() throws Exception {
public void parseRubyTag() throws Exception {
Spanned text =
parseCueText("Some <ruby>base text<rt>with ruby</rt></ruby> and undecorated text");
......@@ -63,7 +63,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseRubyTagWithNoTextTag() throws Exception {
public void parseRubyTagWithNoTextTag() throws Exception {
Spanned text = parseCueText("Some <ruby>base text with no ruby text</ruby>");
assertThat(text.toString()).isEqualTo("Some base text with no ruby text");
......@@ -71,7 +71,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseRubyTagWithEmptyTextTag() throws Exception {
public void parseRubyTagWithEmptyTextTag() throws Exception {
Spanned text = parseCueText("Some <ruby>base text with<rt></rt></ruby> empty ruby text");
assertThat(text.toString()).isEqualTo("Some base text with empty ruby text");
......@@ -81,7 +81,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseDefaultTextColor() throws Exception {
public void parseDefaultTextColor() throws Exception {
Spanned text = parseCueText("In this sentence <c.red>this text</c> is red");
assertThat(text.toString()).isEqualTo("In this sentence this text is red");
......@@ -92,7 +92,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseUnsupportedDefaultTextColor() throws Exception {
public void parseUnsupportedDefaultTextColor() throws Exception {
Spanned text = parseCueText("In this sentence <c.papayawhip>this text</c> is not papaya");
assertThat(text.toString()).isEqualTo("In this sentence this text is not papaya");
......@@ -100,7 +100,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseDefaultBackgroundColor() throws Exception {
public void parseDefaultBackgroundColor() throws Exception {
Spanned text = parseCueText("In this sentence <c.bg_cyan>this text</c> has a cyan background");
assertThat(text.toString()).isEqualTo("In this sentence this text has a cyan background");
......@@ -111,7 +111,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseUnsupportedDefaultBackgroundColor() throws Exception {
public void parseUnsupportedDefaultBackgroundColor() throws Exception {
Spanned text =
parseCueText(
"In this sentence <c.bg_papayawhip>this text</c> doesn't have a papaya background");
......@@ -122,7 +122,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseWellFormedUnclosedEndAtCueEnd() throws Exception {
public void parseWellFormedUnclosedEndAtCueEnd() throws Exception {
Spanned text = parseCueText("An <u some trailing stuff>unclosed u tag with "
+ "<i>italic</i> inside");
......@@ -135,7 +135,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseWellFormedUnclosedEndAtParent() throws Exception {
public void parseWellFormedUnclosedEndAtParent() throws Exception {
Spanned text = parseCueText("An italic tag with unclosed <i><u>underline</i> inside");
assertThat(text.toString()).isEqualTo("An italic tag with unclosed underline inside");
......@@ -150,7 +150,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseMalformedNestedElements() throws Exception {
public void parseMalformedNestedElements() throws Exception {
Spanned text = parseCueText("<b><u>Overlapping u <i>and</u> i tags</i></b>");
String expectedText = "Overlapping u and i tags";
......@@ -163,7 +163,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseCloseNonExistingTag() throws Exception {
public void parseCloseNonExistingTag() throws Exception {
Spanned text = parseCueText("foo<b>bar</i>baz</b>buzz");
assertThat(text.toString()).isEqualTo("foobarbazbuzz");
......@@ -172,49 +172,49 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseEmptyTagName() throws Exception {
public void parseEmptyTagName() throws Exception {
Spanned text = parseCueText("An empty <>tag");
assertThat(text.toString()).isEqualTo("An empty tag");
}
@Test
public void testParseEntities() throws Exception {
public void parseEntities() throws Exception {
Spanned text = parseCueText("&amp; &gt; &lt; &nbsp;");
assertThat(text.toString()).isEqualTo("& > < ");
}
@Test
public void testParseEntitiesUnsupported() throws Exception {
public void parseEntitiesUnsupported() throws Exception {
Spanned text = parseCueText("&noway; &sure;");
assertThat(text.toString()).isEqualTo(" ");
}
@Test
public void testParseEntitiesNotTerminated() throws Exception {
public void parseEntitiesNotTerminated() throws Exception {
Spanned text = parseCueText("&amp here comes text");
assertThat(text.toString()).isEqualTo("& here comes text");
}
@Test
public void testParseEntitiesNotTerminatedUnsupported() throws Exception {
public void parseEntitiesNotTerminatedUnsupported() throws Exception {
Spanned text = parseCueText("&surenot here comes text");
assertThat(text.toString()).isEqualTo(" here comes text");
}
@Test
public void testParseEntitiesNotTerminatedNoSpace() throws Exception {
public void parseEntitiesNotTerminatedNoSpace() throws Exception {
Spanned text = parseCueText("&surenot");
assertThat(text.toString()).isEqualTo("&surenot");
}
@Test
public void testParseVoidTag() throws Exception {
public void parseVoidTag() throws Exception {
Spanned text = parseCueText("here comes<br/> text<br/>");
assertThat(text.toString()).isEqualTo("here comes text");
}
@Test
public void testParseMultipleTagsOfSameKind() {
public void parseMultipleTagsOfSameKind() {
Spanned text = parseCueText("blah <b>blah</b> blah <b>foo</b>");
assertThat(text.toString()).isEqualTo("blah blah blah foo");
......@@ -223,7 +223,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseInvalidVoidSlash() {
public void parseInvalidVoidSlash() {
Spanned text = parseCueText("blah <b/.st1.st2 trailing stuff> blah");
assertThat(text.toString()).isEqualTo("blah blah");
......@@ -231,7 +231,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseMonkey() throws Exception {
public void parseMonkey() throws Exception {
Spanned text = parseCueText("< u>An unclosed u tag with <<<<< i>italic</u></u></u></u >"
+ "</i><u><u> inside");
assertThat(text.toString()).isEqualTo("An unclosed u tag with italic inside");
......@@ -241,7 +241,7 @@ public final class WebvttCueParserTest {
}
@Test
public void testParseCornerCases() throws Exception {
public void parseCornerCases() throws Exception {
Spanned text = parseCueText(">");
assertThat(text.toString()).isEqualTo(">");
......
......@@ -57,7 +57,7 @@ public class WebvttDecoderTest {
@Rule public final Expect expect = Expect.create();
@Test
public void testDecodeEmpty() throws IOException {
public void decodeEmpty() throws IOException {
WebvttDecoder decoder = new WebvttDecoder();
byte[] bytes = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), EMPTY_FILE);
try {
......@@ -69,7 +69,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeTypical() throws Exception {
public void decodeTypical() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(TYPICAL_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -86,7 +86,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeWithBom() throws Exception {
public void decodeWithBom() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_BOM);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -103,7 +103,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeTypicalWithBadTimestamps() throws Exception {
public void decodeTypicalWithBadTimestamps() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(TYPICAL_WITH_BAD_TIMESTAMPS);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -120,7 +120,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeTypicalWithIds() throws Exception {
public void decodeTypicalWithIds() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(TYPICAL_WITH_IDS_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -137,7 +137,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeTypicalWithComments() throws Exception {
public void decodeTypicalWithComments() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(TYPICAL_WITH_COMMENTS_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -154,7 +154,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeWithTags() throws Exception {
public void decodeWithTags() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_TAGS_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(8);
......@@ -181,7 +181,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeWithPositioning() throws Exception {
public void decodeWithPositioning() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_POSITIONING_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(12);
......@@ -249,7 +249,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeWithVertical() throws Exception {
public void decodeWithVertical() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_VERTICAL_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(6);
......@@ -274,7 +274,7 @@ public class WebvttDecoderTest {
}
@Test
public void testDecodeWithBadCueHeader() throws Exception {
public void decodeWithBadCueHeader() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_BAD_CUE_HEADER_FILE);
assertThat(subtitle.getEventTimeCount()).isEqualTo(4);
......@@ -291,7 +291,7 @@ public class WebvttDecoderTest {
}
@Test
public void testWebvttWithCssStyle() throws Exception {
public void webvttWithCssStyle() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_CSS_STYLES);
Spanned firstCueText = getUniqueSpanTextAt(subtitle, 0);
......@@ -323,7 +323,7 @@ public class WebvttDecoderTest {
}
@Test
public void testWithComplexCssSelectors() throws Exception {
public void withComplexCssSelectors() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_CSS_COMPLEX_SELECTORS);
Spanned firstCueText = getUniqueSpanTextAt(subtitle, /* timeUs= */ 0);
assertThat(firstCueText).hasUnderlineSpanBetween(0, firstCueText.length());
......@@ -362,7 +362,7 @@ public class WebvttDecoderTest {
}
@Test
public void testWebvttWithCssTextCombineUpright() throws Exception {
public void webvttWithCssTextCombineUpright() throws Exception {
WebvttSubtitle subtitle = getSubtitleForTestAsset(WITH_CSS_TEXT_COMBINE_UPRIGHT);
Spanned firstCueText = getUniqueSpanTextAt(subtitle, 500_000);
......
......@@ -75,7 +75,7 @@ public class WebvttSubtitleTest {
/* endTimeUs= */ 3_000_000)));
@Test
public void testEventCount() {
public void eventCount() {
assertThat(emptySubtitle.getEventTimeCount()).isEqualTo(0);
assertThat(simpleSubtitle.getEventTimeCount()).isEqualTo(4);
assertThat(overlappingSubtitle.getEventTimeCount()).isEqualTo(4);
......@@ -83,17 +83,17 @@ public class WebvttSubtitleTest {
}
@Test
public void testSimpleSubtitleEventTimes() {
public void simpleSubtitleEventTimes() {
testSubtitleEventTimesHelper(simpleSubtitle);
}
@Test
public void testSimpleSubtitleEventIndices() {
public void simpleSubtitleEventIndices() {
testSubtitleEventIndicesHelper(simpleSubtitle);
}
@Test
public void testSimpleSubtitleText() {
public void simpleSubtitleText() {
// Test before first subtitle
assertSingleCueEmpty(simpleSubtitle.getCues(0));
assertSingleCueEmpty(simpleSubtitle.getCues(500_000));
......@@ -121,17 +121,17 @@ public class WebvttSubtitleTest {
}
@Test
public void testOverlappingSubtitleEventTimes() {
public void overlappingSubtitleEventTimes() {
testSubtitleEventTimesHelper(overlappingSubtitle);
}
@Test
public void testOverlappingSubtitleEventIndices() {
public void overlappingSubtitleEventIndices() {
testSubtitleEventIndicesHelper(overlappingSubtitle);
}
@Test
public void testOverlappingSubtitleText() {
public void overlappingSubtitleText() {
// Test before first subtitle
assertSingleCueEmpty(overlappingSubtitle.getCues(0));
assertSingleCueEmpty(overlappingSubtitle.getCues(500_000));
......@@ -162,17 +162,17 @@ public class WebvttSubtitleTest {
}
@Test
public void testNestedSubtitleEventTimes() {
public void nestedSubtitleEventTimes() {
testSubtitleEventTimesHelper(nestedSubtitle);
}
@Test
public void testNestedSubtitleEventIndices() {
public void nestedSubtitleEventIndices() {
testSubtitleEventIndicesHelper(nestedSubtitle);
}
@Test
public void testNestedSubtitleText() {
public void nestedSubtitleText() {
// Test before first subtitle
assertSingleCueEmpty(nestedSubtitle.getCues(0));
assertSingleCueEmpty(nestedSubtitle.getCues(500_000));
......
......@@ -63,7 +63,7 @@ public final class AdaptiveTrackSelectionTest {
@Test
@SuppressWarnings("deprecation")
public void testFactoryUsesInitiallyProvidedBandwidthMeter() {
public void factoryUsesInitiallyProvidedBandwidthMeter() {
BandwidthMeter initialBandwidthMeter = mock(BandwidthMeter.class);
BandwidthMeter injectedBandwidthMeter = mock(BandwidthMeter.class);
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
......@@ -87,7 +87,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testSelectInitialIndexUseMaxInitialBitrateIfNoBandwidthEstimate() {
public void selectInitialIndexUseMaxInitialBitrateIfNoBandwidthEstimate() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -101,7 +101,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testSelectInitialIndexUseBandwidthEstimateIfAvailable() {
public void selectInitialIndexUseBandwidthEstimateIfAvailable() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -115,7 +115,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testUpdateSelectedTrackDoNotSwitchUpIfNotBufferedEnough() {
public void updateSelectedTrackDoNotSwitchUpIfNotBufferedEnough() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -143,7 +143,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testUpdateSelectedTrackSwitchUpIfBufferedEnough() {
public void updateSelectedTrackSwitchUpIfBufferedEnough() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -171,7 +171,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testUpdateSelectedTrackDoNotSwitchDownIfBufferedEnough() {
public void updateSelectedTrackDoNotSwitchDownIfBufferedEnough() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -199,7 +199,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testUpdateSelectedTrackSwitchDownIfNotBufferedEnough() {
public void updateSelectedTrackSwitchDownIfNotBufferedEnough() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -227,7 +227,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testEvaluateQueueSizeReturnQueueSizeIfBandwidthIsNotImproved() {
public void evaluateQueueSizeReturnQueueSizeIfBandwidthIsNotImproved() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -252,7 +252,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testEvaluateQueueSizeDoNotReevaluateUntilAfterMinTimeBetweenBufferReevaluation() {
public void evaluateQueueSizeDoNotReevaluateUntilAfterMinTimeBetweenBufferReevaluation() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......@@ -289,7 +289,7 @@ public final class AdaptiveTrackSelectionTest {
}
@Test
public void testEvaluateQueueSizeRetainMoreThanMinimumDurationAfterDiscard() {
public void evaluateQueueSizeRetainMoreThanMinimumDurationAfterDiscard() {
Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
Format format3 = videoFormat(/* bitrate= */ 2000, /* width= */ 960, /* height= */ 720);
......
......@@ -29,7 +29,7 @@ public final class AssetDataSourceTest {
private static final String DATA_PATH = "mp3/1024_incrementing_bytes.mp3";
@Test
public void testReadFileUri() throws Exception {
public void readFileUri() throws Exception {
AssetDataSource dataSource = new AssetDataSource(ApplicationProvider.getApplicationContext());
DataSpec dataSpec = new DataSpec(Uri.parse("file:///android_asset/" + DATA_PATH));
TestUtil.assertDataSourceContent(
......@@ -40,7 +40,7 @@ public final class AssetDataSourceTest {
}
@Test
public void testReadAssetUri() throws Exception {
public void readAssetUri() throws Exception {
AssetDataSource dataSource = new AssetDataSource(ApplicationProvider.getApplicationContext());
DataSpec dataSpec = new DataSpec(Uri.parse("asset:///" + DATA_PATH));
TestUtil.assertDataSourceContent(
......
......@@ -33,17 +33,17 @@ public final class ByteArrayDataSourceTest {
private static final byte[] TEST_DATA_ODD = new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
@Test
public void testFullReadSingleBytes() {
public void fullReadSingleBytes() {
readTestData(TEST_DATA, 0, C.LENGTH_UNSET, 1, 0, 1, false);
}
@Test
public void testFullReadAllBytes() {
public void fullReadAllBytes() {
readTestData(TEST_DATA, 0, C.LENGTH_UNSET, 100, 0, 100, false);
}
@Test
public void testLimitReadSingleBytes() {
public void limitReadSingleBytes() {
// Limit set to the length of the data.
readTestData(TEST_DATA, 0, TEST_DATA.length, 1, 0, 1, false);
// And less.
......@@ -51,7 +51,7 @@ public final class ByteArrayDataSourceTest {
}
@Test
public void testFullReadTwoBytes() {
public void fullReadTwoBytes() {
// Try with the total data length an exact multiple of the size of each individual read.
readTestData(TEST_DATA, 0, C.LENGTH_UNSET, 2, 0, 2, false);
// And not.
......@@ -59,7 +59,7 @@ public final class ByteArrayDataSourceTest {
}
@Test
public void testLimitReadTwoBytes() {
public void limitReadTwoBytes() {
// Try with the limit an exact multiple of the size of each individual read.
readTestData(TEST_DATA, 0, 6, 2, 0, 2, false);
// And not.
......@@ -67,7 +67,7 @@ public final class ByteArrayDataSourceTest {
}
@Test
public void testReadFromValidOffsets() {
public void readFromValidOffsets() {
// Read from an offset without bound.
readTestData(TEST_DATA, 1, C.LENGTH_UNSET, 1, 0, 1, false);
// And with bound.
......@@ -79,7 +79,7 @@ public final class ByteArrayDataSourceTest {
}
@Test
public void testReadFromInvalidOffsets() {
public void readFromInvalidOffsets() {
// Read from first invalid offset and check failure without bound.
readTestData(TEST_DATA, TEST_DATA.length, C.LENGTH_UNSET, 1, 0, 1, true);
// And with bound.
......@@ -87,7 +87,7 @@ public final class ByteArrayDataSourceTest {
}
@Test
public void testReadWithInvalidLength() {
public void readWithInvalidLength() {
// Read more data than is available.
readTestData(TEST_DATA, 0, TEST_DATA.length + 1, 1, 0, 1, true);
// And with bound.
......
......@@ -44,7 +44,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testBase64Data() throws IOException {
public void base64Data() throws IOException {
DataSpec dataSpec = buildDataSpec(DATA_SCHEME_URI);
assertDataSourceContent(
schemeDataDataSource,
......@@ -55,7 +55,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testAsciiData() throws IOException {
public void asciiData() throws IOException {
assertDataSourceContent(
schemeDataDataSource,
buildDataSpec("data:,A%20brief%20note"),
......@@ -63,7 +63,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testPartialReads() throws IOException {
public void partialReads() throws IOException {
byte[] buffer = new byte[18];
DataSpec dataSpec = buildDataSpec("data:,012345678901234567");
assertThat(schemeDataDataSource.open(dataSpec)).isEqualTo(18);
......@@ -76,7 +76,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testSequentialRangeRequests() throws IOException {
public void sequentialRangeRequests() throws IOException {
DataSpec dataSpec =
buildDataSpec(DATA_SCHEME_URI, /* position= */ 1, /* length= */ C.LENGTH_UNSET);
assertDataSourceContent(
......@@ -97,7 +97,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testInvalidStartPositionRequest() throws IOException {
public void invalidStartPositionRequest() throws IOException {
try {
// Try to open a range starting one byte beyond the resource's length.
schemeDataDataSource.open(
......@@ -109,7 +109,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testRangeExceedingResourceLengthRequest() throws IOException {
public void rangeExceedingResourceLengthRequest() throws IOException {
try {
// Try to open a range exceeding the resource's length.
schemeDataDataSource.open(
......@@ -121,7 +121,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testIncorrectScheme() {
public void incorrectScheme() {
try {
schemeDataDataSource.open(buildDataSpec("http://www.google.com"));
fail();
......@@ -131,7 +131,7 @@ public final class DataSchemeDataSourceTest {
}
@Test
public void testMalformedData() {
public void malformedData() {
try {
schemeDataDataSource.open(buildDataSpec("data:text/plain;base64,,This%20is%20Content"));
fail();
......
......@@ -33,7 +33,7 @@ public final class DataSourceInputStreamTest {
private static final byte[] TEST_DATA = TestUtil.buildTestData(16);
@Test
public void testReadSingleBytes() throws IOException {
public void readSingleBytes() throws IOException {
DataSourceInputStream inputStream = buildTestInputStream();
// No bytes read yet.
assertThat(inputStream.bytesRead()).isEqualTo(0);
......@@ -53,7 +53,7 @@ public final class DataSourceInputStreamTest {
}
@Test
public void testRead() throws IOException {
public void read() throws IOException {
DataSourceInputStream inputStream = buildTestInputStream();
// Read bytes.
byte[] readBytes = new byte[TEST_DATA.length];
......@@ -76,7 +76,7 @@ public final class DataSourceInputStreamTest {
}
@Test
public void testSkip() throws IOException {
public void skip() throws IOException {
DataSourceInputStream inputStream = buildTestInputStream();
// Skip bytes.
long totalBytesSkipped = 0;
......
......@@ -91,7 +91,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testFragmentSize() throws Exception {
public void fragmentSize() throws Exception {
CacheDataSource cacheDataSource = createCacheDataSource(false, false);
assertReadDataContentLength(cacheDataSource, boundedDataSpec, false, false);
for (String key : cache.getKeys()) {
......@@ -103,27 +103,27 @@ public final class CacheDataSourceTest {
}
@Test
public void testCacheAndReadUnboundedRequest() throws Exception {
public void cacheAndReadUnboundedRequest() throws Exception {
assertCacheAndRead(unboundedDataSpec, /* unknownLength= */ false);
}
@Test
public void testCacheAndReadUnknownLength() throws Exception {
public void cacheAndReadUnknownLength() throws Exception {
assertCacheAndRead(boundedDataSpec, /* unknownLength= */ true);
}
@Test
public void testCacheAndReadUnboundedRequestUnknownLength() throws Exception {
public void cacheAndReadUnboundedRequestUnknownLength() throws Exception {
assertCacheAndRead(unboundedDataSpec, /* unknownLength= */ true);
}
@Test
public void testCacheAndRead() throws Exception {
public void cacheAndRead() throws Exception {
assertCacheAndRead(boundedDataSpec, /* unknownLength= */ false);
}
@Test
public void testPropagatesHttpHeadersUpstream() throws Exception {
public void propagatesHttpHeadersUpstream() throws Exception {
CacheDataSource cacheDataSource =
createCacheDataSource(/* setReadException= */ false, /* unknownLength= */ false);
DataSpec dataSpec = buildDataSpec(/* position= */ 2, /* length= */ 5);
......@@ -136,7 +136,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testUnsatisfiableRange() throws Exception {
public void unsatisfiableRange() throws Exception {
// Bounded request but the content length is unknown. This forces all data to be cached but not
// the length.
assertCacheAndRead(boundedDataSpec, /* unknownLength= */ true);
......@@ -160,13 +160,13 @@ public final class CacheDataSourceTest {
}
@Test
public void testCacheAndReadUnboundedRequestWithCacheKeyFactoryWithNullDataSpecCacheKey()
public void cacheAndReadUnboundedRequestWithCacheKeyFactoryWithNullDataSpecCacheKey()
throws Exception {
assertCacheAndRead(unboundedDataSpec, /* unknownLength= */ false, cacheKeyFactory);
}
@Test
public void testCacheAndReadUnknownLengthWithCacheKeyFactoryOverridingWithNullDataSpecCacheKey()
public void cacheAndReadUnknownLengthWithCacheKeyFactoryOverridingWithNullDataSpecCacheKey()
throws Exception {
assertCacheAndRead(boundedDataSpec, /* unknownLength= */ true, cacheKeyFactory);
}
......@@ -179,12 +179,12 @@ public final class CacheDataSourceTest {
}
@Test
public void testCacheAndReadWithCacheKeyFactoryWithNullDataSpecCacheKey() throws Exception {
public void cacheAndReadWithCacheKeyFactoryWithNullDataSpecCacheKey() throws Exception {
assertCacheAndRead(boundedDataSpec, /* unknownLength= */ false, cacheKeyFactory);
}
@Test
public void testUnsatisfiableRangeWithCacheKeyFactoryNullDataSpecCacheKey() throws Exception {
public void unsatisfiableRangeWithCacheKeyFactoryNullDataSpecCacheKey() throws Exception {
// Bounded request but the content length is unknown. This forces all data to be cached but not
// the length.
assertCacheAndRead(boundedDataSpec, /* unknownLength= */ true, cacheKeyFactory);
......@@ -210,13 +210,13 @@ public final class CacheDataSourceTest {
}
@Test
public void testCacheAndReadUnboundedRequestWithCacheKeyFactoryOverridingDataSpecCacheKey()
public void cacheAndReadUnboundedRequestWithCacheKeyFactoryOverridingDataSpecCacheKey()
throws Exception {
assertCacheAndRead(unboundedDataSpecWithKey, false, cacheKeyFactory);
}
@Test
public void testCacheAndReadUnknownLengthWithCacheKeyFactoryOverridingDataSpecCacheKey()
public void cacheAndReadUnknownLengthWithCacheKeyFactoryOverridingDataSpecCacheKey()
throws Exception {
assertCacheAndRead(boundedDataSpecWithKey, true, cacheKeyFactory);
}
......@@ -229,13 +229,12 @@ public final class CacheDataSourceTest {
}
@Test
public void testCacheAndReadWithCacheKeyFactoryOverridingDataSpecCacheKey() throws Exception {
public void cacheAndReadWithCacheKeyFactoryOverridingDataSpecCacheKey() throws Exception {
assertCacheAndRead(boundedDataSpecWithKey, /* unknownLength= */ false, cacheKeyFactory);
}
@Test
public void testUnsatisfiableRangeWithCacheKeyFactoryOverridingDataSpecCacheKey()
throws Exception {
public void unsatisfiableRangeWithCacheKeyFactoryOverridingDataSpecCacheKey() throws Exception {
// Bounded request but the content length is unknown. This forces all data to be cached but not
// the length.
assertCacheAndRead(boundedDataSpecWithKey, /* unknownLength= */ true, cacheKeyFactory);
......@@ -264,7 +263,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testContentLengthEdgeCases() throws Exception {
public void contentLengthEdgeCases() throws Exception {
DataSpec dataSpec = buildDataSpec(TEST_DATA.length - 2, 2);
// Read partial at EOS but don't cross it so length is unknown.
......@@ -291,7 +290,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testUnknownLengthContentReadInOneConnectionAndLengthIsResolved() throws Exception {
public void unknownLengthContentReadInOneConnectionAndLengthIsResolved() throws Exception {
FakeDataSource upstream = new FakeDataSource();
upstream
.getDataSet()
......@@ -310,7 +309,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testIgnoreCacheForUnsetLengthRequests() throws Exception {
public void ignoreCacheForUnsetLengthRequests() throws Exception {
FakeDataSource upstream = new FakeDataSource();
upstream.getDataSet().setData(testDataUri, TEST_DATA);
CacheDataSource cacheDataSource =
......@@ -325,14 +324,14 @@ public final class CacheDataSourceTest {
}
@Test
public void testReadOnlyCache() throws Exception {
public void readOnlyCache() throws Exception {
CacheDataSource cacheDataSource = createCacheDataSource(false, false, 0, null);
assertReadDataContentLength(cacheDataSource, boundedDataSpec, false, false);
assertCacheEmpty(cache);
}
@Test
public void testSwitchToCacheSourceWithReadOnlyCacheDataSource() throws Exception {
public void switchToCacheSourceWithReadOnlyCacheDataSource() throws Exception {
// Create a fake data source with a 1 MB default data.
FakeDataSource upstream = new FakeDataSource();
FakeData fakeData = upstream.getDataSet().newDefaultData().appendReadData(1024 * 1024 - 1);
......@@ -372,7 +371,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testSwitchToCacheSourceWithNonBlockingCacheDataSource() throws Exception {
public void switchToCacheSourceWithNonBlockingCacheDataSource() throws Exception {
// Create a fake data source with a 1 MB default data.
FakeDataSource upstream = new FakeDataSource();
FakeData fakeData = upstream.getDataSet().newDefaultData().appendReadData(1024 * 1024 - 1);
......@@ -421,7 +420,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testDeleteCachedWhileReadingFromUpstreamWithReadOnlyCacheDataSourceDoesNotCrash()
public void deleteCachedWhileReadingFromUpstreamWithReadOnlyCacheDataSourceDoesNotCrash()
throws Exception {
// Create a fake data source with a 1 KB default data.
FakeDataSource upstream = new FakeDataSource();
......@@ -457,7 +456,7 @@ public final class CacheDataSourceTest {
}
@Test
public void testDeleteCachedWhileReadingFromUpstreamWithBlockingCacheDataSourceDoesNotBlock()
public void deleteCachedWhileReadingFromUpstreamWithBlockingCacheDataSourceDoesNotBlock()
throws Exception {
// Create a fake data source with a 1 KB default data.
FakeDataSource upstream = new FakeDataSource();
......
......@@ -105,7 +105,7 @@ public final class CacheUtilTest {
}
@Test
public void testGenerateKey() {
public void generateKey() {
assertThat(CacheUtil.generateKey(Uri.EMPTY)).isNotNull();
Uri testUri = Uri.parse("test");
......@@ -120,7 +120,7 @@ public final class CacheUtilTest {
}
@Test
public void testDefaultCacheKeyFactory_buildCacheKey() {
public void defaultCacheKeyFactory_buildCacheKey() {
Uri testUri = Uri.parse("test");
String key = "key";
// If DataSpec.key is present, returns it.
......@@ -136,7 +136,7 @@ public final class CacheUtilTest {
}
@Test
public void testGetCachedNoData() {
public void getCachedNoData() {
Pair<Long, Long> contentLengthAndBytesCached =
CacheUtil.getCached(
new DataSpec(Uri.parse("test")), mockCache, /* cacheKeyFactory= */ null);
......@@ -146,7 +146,7 @@ public final class CacheUtilTest {
}
@Test
public void testGetCachedDataUnknownLength() {
public void getCachedDataUnknownLength() {
// Mock there is 100 bytes cached at the beginning
mockCache.spansAndGaps = new int[] {100};
Pair<Long, Long> contentLengthAndBytesCached =
......@@ -158,7 +158,7 @@ public final class CacheUtilTest {
}
@Test
public void testGetCachedNoDataKnownLength() {
public void getCachedNoDataKnownLength() {
mockCache.contentLength = 1000;
Pair<Long, Long> contentLengthAndBytesCached =
CacheUtil.getCached(
......@@ -169,7 +169,7 @@ public final class CacheUtilTest {
}
@Test
public void testGetCached() {
public void getCached() {
mockCache.contentLength = 1000;
mockCache.spansAndGaps = new int[] {100, 100, 200};
Pair<Long, Long> contentLengthAndBytesCached =
......@@ -181,7 +181,7 @@ public final class CacheUtilTest {
}
@Test
public void testGetCachedFromNonZeroPosition() {
public void getCachedFromNonZeroPosition() {
mockCache.contentLength = 1000;
mockCache.spansAndGaps = new int[] {100, 100, 200};
Pair<Long, Long> contentLengthAndBytesCached =
......@@ -195,7 +195,7 @@ public final class CacheUtilTest {
}
@Test
public void testCache() throws Exception {
public void cache() throws Exception {
FakeDataSet fakeDataSet = new FakeDataSet().setRandomData("test_data", 100);
FakeDataSource dataSource = new FakeDataSource(fakeDataSet);
......@@ -213,7 +213,7 @@ public final class CacheUtilTest {
}
@Test
public void testCacheSetOffsetAndLength() throws Exception {
public void cacheSetOffsetAndLength() throws Exception {
FakeDataSet fakeDataSet = new FakeDataSet().setRandomData("test_data", 100);
FakeDataSource dataSource = new FakeDataSource(fakeDataSet);
......@@ -239,7 +239,7 @@ public final class CacheUtilTest {
}
@Test
public void testCacheUnknownLength() throws Exception {
public void cacheUnknownLength() throws Exception {
FakeDataSet fakeDataSet = new FakeDataSet().newData("test_data")
.setSimulateUnknownLength(true)
.appendReadData(TestUtil.buildTestData(100)).endData();
......@@ -255,7 +255,7 @@ public final class CacheUtilTest {
}
@Test
public void testCacheUnknownLengthPartialCaching() throws Exception {
public void cacheUnknownLengthPartialCaching() throws Exception {
FakeDataSet fakeDataSet = new FakeDataSet().newData("test_data")
.setSimulateUnknownLength(true)
.appendReadData(TestUtil.buildTestData(100)).endData();
......@@ -283,7 +283,7 @@ public final class CacheUtilTest {
}
@Test
public void testCacheLengthExceedsActualDataLength() throws Exception {
public void cacheLengthExceedsActualDataLength() throws Exception {
FakeDataSet fakeDataSet = new FakeDataSet().setRandomData("test_data", 100);
FakeDataSource dataSource = new FakeDataSource(fakeDataSet);
......@@ -298,7 +298,7 @@ public final class CacheUtilTest {
}
@Test
public void testCacheThrowEOFException() throws Exception {
public void cacheThrowEOFException() throws Exception {
FakeDataSet fakeDataSet = new FakeDataSet().setRandomData("test_data", 100);
FakeDataSource dataSource = new FakeDataSource(fakeDataSet);
......@@ -324,7 +324,7 @@ public final class CacheUtilTest {
}
@Test
public void testCachePolling() throws Exception {
public void cachePolling() throws Exception {
final CachingCounters counters = new CachingCounters();
FakeDataSet fakeDataSet =
new FakeDataSet()
......@@ -350,7 +350,7 @@ public final class CacheUtilTest {
}
@Test
public void testRemove() throws Exception {
public void remove() throws Exception {
FakeDataSet fakeDataSet = new FakeDataSet().setRandomData("test_data", 100);
FakeDataSource dataSource = new FakeDataSource(fakeDataSet);
......
......@@ -89,7 +89,7 @@ public class CachedContentIndexTest {
}
@Test
public void testAddGetRemove() throws Exception {
public void addGetRemove() throws Exception {
final String key1 = "key1";
final String key2 = "key2";
final String key3 = "key3";
......@@ -144,12 +144,12 @@ public class CachedContentIndexTest {
}
@Test
public void testLegacyStoreAndLoad() throws Exception {
public void legacyStoreAndLoad() throws Exception {
assertStoredAndLoadedEqual(newLegacyInstance(), newLegacyInstance());
}
@Test
public void testLegacyLoadV1() throws Exception {
public void legacyLoadV1() throws Exception {
CachedContentIndex index = newLegacyInstance();
FileOutputStream fos =
......@@ -170,7 +170,7 @@ public class CachedContentIndexTest {
}
@Test
public void testLegacyLoadV2() throws Exception {
public void legacyLoadV2() throws Exception {
CachedContentIndex index = newLegacyInstance();
FileOutputStream fos =
......@@ -192,7 +192,7 @@ public class CachedContentIndexTest {
}
@Test
public void testAssignIdForKeyAndGetKeyForId() {
public void assignIdForKeyAndGetKeyForId() {
CachedContentIndex index = newInstance();
final String key1 = "key1";
final String key2 = "key2";
......@@ -206,7 +206,7 @@ public class CachedContentIndexTest {
}
@Test
public void testGetNewId() {
public void getNewId() {
SparseArray<String> idToKey = new SparseArray<>();
assertThat(CachedContentIndex.getNewId(idToKey)).isEqualTo(0);
idToKey.put(10, "");
......@@ -218,7 +218,7 @@ public class CachedContentIndexTest {
}
@Test
public void testLegacyEncryption() throws Exception {
public void legacyEncryption() throws Exception {
byte[] key = Util.getUtf8Bytes("Bar12345Bar12345"); // 128 bit key
byte[] key2 = Util.getUtf8Bytes("Foo12345Foo12345"); // 128 bit key
......@@ -270,7 +270,7 @@ public class CachedContentIndexTest {
}
@Test
public void testRemoveEmptyNotLockedCachedContent() {
public void removeEmptyNotLockedCachedContent() {
CachedContentIndex index = newInstance();
CachedContent cachedContent = index.getOrAdd("key1");
......@@ -280,7 +280,7 @@ public class CachedContentIndexTest {
}
@Test
public void testCantRemoveNotEmptyCachedContent() throws Exception {
public void cantRemoveNotEmptyCachedContent() throws Exception {
CachedContentIndex index = newInstance();
CachedContent cachedContent = index.getOrAdd("key1");
......@@ -298,7 +298,7 @@ public class CachedContentIndexTest {
}
@Test
public void testCantRemoveLockedCachedContent() {
public void cantRemoveLockedCachedContent() {
CachedContentIndex index = newInstance();
CachedContent cachedContent = index.getOrAdd("key1");
cachedContent.setLocked(true);
......
......@@ -75,13 +75,13 @@ public final class CachedRegionTrackerTest {
}
@Test
public void testGetRegion_noSpansInCache() {
public void getRegion_noSpansInCache() {
assertThat(tracker.getRegionEndTimeMs(100)).isEqualTo(CachedRegionTracker.NOT_CACHED);
assertThat(tracker.getRegionEndTimeMs(150)).isEqualTo(CachedRegionTracker.NOT_CACHED);
}
@Test
public void testGetRegion_fullyCached() throws Exception {
public void getRegion_fullyCached() throws Exception {
tracker.onSpanAdded(cache, newCacheSpan(100, 100));
assertThat(tracker.getRegionEndTimeMs(101)).isEqualTo(CachedRegionTracker.CACHED_TO_END);
......@@ -89,7 +89,7 @@ public final class CachedRegionTrackerTest {
}
@Test
public void testGetRegion_partiallyCached() throws Exception {
public void getRegion_partiallyCached() throws Exception {
tracker.onSpanAdded(cache, newCacheSpan(100, 40));
assertThat(tracker.getRegionEndTimeMs(101)).isEqualTo(200);
......@@ -97,7 +97,7 @@ public final class CachedRegionTrackerTest {
}
@Test
public void testGetRegion_multipleSpanAddsJoinedCorrectly() throws Exception {
public void getRegion_multipleSpanAddsJoinedCorrectly() throws Exception {
tracker.onSpanAdded(cache, newCacheSpan(100, 20));
tracker.onSpanAdded(cache, newCacheSpan(120, 20));
......@@ -106,7 +106,7 @@ public final class CachedRegionTrackerTest {
}
@Test
public void testGetRegion_fullyCachedThenPartiallyRemoved() throws Exception {
public void getRegion_fullyCachedThenPartiallyRemoved() throws Exception {
// Start with the full stream in cache.
tracker.onSpanAdded(cache, newCacheSpan(100, 100));
......@@ -120,7 +120,7 @@ public final class CachedRegionTrackerTest {
}
@Test
public void testGetRegion_subchunkEstimation() throws Exception {
public void getRegion_subchunkEstimation() throws Exception {
tracker.onSpanAdded(cache, newCacheSpan(100, 10));
assertThat(tracker.getRegionEndTimeMs(101)).isEqualTo(50);
......
......@@ -34,35 +34,35 @@ public class DefaultContentMetadataTest {
}
@Test
public void testContainsReturnsFalseWhenEmpty() throws Exception {
public void containsReturnsFalseWhenEmpty() throws Exception {
assertThat(contentMetadata.contains("test metadata")).isFalse();
}
@Test
public void testContainsReturnsTrueForInitialValue() throws Exception {
public void containsReturnsTrueForInitialValue() throws Exception {
contentMetadata = createContentMetadata("metadata name", "value");
assertThat(contentMetadata.contains("metadata name")).isTrue();
}
@Test
public void testGetReturnsDefaultValueWhenValueIsNotAvailable() throws Exception {
public void getReturnsDefaultValueWhenValueIsNotAvailable() throws Exception {
assertThat(contentMetadata.get("metadata name", "default value")).isEqualTo("default value");
}
@Test
public void testGetReturnsInitialValue() throws Exception {
public void getReturnsInitialValue() throws Exception {
contentMetadata = createContentMetadata("metadata name", "value");
assertThat(contentMetadata.get("metadata name", "default value")).isEqualTo("value");
}
@Test
public void testEmptyMutationDoesNotFail() throws Exception {
public void emptyMutationDoesNotFail() throws Exception {
ContentMetadataMutations mutations = new ContentMetadataMutations();
DefaultContentMetadata.EMPTY.copyWithMutationsApplied(mutations);
}
@Test
public void testAddNewMetadata() throws Exception {
public void addNewMetadata() throws Exception {
ContentMetadataMutations mutations = new ContentMetadataMutations();
mutations.set("metadata name", "value");
contentMetadata = contentMetadata.copyWithMutationsApplied(mutations);
......@@ -70,7 +70,7 @@ public class DefaultContentMetadataTest {
}
@Test
public void testAddNewIntMetadata() throws Exception {
public void addNewIntMetadata() throws Exception {
ContentMetadataMutations mutations = new ContentMetadataMutations();
mutations.set("metadata name", 5);
contentMetadata = contentMetadata.copyWithMutationsApplied(mutations);
......@@ -78,7 +78,7 @@ public class DefaultContentMetadataTest {
}
@Test
public void testAddNewByteArrayMetadata() throws Exception {
public void addNewByteArrayMetadata() throws Exception {
ContentMetadataMutations mutations = new ContentMetadataMutations();
byte[] value = {1, 2, 3};
mutations.set("metadata name", value);
......@@ -87,14 +87,14 @@ public class DefaultContentMetadataTest {
}
@Test
public void testNewMetadataNotWrittenBeforeCommitted() throws Exception {
public void newMetadataNotWrittenBeforeCommitted() throws Exception {
ContentMetadataMutations mutations = new ContentMetadataMutations();
mutations.set("metadata name", "value");
assertThat(contentMetadata.get("metadata name", "default value")).isEqualTo("default value");
}
@Test
public void testEditMetadata() throws Exception {
public void editMetadata() throws Exception {
contentMetadata = createContentMetadata("metadata name", "value");
ContentMetadataMutations mutations = new ContentMetadataMutations();
mutations.set("metadata name", "edited value");
......@@ -103,7 +103,7 @@ public class DefaultContentMetadataTest {
}
@Test
public void testRemoveMetadata() throws Exception {
public void removeMetadata() throws Exception {
contentMetadata = createContentMetadata("metadata name", "value");
ContentMetadataMutations mutations = new ContentMetadataMutations();
mutations.remove("metadata name");
......@@ -112,7 +112,7 @@ public class DefaultContentMetadataTest {
}
@Test
public void testAddAndRemoveMetadata() throws Exception {
public void addAndRemoveMetadata() throws Exception {
ContentMetadataMutations mutations = new ContentMetadataMutations();
mutations.set("metadata name", "value");
mutations.remove("metadata name");
......@@ -121,7 +121,7 @@ public class DefaultContentMetadataTest {
}
@Test
public void testRemoveAndAddMetadata() throws Exception {
public void removeAndAddMetadata() throws Exception {
ContentMetadataMutations mutations = new ContentMetadataMutations();
mutations.remove("metadata name");
mutations.set("metadata name", "value");
......@@ -130,14 +130,14 @@ public class DefaultContentMetadataTest {
}
@Test
public void testEqualsStringValues() throws Exception {
public void equalsStringValues() throws Exception {
DefaultContentMetadata metadata1 = createContentMetadata("metadata1", "value");
DefaultContentMetadata metadata2 = createContentMetadata("metadata1", "value");
assertThat(metadata1).isEqualTo(metadata2);
}
@Test
public void testEquals() throws Exception {
public void equals() throws Exception {
DefaultContentMetadata metadata1 =
createContentMetadata(
"metadata1", "value", "metadata2", 12345, "metadata3", new byte[] {1, 2, 3});
......@@ -149,7 +149,7 @@ public class DefaultContentMetadataTest {
}
@Test
public void testNotEquals() throws Exception {
public void notEquals() throws Exception {
DefaultContentMetadata metadata1 = createContentMetadata("metadata1", new byte[] {1, 2, 3});
DefaultContentMetadata metadata2 = createContentMetadata("metadata1", new byte[] {3, 2, 1});
assertThat(metadata1).isNotEqualTo(metadata2);
......
......@@ -32,7 +32,7 @@ public class LeastRecentlyUsedCacheEvictorTest {
}
@Test
public void testContentBiggerThanMaxSizeDoesNotThrowException() throws Exception {
public void contentBiggerThanMaxSizeDoesNotThrowException() throws Exception {
int maxBytes = 100;
LeastRecentlyUsedCacheEvictor evictor = new LeastRecentlyUsedCacheEvictor(maxBytes);
evictor.onCacheInitialized();
......
......@@ -53,7 +53,7 @@ public class SimpleCacheSpanTest {
}
@Test
public void testCacheFile() throws Exception {
public void cacheFile() throws Exception {
assertCacheSpan("key1", 0, 0);
assertCacheSpan("key2", 1, 2);
assertCacheSpan("<>:\"/\\|?*%", 1, 2);
......@@ -72,7 +72,7 @@ public class SimpleCacheSpanTest {
}
@Test
public void testUpgradeFileName() throws Exception {
public void upgradeFileName() throws Exception {
String key = "abc%def";
int id = index.assignIdForKey(key);
File v3file = createTestFile(cacheDir, id + ".0.1.v3.exo");
......
......@@ -63,7 +63,7 @@ public class SimpleCacheTest {
}
@Test
public void testCacheInitialization() {
public void cacheInitialization() {
SimpleCache cache = getSimpleCache();
// Cache initialization should have created a non-negative UID.
......@@ -79,7 +79,7 @@ public class SimpleCacheTest {
}
@Test
public void testCacheInitializationError() throws IOException {
public void cacheInitializationError() throws IOException {
// Creating a file where the cache should be will cause an error during initialization.
assertThat(cacheDir.createNewFile()).isTrue();
......@@ -90,7 +90,7 @@ public class SimpleCacheTest {
}
@Test
public void testCommittingOneFile() throws Exception {
public void committingOneFile() throws Exception {
SimpleCache simpleCache = getSimpleCache();
CacheSpan cacheSpan1 = simpleCache.startReadWrite(KEY_1, 0);
......@@ -122,7 +122,7 @@ public class SimpleCacheTest {
}
@Test
public void testReadCacheWithoutReleasingWriteCacheSpan() throws Exception {
public void readCacheWithoutReleasingWriteCacheSpan() throws Exception {
SimpleCache simpleCache = getSimpleCache();
CacheSpan cacheSpan1 = simpleCache.startReadWrite(KEY_1, 0);
......@@ -133,7 +133,7 @@ public class SimpleCacheTest {
}
@Test
public void testSetGetContentMetadata() throws Exception {
public void setGetContentMetadata() throws Exception {
SimpleCache simpleCache = getSimpleCache();
assertThat(ContentMetadata.getContentLength(simpleCache.getContentMetadata(KEY_1)))
......@@ -173,7 +173,7 @@ public class SimpleCacheTest {
}
@Test
public void testReloadCache() throws Exception {
public void reloadCache() throws Exception {
SimpleCache simpleCache = getSimpleCache();
// write data
......@@ -191,7 +191,7 @@ public class SimpleCacheTest {
}
@Test
public void testReloadCacheWithoutRelease() throws Exception {
public void reloadCacheWithoutRelease() throws Exception {
SimpleCache simpleCache = getSimpleCache();
// Write data for KEY_1.
......@@ -226,7 +226,7 @@ public class SimpleCacheTest {
}
@Test
public void testEncryptedIndex() throws Exception {
public void encryptedIndex() throws Exception {
byte[] key = Util.getUtf8Bytes("Bar12345Bar12345"); // 128 bit key
SimpleCache simpleCache = getEncryptedSimpleCache(key);
......@@ -245,7 +245,7 @@ public class SimpleCacheTest {
}
@Test
public void testEncryptedIndexWrongKey() throws Exception {
public void encryptedIndexWrongKey() throws Exception {
byte[] key = Util.getUtf8Bytes("Bar12345Bar12345"); // 128 bit key
SimpleCache simpleCache = getEncryptedSimpleCache(key);
......@@ -265,7 +265,7 @@ public class SimpleCacheTest {
}
@Test
public void testEncryptedIndexLostKey() throws Exception {
public void encryptedIndexLostKey() throws Exception {
byte[] key = Util.getUtf8Bytes("Bar12345Bar12345"); // 128 bit key
SimpleCache simpleCache = getEncryptedSimpleCache(key);
......@@ -284,7 +284,7 @@ public class SimpleCacheTest {
}
@Test
public void testGetCachedLength() throws Exception {
public void getCachedLength() throws Exception {
SimpleCache simpleCache = getSimpleCache();
CacheSpan cacheSpan = simpleCache.startReadWrite(KEY_1, 0);
......@@ -320,7 +320,7 @@ public class SimpleCacheTest {
/* Tests https://github.com/google/ExoPlayer/issues/3260 case. */
@Test
public void testExceptionDuringEvictionByLeastRecentlyUsedCacheEvictorNotHang() throws Exception {
public void exceptionDuringEvictionByLeastRecentlyUsedCacheEvictorNotHang() throws Exception {
CachedContentIndex contentIndex =
Mockito.spy(new CachedContentIndex(TestUtil.getInMemoryDatabaseProvider()));
SimpleCache simpleCache =
......@@ -357,7 +357,7 @@ public class SimpleCacheTest {
}
@Test
public void testUsingReleasedSimpleCacheThrowsException() throws Exception {
public void usingReleasedSimpleCacheThrowsException() throws Exception {
SimpleCache simpleCache = new SimpleCache(cacheDir, new NoOpCacheEvictor());
simpleCache.release();
......@@ -370,7 +370,7 @@ public class SimpleCacheTest {
}
@Test
public void testMultipleSimpleCacheWithSameCacheDirThrowsException() throws Exception {
public void multipleSimpleCacheWithSameCacheDirThrowsException() throws Exception {
new SimpleCache(cacheDir, new NoOpCacheEvictor());
try {
......@@ -382,7 +382,7 @@ public class SimpleCacheTest {
}
@Test
public void testMultipleSimpleCacheWithSameCacheDirDoesNotThrowsExceptionAfterRelease()
public void multipleSimpleCacheWithSameCacheDirDoesNotThrowsExceptionAfterRelease()
throws Exception {
SimpleCache simpleCache = new SimpleCache(cacheDir, new NoOpCacheEvictor());
simpleCache.release();
......
......@@ -76,7 +76,7 @@ public class AesFlushingCipherTest {
// Test a single encrypt and decrypt call.
@Test
public void testSingle() {
public void single() {
byte[] reference = TestUtil.buildTestData(DATA_LENGTH);
byte[] data = reference.clone();
......@@ -92,7 +92,7 @@ public class AesFlushingCipherTest {
// Test several encrypt and decrypt calls, each aligned on a 16 byte block size.
@Test
public void testAligned() {
public void aligned() {
byte[] reference = TestUtil.buildTestData(DATA_LENGTH);
byte[] data = reference.clone();
Random random = new Random(RANDOM_SEED);
......@@ -125,7 +125,7 @@ public class AesFlushingCipherTest {
// Test several encrypt and decrypt calls, not aligned on block boundary.
@Test
public void testUnAligned() {
public void unAligned() {
byte[] reference = TestUtil.buildTestData(DATA_LENGTH);
byte[] data = reference.clone();
Random random = new Random(RANDOM_SEED);
......@@ -157,7 +157,7 @@ public class AesFlushingCipherTest {
// Test decryption starting from the middle of an encrypted block.
@Test
public void testMidJoin() {
public void midJoin() {
byte[] reference = TestUtil.buildTestData(DATA_LENGTH);
byte[] data = reference.clone();
Random random = new Random(RANDOM_SEED);
......
......@@ -50,14 +50,14 @@ public final class AtomicFileTest {
}
@Test
public void testDelete() throws Exception {
public void delete() throws Exception {
assertThat(file.createNewFile()).isTrue();
atomicFile.delete();
assertThat(file.exists()).isFalse();
}
@Test
public void testWriteRead() throws Exception {
public void writeRead() throws Exception {
OutputStream output = atomicFile.startWrite();
output.write(5);
atomicFile.endWrite(output);
......
......@@ -35,29 +35,29 @@ public final class ColorParserTest {
// Negative tests.
@Test(expected = IllegalArgumentException.class)
public void testParseUnknownColor() {
public void parseUnknownColor() {
ColorParser.parseTtmlColor("colorOfAnElectron");
}
@Test(expected = IllegalArgumentException.class)
public void testParseNull() {
public void parseNull() {
ColorParser.parseTtmlColor(null);
}
@Test(expected = IllegalArgumentException.class)
public void testParseEmpty() {
public void parseEmpty() {
ColorParser.parseTtmlColor("");
}
@Test(expected = IllegalArgumentException.class)
public void testRgbColorParsingRgbValuesNegative() {
public void rgbColorParsingRgbValuesNegative() {
ColorParser.parseTtmlColor("rgb(-4, 55, 209)");
}
// Positive tests.
@Test
public void testHexCodeParsing() {
public void hexCodeParsing() {
assertThat(parseTtmlColor("#FFFFFF")).isEqualTo(WHITE);
assertThat(parseTtmlColor("#FFFFFFFF")).isEqualTo(WHITE);
assertThat(parseTtmlColor("#123456")).isEqualTo(parseColor("#FF123456"));
......@@ -67,14 +67,14 @@ public final class ColorParserTest {
}
@Test
public void testRgbColorParsing() {
public void rgbColorParsing() {
assertThat(parseTtmlColor("rgb(255,255,255)")).isEqualTo(WHITE);
// Spaces are ignored.
assertThat(parseTtmlColor(" rgb ( 255, 255, 255)")).isEqualTo(WHITE);
}
@Test
public void testRgbColorParsingRgbValuesOutOfBounds() {
public void rgbColorParsingRgbValuesOutOfBounds() {
int outOfBounds = ColorParser.parseTtmlColor("rgb(999, 999, 999)");
int color = Color.rgb(999, 999, 999);
// Behave like the framework does.
......@@ -82,7 +82,7 @@ public final class ColorParserTest {
}
@Test
public void testRgbaColorParsing() {
public void rgbaColorParsing() {
assertThat(parseTtmlColor("rgba(255,255,255,255)")).isEqualTo(WHITE);
assertThat(parseTtmlColor("rgba(255,255,255,255)"))
.isEqualTo(argb(255, 255, 255, 255));
......
......@@ -30,7 +30,7 @@ public final class ReusableBufferedOutputStreamTest {
private static final byte[] TEST_DATA_2 = Util.getUtf8Bytes("2 test data");
@Test
public void testReset() throws Exception {
public void reset() throws Exception {
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(1000);
ReusableBufferedOutputStream outputStream = new ReusableBufferedOutputStream(
byteArrayOutputStream1, 1000);
......
......@@ -34,7 +34,7 @@ public class TimedValueQueueTest {
}
@Test
public void testAddAndPollValues() {
public void addAndPollValues() {
queue.add(0, "a");
queue.add(1, "b");
queue.add(2, "c");
......@@ -44,7 +44,7 @@ public class TimedValueQueueTest {
}
@Test
public void testBufferCapacityIncreasesAutomatically() {
public void bufferCapacityIncreasesAutomatically() {
queue = new TimedValueQueue<>(1);
for (int i = 0; i < 20; i++) {
queue.add(i, "" + i);
......@@ -56,7 +56,7 @@ public class TimedValueQueueTest {
}
@Test
public void testTimeDiscontinuityClearsValues() {
public void timeDiscontinuityClearsValues() {
queue.add(1, "b");
queue.add(2, "c");
queue.add(0, "a");
......@@ -65,7 +65,7 @@ public class TimedValueQueueTest {
}
@Test
public void testTimeDiscontinuityOnFullBufferClearsValues() {
public void timeDiscontinuityOnFullBufferClearsValues() {
queue = new TimedValueQueue<>(2);
queue.add(1, "b");
queue.add(3, "c");
......@@ -75,7 +75,7 @@ public class TimedValueQueueTest {
}
@Test
public void testPollReturnsClosestValue() {
public void pollReturnsClosestValue() {
queue.add(0, "a");
queue.add(3, "b");
assertThat(queue.poll(2)).isEqualTo("b");
......@@ -83,7 +83,7 @@ public class TimedValueQueueTest {
}
@Test
public void testPollRemovesPreviousValues() {
public void pollRemovesPreviousValues() {
queue.add(0, "a");
queue.add(1, "b");
queue.add(2, "c");
......@@ -92,7 +92,7 @@ public class TimedValueQueueTest {
}
@Test
public void testPollFloorReturnsClosestPreviousValue() {
public void pollFloorReturnsClosestPreviousValue() {
queue.add(0, "a");
queue.add(3, "b");
assertThat(queue.pollFloor(2)).isEqualTo("a");
......@@ -102,7 +102,7 @@ public class TimedValueQueueTest {
}
@Test
public void testPollFloorRemovesPreviousValues() {
public void pollFloorRemovesPreviousValues() {
queue.add(0, "a");
queue.add(1, "b");
queue.add(2, "c");
......
......@@ -30,11 +30,11 @@ public final class UriUtilTest {
/**
* Tests normal usage of {@link UriUtil#resolve(String, String)}.
* <p>
* The test cases are taken from RFC-3986 5.4.1.
*
* <p>The test cases are taken from RFC-3986 5.4.1.
*/
@Test
public void testResolveNormal() {
public void resolveNormal() {
String base = "http://a/b/c/d;p?q";
assertThat(resolve(base, "g:h")).isEqualTo("g:h");
......@@ -63,11 +63,11 @@ public final class UriUtilTest {
/**
* Tests abnormal usage of {@link UriUtil#resolve(String, String)}.
* <p>
* The test cases are taken from RFC-3986 5.4.2.
*
* <p>The test cases are taken from RFC-3986 5.4.2.
*/
@Test
public void testResolveAbnormal() {
public void resolveAbnormal() {
String base = "http://a/b/c/d;p?q";
assertThat(resolve(base, "../../../g")).isEqualTo("http://a/g");
......@@ -95,11 +95,9 @@ public final class UriUtilTest {
assertThat(resolve(base, "http:g")).isEqualTo("http:g");
}
/**
* Tests additional abnormal usage of {@link UriUtil#resolve(String, String)}.
*/
/** Tests additional abnormal usage of {@link UriUtil#resolve(String, String)}. */
@Test
public void testResolveAbnormalAdditional() {
public void resolveAbnormalAdditional() {
assertThat(resolve("http://a/b", "c:d/../e")).isEqualTo("c:e");
assertThat(resolve("a:b", "../c")).isEqualTo("a:c");
}
......
......@@ -37,19 +37,19 @@ public class FrameRotationQueueTest {
}
@Test
public void testGetRotationMatrixReturnsNull_whenEmpty() throws Exception {
public void getRotationMatrixReturnsNull_whenEmpty() throws Exception {
assertThat(frameRotationQueue.pollRotationMatrix(rotationMatrix, 0)).isFalse();
}
@Test
public void testGetRotationMatrixReturnsNotNull_whenNotEmpty() throws Exception {
public void getRotationMatrixReturnsNotNull_whenNotEmpty() throws Exception {
frameRotationQueue.setRotation(0, new float[] {1, 2, 3});
assertThat(frameRotationQueue.pollRotationMatrix(rotationMatrix, 0)).isTrue();
assertThat(rotationMatrix).hasLength(16);
}
@Test
public void testConvertsAngleAxisToRotationMatrix() throws Exception {
public void convertsAngleAxisToRotationMatrix() throws Exception {
doTestAngleAxisToRotationMatrix(/* angleRadian= */ 0, /* x= */ 1, /* y= */ 0, /* z= */ 0);
frameRotationQueue.reset();
doTestAngleAxisToRotationMatrix(/* angleRadian= */ 1, /* x= */ 1, /* y= */ 0, /* z= */ 0);
......@@ -61,7 +61,7 @@ public class FrameRotationQueueTest {
}
@Test
public void testRecentering_justYaw() throws Exception {
public void recentering_justYaw() throws Exception {
float[] actualMatrix =
getRotationMatrixFromAngleAxis(
/* angleRadian= */ (float) Math.PI, /* x= */ 0, /* y= */ 1, /* z= */ 0);
......@@ -71,7 +71,7 @@ public class FrameRotationQueueTest {
}
@Test
public void testRecentering_yawAndPitch() throws Exception {
public void recentering_yawAndPitch() throws Exception {
float[] matrix =
getRotationMatrixFromAngleAxis(
/* angleRadian= */ (float) Math.PI, /* x= */ 1, /* y= */ 1, /* z= */ 0);
......@@ -80,7 +80,7 @@ public class FrameRotationQueueTest {
}
@Test
public void testRecentering_yawAndPitch2() throws Exception {
public void recentering_yawAndPitch2() throws Exception {
float[] matrix =
getRotationMatrixFromAngleAxis(
/* angleRadian= */ (float) Math.PI / 2, /* x= */ 1, /* y= */ 1, /* z= */ 0);
......@@ -90,7 +90,7 @@ public class FrameRotationQueueTest {
}
@Test
public void testRecentering_yawAndPitchAndRoll() throws Exception {
public void recentering_yawAndPitchAndRoll() throws Exception {
float[] matrix =
getRotationMatrixFromAngleAxis(
/* angleRadian= */ (float) Math.PI * 2 / 3, /* x= */ 1, /* y= */ 1, /* z= */ 1);
......
......@@ -44,12 +44,12 @@ public final class ProjectionDecoderTest {
private static final float[] LAST_UV = {1.0f, 1.0f};
@Test
public void testDecodeProj() {
public void decodeProj() {
testDecoding(PROJ_DATA);
}
@Test
public void testDecodeMshp() {
public void decodeMshp() {
testDecoding(Arrays.copyOfRange(PROJ_DATA, MSHP_OFFSET, PROJ_DATA.length));
}
......
......@@ -37,7 +37,7 @@ public class ProjectionTest {
private static final float HORIZONTAL_FOV_DEGREES = 360;
@Test
public void testSphericalMesh() throws Exception {
public void sphericalMesh() throws Exception {
// Only the first param is important in this test.
Projection projection =
Projection.createEquirectangular(
......@@ -61,7 +61,7 @@ public class ProjectionTest {
}
@Test
public void testArgumentValidation() {
public void argumentValidation() {
checkIllegalArgumentException(0, 1, 1, 1, 1);
checkIllegalArgumentException(1, 0, 1, 1, 1);
checkIllegalArgumentException(1, 1, 0, 1, 1);
......
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