diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ef6eedbe1c2..1284e8febb2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -56,6 +56,8 @@ [#4249](https://github.com/google/ExoPlayer/issues/4249), [#4319](https://github.com/google/ExoPlayer/issues/4319), [#4337](https://github.com/google/ExoPlayer/issues/4337)). +* Publish `testutils` module to simplify unit testing with ExoPlayer + ([#6267](https://github.com/google/ExoPlayer/issues/6267)). ### 2.10.4 ### diff --git a/testutils/README.md b/testutils/README.md new file mode 100644 index 00000000000..d1ab6b1af50 --- /dev/null +++ b/testutils/README.md @@ -0,0 +1,10 @@ +# ExoPlayer test utils # + +Provides utility classes for ExoPlayer unit and instrumentation tests. + +## Links ## + +* [Javadoc][]: Classes matching `com.google.android.exoplayer2.testutil` + belong to this module. + +[Javadoc]: https://exoplayer.dev/doc/reference/index.html diff --git a/testutils/build.gradle b/testutils/build.gradle index b5e68187bed..5c6731c17b1 100644 --- a/testutils/build.gradle +++ b/testutils/build.gradle @@ -49,3 +49,14 @@ dependencies { testImplementation project(modulePrefix + 'testutils') testImplementation 'org.robolectric:robolectric:' + robolectricVersion } + +ext { + javadocTitle = 'Test utils' +} +apply from: '../javadoc_library.gradle' + +ext { + releaseArtifact = 'exoplayer-testutils' + releaseDescription = 'Test utils for ExoPlayer.' +} +apply from: '../publish.gradle' diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/ActionSchedule.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/ActionSchedule.java index 1b0a00624e9..e8abfdb73f0 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/ActionSchedule.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/ActionSchedule.java @@ -311,12 +311,12 @@ public Builder prepareSource(MediaSource mediaSource) { /** * Schedules a new source preparation action to be executed. - * @see com.google.android.exoplayer2.ExoPlayer#prepare(MediaSource, boolean, boolean). * + * @see com.google.android.exoplayer2.ExoPlayer#prepare(MediaSource, boolean, boolean) * @return The builder, for convenience. */ - public Builder prepareSource(MediaSource mediaSource, boolean resetPosition, - boolean resetState) { + public Builder prepareSource( + MediaSource mediaSource, boolean resetPosition, boolean resetState) { return apply(new PrepareSource(tag, mediaSource, resetPosition, resetState)); } diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java index bcb97be2871..6d141fe04ab 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java @@ -34,7 +34,7 @@ /** * Fake {@link MediaPeriod} that provides tracks from the given {@link TrackGroupArray}. Selecting a - * track will give the player a {@link ChunkSampleStream}. + * track will give the player a {@link ChunkSampleStream}. */ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod implements SequenceableLoader.Callback> {