mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix DefaultAnalyticsCollectorTest failure when run with JaCoCo
#minor-release PiperOrigin-RevId: 430189385
This commit is contained in:
parent
760fe78fbd
commit
00a5b33d24
@ -192,10 +192,18 @@ public final class DefaultAnalyticsCollectorTest {
|
|||||||
private EventWindowAndPeriodId window0Period1Seq0;
|
private EventWindowAndPeriodId window0Period1Seq0;
|
||||||
private EventWindowAndPeriodId window1Period0Seq1;
|
private EventWindowAndPeriodId window1Period0Seq1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify that {@link DefaultAnalyticsCollector} explicitly overrides all {@link Player.Listener}
|
||||||
|
* methods.
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void defaultAnalyticsCollector_overridesAllPlayerListenerMethods() throws Exception {
|
public void defaultAnalyticsCollector_overridesAllPlayerListenerMethods() throws Exception {
|
||||||
// Verify that AnalyticsCollector forwards all Player.Listener methods to AnalyticsListener.
|
|
||||||
for (Method method : Player.Listener.class.getDeclaredMethods()) {
|
for (Method method : Player.Listener.class.getDeclaredMethods()) {
|
||||||
|
if (method.isSynthetic()) {
|
||||||
|
// JaCoCo inserts synthetic methods. See "My code uses reflection. Why does it fail when I
|
||||||
|
// execute it with JaCoCo?": https://www.eclemma.org/jacoco/trunk/doc/faq.html
|
||||||
|
continue;
|
||||||
|
}
|
||||||
assertThat(
|
assertThat(
|
||||||
DefaultAnalyticsCollector.class
|
DefaultAnalyticsCollector.class
|
||||||
.getMethod(method.getName(), method.getParameterTypes())
|
.getMethod(method.getName(), method.getParameterTypes())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user