Merge "Migrating remaining core networking tests to Junit4"

This commit is contained in:
TreeHugger Robot
2017-10-13 05:26:31 +00:00
committed by Android (Google) Code Review
3 changed files with 72 additions and 25 deletions

View File

@@ -32,9 +32,14 @@ import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
import static android.text.format.DateUtils.SECOND_IN_MILLIS; import static android.text.format.DateUtils.SECOND_IN_MILLIS;
import static android.text.format.DateUtils.WEEK_IN_MILLIS; import static android.text.format.DateUtils.WEEK_IN_MILLIS;
import static android.text.format.DateUtils.YEAR_IN_MILLIS; import static android.text.format.DateUtils.YEAR_IN_MILLIS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import android.test.AndroidTestCase; import android.content.Context;
import android.test.suitebuilder.annotation.SmallTest; import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.Suppress; import android.test.suitebuilder.annotation.Suppress;
import android.util.Log; import android.util.Log;
@@ -46,25 +51,31 @@ import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.util.Random; import java.util.Random;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@SmallTest @SmallTest
public class NetworkStatsHistoryTest extends AndroidTestCase { public class NetworkStatsHistoryTest {
private static final String TAG = "NetworkStatsHistoryTest"; private static final String TAG = "NetworkStatsHistoryTest";
private static final long TEST_START = 1194220800000L; private static final long TEST_START = 1194220800000L;
private NetworkStatsHistory stats; private NetworkStatsHistory stats;
@Override @After
protected void tearDown() throws Exception { public void tearDown() throws Exception {
super.tearDown();
if (stats != null) { if (stats != null) {
assertConsistent(stats); assertConsistent(stats);
} }
} }
@Test
public void testReadOriginalVersion() throws Exception { public void testReadOriginalVersion() throws Exception {
final DataInputStream in = new DataInputStream( final Context context = InstrumentationRegistry.getContext();
getContext().getResources().openRawResource(R.raw.history_v1)); final DataInputStream in =
new DataInputStream(context.getResources().openRawResource(R.raw.history_v1));
NetworkStatsHistory.Entry entry = null; NetworkStatsHistory.Entry entry = null;
try { try {
@@ -88,6 +99,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
} }
} }
@Test
public void testRecordSingleBucket() throws Exception { public void testRecordSingleBucket() throws Exception {
final long BUCKET_SIZE = HOUR_IN_MILLIS; final long BUCKET_SIZE = HOUR_IN_MILLIS;
stats = new NetworkStatsHistory(BUCKET_SIZE); stats = new NetworkStatsHistory(BUCKET_SIZE);
@@ -100,6 +112,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertValues(stats, 0, SECOND_IN_MILLIS, 1024L, 10L, 2048L, 20L, 2L); assertValues(stats, 0, SECOND_IN_MILLIS, 1024L, 10L, 2048L, 20L, 2L);
} }
@Test
public void testRecordEqualBuckets() throws Exception { public void testRecordEqualBuckets() throws Exception {
final long bucketDuration = HOUR_IN_MILLIS; final long bucketDuration = HOUR_IN_MILLIS;
stats = new NetworkStatsHistory(bucketDuration); stats = new NetworkStatsHistory(bucketDuration);
@@ -114,6 +127,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertValues(stats, 1, HOUR_IN_MILLIS / 2, 512L, 5L, 64L, 1L, 1L); assertValues(stats, 1, HOUR_IN_MILLIS / 2, 512L, 5L, 64L, 1L, 1L);
} }
@Test
public void testRecordTouchingBuckets() throws Exception { public void testRecordTouchingBuckets() throws Exception {
final long BUCKET_SIZE = 15 * MINUTE_IN_MILLIS; final long BUCKET_SIZE = 15 * MINUTE_IN_MILLIS;
stats = new NetworkStatsHistory(BUCKET_SIZE); stats = new NetworkStatsHistory(BUCKET_SIZE);
@@ -134,6 +148,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertValues(stats, 2, 4 * MINUTE_IN_MILLIS, 200L, 400L, 1000L, 2000L, 20L); assertValues(stats, 2, 4 * MINUTE_IN_MILLIS, 200L, 400L, 1000L, 2000L, 20L);
} }
@Test
public void testRecordGapBuckets() throws Exception { public void testRecordGapBuckets() throws Exception {
final long BUCKET_SIZE = HOUR_IN_MILLIS; final long BUCKET_SIZE = HOUR_IN_MILLIS;
stats = new NetworkStatsHistory(BUCKET_SIZE); stats = new NetworkStatsHistory(BUCKET_SIZE);
@@ -165,6 +180,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertValues(stats, 3, SECOND_IN_MILLIS, 64L, 1L, 512L, 8L, 2L); assertValues(stats, 3, SECOND_IN_MILLIS, 64L, 1L, 512L, 8L, 2L);
} }
@Test
public void testRecordOverlapBuckets() throws Exception { public void testRecordOverlapBuckets() throws Exception {
final long BUCKET_SIZE = HOUR_IN_MILLIS; final long BUCKET_SIZE = HOUR_IN_MILLIS;
stats = new NetworkStatsHistory(BUCKET_SIZE); stats = new NetworkStatsHistory(BUCKET_SIZE);
@@ -182,6 +198,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertValues(stats, 1, (HOUR_IN_MILLIS / 2), 512L, 5L, 512L, 5L, 5L); assertValues(stats, 1, (HOUR_IN_MILLIS / 2), 512L, 5L, 512L, 5L, 5L);
} }
@Test
public void testRecordEntireGapIdentical() throws Exception { public void testRecordEntireGapIdentical() throws Exception {
// first, create two separate histories far apart // first, create two separate histories far apart
final NetworkStatsHistory stats1 = new NetworkStatsHistory(HOUR_IN_MILLIS); final NetworkStatsHistory stats1 = new NetworkStatsHistory(HOUR_IN_MILLIS);
@@ -206,6 +223,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertValues(stats, 3, 500L, 250L); assertValues(stats, 3, 500L, 250L);
} }
@Test
public void testRecordEntireOverlapVaryingBuckets() throws Exception { public void testRecordEntireOverlapVaryingBuckets() throws Exception {
// create history just over hour bucket boundary // create history just over hour bucket boundary
final NetworkStatsHistory stats1 = new NetworkStatsHistory(HOUR_IN_MILLIS); final NetworkStatsHistory stats1 = new NetworkStatsHistory(HOUR_IN_MILLIS);
@@ -247,6 +265,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertValues(stats, 3, 150L, 150L); assertValues(stats, 3, 150L, 150L);
} }
@Test
public void testRemove() throws Exception { public void testRemove() throws Exception {
stats = new NetworkStatsHistory(HOUR_IN_MILLIS); stats = new NetworkStatsHistory(HOUR_IN_MILLIS);
@@ -280,6 +299,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertEquals(0, stats.size()); assertEquals(0, stats.size());
} }
@Test
public void testTotalData() throws Exception { public void testTotalData() throws Exception {
final long BUCKET_SIZE = HOUR_IN_MILLIS; final long BUCKET_SIZE = HOUR_IN_MILLIS;
stats = new NetworkStatsHistory(BUCKET_SIZE); stats = new NetworkStatsHistory(BUCKET_SIZE);
@@ -304,7 +324,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
} }
@Suppress @Test
public void testFuzzing() throws Exception { public void testFuzzing() throws Exception {
try { try {
// fuzzing with random events, looking for crashes // fuzzing with random events, looking for crashes
@@ -341,6 +361,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
return value < 0 ? -value : value; return value < 0 ? -value : value;
} }
@Test
public void testIgnoreFields() throws Exception { public void testIgnoreFields() throws Exception {
final NetworkStatsHistory history = new NetworkStatsHistory( final NetworkStatsHistory history = new NetworkStatsHistory(
MINUTE_IN_MILLIS, 0, FIELD_RX_BYTES | FIELD_TX_BYTES); MINUTE_IN_MILLIS, 0, FIELD_RX_BYTES | FIELD_TX_BYTES);
@@ -353,6 +374,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertFullValues(history, UNKNOWN, 1026L, UNKNOWN, 2050L, UNKNOWN, UNKNOWN); assertFullValues(history, UNKNOWN, 1026L, UNKNOWN, 2050L, UNKNOWN, UNKNOWN);
} }
@Test
public void testIgnoreFieldsRecordIn() throws Exception { public void testIgnoreFieldsRecordIn() throws Exception {
final NetworkStatsHistory full = new NetworkStatsHistory(MINUTE_IN_MILLIS, 0, FIELD_ALL); final NetworkStatsHistory full = new NetworkStatsHistory(MINUTE_IN_MILLIS, 0, FIELD_ALL);
final NetworkStatsHistory partial = new NetworkStatsHistory( final NetworkStatsHistory partial = new NetworkStatsHistory(
@@ -365,6 +387,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertFullValues(partial, UNKNOWN, UNKNOWN, 10L, UNKNOWN, UNKNOWN, 4L); assertFullValues(partial, UNKNOWN, UNKNOWN, 10L, UNKNOWN, UNKNOWN, 4L);
} }
@Test
public void testIgnoreFieldsRecordOut() throws Exception { public void testIgnoreFieldsRecordOut() throws Exception {
final NetworkStatsHistory full = new NetworkStatsHistory(MINUTE_IN_MILLIS, 0, FIELD_ALL); final NetworkStatsHistory full = new NetworkStatsHistory(MINUTE_IN_MILLIS, 0, FIELD_ALL);
final NetworkStatsHistory partial = new NetworkStatsHistory( final NetworkStatsHistory partial = new NetworkStatsHistory(
@@ -377,6 +400,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertFullValues(full, MINUTE_IN_MILLIS, 0L, 10L, 0L, 0L, 4L); assertFullValues(full, MINUTE_IN_MILLIS, 0L, 10L, 0L, 0L, 4L);
} }
@Test
public void testSerialize() throws Exception { public void testSerialize() throws Exception {
final NetworkStatsHistory before = new NetworkStatsHistory(MINUTE_IN_MILLIS, 40, FIELD_ALL); final NetworkStatsHistory before = new NetworkStatsHistory(MINUTE_IN_MILLIS, 40, FIELD_ALL);
before.recordData(0, 4 * MINUTE_IN_MILLIS, before.recordData(0, 4 * MINUTE_IN_MILLIS,
@@ -396,6 +420,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertFullValues(after, 5 * MINUTE_IN_MILLIS, 1034L, 30L, 2078L, 60L, 54L); assertFullValues(after, 5 * MINUTE_IN_MILLIS, 1034L, 30L, 2078L, 60L, 54L);
} }
@Test
public void testVarLong() throws Exception { public void testVarLong() throws Exception {
assertEquals(0L, performVarLong(0L)); assertEquals(0L, performVarLong(0L));
assertEquals(-1L, performVarLong(-1L)); assertEquals(-1L, performVarLong(-1L));
@@ -409,6 +434,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertEquals(Long.MAX_VALUE - 40, performVarLong(Long.MAX_VALUE - 40)); assertEquals(Long.MAX_VALUE - 40, performVarLong(Long.MAX_VALUE - 40));
} }
@Test
public void testIndexBeforeAfter() throws Exception { public void testIndexBeforeAfter() throws Exception {
final long BUCKET_SIZE = HOUR_IN_MILLIS; final long BUCKET_SIZE = HOUR_IN_MILLIS;
stats = new NetworkStatsHistory(BUCKET_SIZE); stats = new NetworkStatsHistory(BUCKET_SIZE);
@@ -451,6 +477,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertIndexBeforeAfter(stats, 4, 4, Long.MAX_VALUE); assertIndexBeforeAfter(stats, 4, 4, Long.MAX_VALUE);
} }
@Test
public void testIntersects() throws Exception { public void testIntersects() throws Exception {
final long BUCKET_SIZE = HOUR_IN_MILLIS; final long BUCKET_SIZE = HOUR_IN_MILLIS;
stats = new NetworkStatsHistory(BUCKET_SIZE); stats = new NetworkStatsHistory(BUCKET_SIZE);
@@ -485,6 +512,7 @@ public class NetworkStatsHistoryTest extends AndroidTestCase {
assertTrue(stats.intersects(Long.MIN_VALUE, TEST_START + 1)); assertTrue(stats.intersects(Long.MIN_VALUE, TEST_START + 1));
} }
@Test
public void testSetValues() throws Exception { public void testSetValues() throws Exception {
stats = new NetworkStatsHistory(HOUR_IN_MILLIS); stats = new NetworkStatsHistory(HOUR_IN_MILLIS);
stats.recordData(TEST_START, TEST_START + 1, stats.recordData(TEST_START, TEST_START + 1,

View File

@@ -26,6 +26,9 @@ import static android.net.NetworkTemplate.buildTemplateMobileAll;
import static android.os.Process.myUid; import static android.os.Process.myUid;
import static android.text.format.DateUtils.HOUR_IN_MILLIS; import static android.text.format.DateUtils.HOUR_IN_MILLIS;
import static android.text.format.DateUtils.MINUTE_IN_MILLIS; import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static com.android.server.net.NetworkStatsCollection.multiplySafe; import static com.android.server.net.NetworkStatsCollection.multiplySafe;
@@ -37,11 +40,12 @@ import android.net.NetworkStatsHistory;
import android.net.NetworkTemplate; import android.net.NetworkTemplate;
import android.os.Process; import android.os.Process;
import android.os.UserHandle; import android.os.UserHandle;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.telephony.SubscriptionPlan; import android.telephony.SubscriptionPlan;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.test.AndroidTestCase;
import android.test.MoreAsserts; import android.test.MoreAsserts;
import android.test.suitebuilder.annotation.SmallTest;
import android.text.format.DateUtils; import android.text.format.DateUtils;
import android.util.RecurrenceRule; import android.util.RecurrenceRule;
@@ -64,11 +68,17 @@ import java.time.ZonedDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
/** /**
* Tests for {@link NetworkStatsCollection}. * Tests for {@link NetworkStatsCollection}.
*/ */
@RunWith(AndroidJUnit4.class)
@SmallTest @SmallTest
public class NetworkStatsCollectionTest extends AndroidTestCase { public class NetworkStatsCollectionTest {
private static final String TEST_FILE = "test.bin"; private static final String TEST_FILE = "test.bin";
private static final String TEST_IMSI = "310260000000000"; private static final String TEST_IMSI = "310260000000000";
@@ -79,18 +89,15 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
private static Clock sOriginalClock; private static Clock sOriginalClock;
@Override @Before
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp();
sOriginalClock = RecurrenceRule.sClock; sOriginalClock = RecurrenceRule.sClock;
// ignore any device overlay while testing // ignore any device overlay while testing
NetworkTemplate.forceAllNetworkTypes(); NetworkTemplate.forceAllNetworkTypes();
} }
@Override @After
protected void tearDown() throws Exception { public void tearDown() throws Exception {
super.tearDown();
RecurrenceRule.sClock = sOriginalClock; RecurrenceRule.sClock = sOriginalClock;
} }
@@ -98,8 +105,10 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
RecurrenceRule.sClock = Clock.fixed(instant, ZoneId.systemDefault()); RecurrenceRule.sClock = Clock.fixed(instant, ZoneId.systemDefault());
} }
@Test
public void testReadLegacyNetwork() throws Exception { public void testReadLegacyNetwork() throws Exception {
final File testFile = new File(getContext().getFilesDir(), TEST_FILE); final File testFile =
new File(InstrumentationRegistry.getContext().getFilesDir(), TEST_FILE);
stageFile(R.raw.netstats_v1, testFile); stageFile(R.raw.netstats_v1, testFile);
final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS); final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS);
@@ -124,8 +133,10 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
636016770L, 709306L, 88038768L, 518836L, NetworkStatsAccess.Level.DEVICE); 636016770L, 709306L, 88038768L, 518836L, NetworkStatsAccess.Level.DEVICE);
} }
@Test
public void testReadLegacyUid() throws Exception { public void testReadLegacyUid() throws Exception {
final File testFile = new File(getContext().getFilesDir(), TEST_FILE); final File testFile =
new File(InstrumentationRegistry.getContext().getFilesDir(), TEST_FILE);
stageFile(R.raw.netstats_uid_v4, testFile); stageFile(R.raw.netstats_uid_v4, testFile);
final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS); final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS);
@@ -150,8 +161,10 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
637076152L, 711413L, 88343717L, 521022L, NetworkStatsAccess.Level.DEVICE); 637076152L, 711413L, 88343717L, 521022L, NetworkStatsAccess.Level.DEVICE);
} }
@Test
public void testReadLegacyUidTags() throws Exception { public void testReadLegacyUidTags() throws Exception {
final File testFile = new File(getContext().getFilesDir(), TEST_FILE); final File testFile =
new File(InstrumentationRegistry.getContext().getFilesDir(), TEST_FILE);
stageFile(R.raw.netstats_uid_v4, testFile); stageFile(R.raw.netstats_uid_v4, testFile);
final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS); final NetworkStatsCollection collection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS);
@@ -176,6 +189,7 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
77017831L, 100995L, 35436758L, 92344L); 77017831L, 100995L, 35436758L, 92344L);
} }
@Test
public void testStartEndAtomicBuckets() throws Exception { public void testStartEndAtomicBuckets() throws Exception {
final NetworkStatsCollection collection = new NetworkStatsCollection(HOUR_IN_MILLIS); final NetworkStatsCollection collection = new NetworkStatsCollection(HOUR_IN_MILLIS);
@@ -190,6 +204,7 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
assertEquals(2 * HOUR_IN_MILLIS, collection.getEndMillis()); assertEquals(2 * HOUR_IN_MILLIS, collection.getEndMillis());
} }
@Test
public void testAccessLevels() throws Exception { public void testAccessLevels() throws Exception {
final NetworkStatsCollection collection = new NetworkStatsCollection(HOUR_IN_MILLIS); final NetworkStatsCollection collection = new NetworkStatsCollection(HOUR_IN_MILLIS);
final NetworkStats.Entry entry = new NetworkStats.Entry(); final NetworkStats.Entry entry = new NetworkStats.Entry();
@@ -250,8 +265,10 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
0, NetworkStatsAccess.Level.DEVICE); 0, NetworkStatsAccess.Level.DEVICE);
} }
@Test
public void testAugmentPlan() throws Exception { public void testAugmentPlan() throws Exception {
final File testFile = new File(getContext().getFilesDir(), TEST_FILE); final File testFile =
new File(InstrumentationRegistry.getContext().getFilesDir(), TEST_FILE);
stageFile(R.raw.netstats_v1, testFile); stageFile(R.raw.netstats_v1, testFile);
final NetworkStatsCollection emptyCollection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS); final NetworkStatsCollection emptyCollection = new NetworkStatsCollection(30 * MINUTE_IN_MILLIS);
@@ -439,6 +456,7 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
} }
} }
@Test
public void testAugmentPlanGigantic() throws Exception { public void testAugmentPlanGigantic() throws Exception {
// We're in the future, but not that far off // We're in the future, but not that far off
setClock(Instant.parse("2012-06-01T00:00:00.00Z")); setClock(Instant.parse("2012-06-01T00:00:00.00Z"));
@@ -461,6 +479,7 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
assertEquals(4_939_212_386L, getHistory(large, plan, TIME_A, TIME_C).getTotalBytes()); assertEquals(4_939_212_386L, getHistory(large, plan, TIME_A, TIME_C).getTotalBytes());
} }
@Test
public void testRounding() throws Exception { public void testRounding() throws Exception {
final NetworkStatsCollection coll = new NetworkStatsCollection(HOUR_IN_MILLIS); final NetworkStatsCollection coll = new NetworkStatsCollection(HOUR_IN_MILLIS);
@@ -482,6 +501,7 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
assertEquals(TIME_A - HOUR_IN_MILLIS, coll.roundDown(TIME_A - 1)); assertEquals(TIME_A - HOUR_IN_MILLIS, coll.roundDown(TIME_A - 1));
} }
@Test
public void testMultiplySafe() { public void testMultiplySafe() {
assertEquals(25, multiplySafe(50, 1, 2)); assertEquals(25, multiplySafe(50, 1, 2));
assertEquals(100, multiplySafe(50, 2, 1)); assertEquals(100, multiplySafe(50, 2, 1));
@@ -510,7 +530,7 @@ public class NetworkStatsCollectionTest extends AndroidTestCase {
InputStream in = null; InputStream in = null;
OutputStream out = null; OutputStream out = null;
try { try {
in = getContext().getResources().openRawResource(rawId); in = InstrumentationRegistry.getContext().getResources().openRawResource(rawId);
out = new FileOutputStream(file); out = new FileOutputStream(file);
Streams.copy(in, out); Streams.copy(in, out);
} finally { } finally {

View File

@@ -85,8 +85,8 @@ import android.os.Messenger;
import android.os.PowerManager; import android.os.PowerManager;
import android.support.test.InstrumentationRegistry; import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnit4;
import android.support.test.filters.SmallTest;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Log; import android.util.Log;
import android.util.TrustedTime; import android.util.TrustedTime;
@@ -201,7 +201,6 @@ public class NetworkStatsServiceTest {
ArgumentCaptor.forClass(INetworkManagementEventObserver.class); ArgumentCaptor.forClass(INetworkManagementEventObserver.class);
verify(mNetManager).registerObserver(networkObserver.capture()); verify(mNetManager).registerObserver(networkObserver.capture());
mNetworkObserver = networkObserver.getValue(); mNetworkObserver = networkObserver.getValue();
} }
@After @After