Skip to content

Commit 00a5b33

Browse files
committed
Fix DefaultAnalyticsCollectorTest failure when run with JaCoCo
#minor-release PiperOrigin-RevId: 430189385
1 parent 760fe78 commit 00a5b33

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

libraries/exoplayer/src/test/java/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollectorTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,18 @@ public final class DefaultAnalyticsCollectorTest {
192192
private EventWindowAndPeriodId window0Period1Seq0;
193193
private EventWindowAndPeriodId window1Period0Seq1;
194194

195+
/**
196+
* Verify that {@link DefaultAnalyticsCollector} explicitly overrides all {@link Player.Listener}
197+
* methods.
198+
*/
195199
@Test
196200
public void defaultAnalyticsCollector_overridesAllPlayerListenerMethods() throws Exception {
197-
// Verify that AnalyticsCollector forwards all Player.Listener methods to AnalyticsListener.
198201
for (Method method : Player.Listener.class.getDeclaredMethods()) {
202+
if (method.isSynthetic()) {
203+
// JaCoCo inserts synthetic methods. See "My code uses reflection. Why does it fail when I
204+
// execute it with JaCoCo?": https://www.eclemma.org/jacoco/trunk/doc/faq.html
205+
continue;
206+
}
199207
assertThat(
200208
DefaultAnalyticsCollector.class
201209
.getMethod(method.getName(), method.getParameterTypes())

0 commit comments

Comments
 (0)