summaryrefslogtreecommitdiff
path: root/tests/unit/java/android/net/KeepalivePacketDataUtilTest.java
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2021-07-14 14:35:39 +0900
committerRemi NGUYEN VAN <reminv@google.com>2021-07-14 15:22:56 +0900
commited8efa75b416caca566140c734aee3e4627f2722 (patch)
tree29db3dfd26b7bf107578c8403feef3a86ff11fda /tests/unit/java/android/net/KeepalivePacketDataUtilTest.java
parent097d65b0f363f5bfab282425853b452209ded388 (diff)
Fix jarjar-related failures in coverage tests
Instead of jarjaring the whole com.android.internal.util package, apply the jarjar rules per-class. Jarjaring the whole package causes problems in tests, as for example ConnectivityServiceTest depends on Vpn that uses other internal utils as hidden API, and these should not be jarjared. Also avoid jarjaring INetdUnsolicitedEventListener which is used by NetdEventListenerServiceTest, and ensure KeepalivePacketDataUtilTest expects the right package name in toString. Generally the problems appear because ConnectivityCoverageTests also includes tests for classes that are not part of the connectivity module, and use hidden APIs that refer to classes that should not be jarjared. Some of the tests could be excluded from the coverage suite instead, but keeping them is helpful for future modularization efforts. Test: Build service-connectivity, dexdump classes and verify jarjared atest ConnectivityCoverageTests Change-Id: Id6b7e6833d49fa03d9442d7c1c3e4dc16fb48dfc
Diffstat (limited to 'tests/unit/java/android/net/KeepalivePacketDataUtilTest.java')
-rw-r--r--tests/unit/java/android/net/KeepalivePacketDataUtilTest.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/java/android/net/KeepalivePacketDataUtilTest.java b/tests/unit/java/android/net/KeepalivePacketDataUtilTest.java
index ed4f61d5fe..8498b6f65b 100644
--- a/tests/unit/java/android/net/KeepalivePacketDataUtilTest.java
+++ b/tests/unit/java/android/net/KeepalivePacketDataUtilTest.java
@@ -168,8 +168,8 @@ public final class KeepalivePacketDataUtilTest {
assertEquals(resultData.tos, tos);
assertEquals(resultData.ttl, ttl);
- final String expected = ""
- + "android.net.TcpKeepalivePacketDataParcelable{srcAddress: [10, 0, 0, 1],"
+ final String expected = TcpKeepalivePacketDataParcelable.class.getName()
+ + "{srcAddress: [10, 0, 0, 1],"
+ " srcPort: 1234, dstAddress: [10, 0, 0, 5], dstPort: 4321, seq: 286331153,"
+ " ack: 572662306, rcvWnd: 48000, rcvWndScale: 2, tos: 4, ttl: 64}";
assertEquals(expected, resultData.toString());