summaryrefslogtreecommitdiffstats
path: root/services/tests/servicestests/src
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-06-13 00:14:31 -0700
committerJeff Sharkey <jsharkey@android.com>2011-06-13 00:14:31 -0700
commitaf11d4859582a9736aa204562f0beac5a7d60934 (patch)
tree58231807c7ac38064b124297fb9a4f64b04a2855 /services/tests/servicestests/src
parent22c055e6424e0e9579711545d8f4800c0f796db8 (diff)
downloadframeworks_base-af11d4859582a9736aa204562f0beac5a7d60934.zip
frameworks_base-af11d4859582a9736aa204562f0beac5a7d60934.tar.gz
frameworks_base-af11d4859582a9736aa204562f0beac5a7d60934.tar.bz2
Fix test-related build breakage.
Change-Id: I48a3dbbdc49d742d6ad19cff34ee8da4b3949bb8
Diffstat (limited to 'services/tests/servicestests/src')
-rw-r--r--services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
index f831ca3..476aded 100644
--- a/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java
@@ -297,7 +297,7 @@ public class NetworkPolicyManagerServiceTest extends AndroidTestCase {
final long currentTime = parseTime("2007-11-14T00:00:00.000Z");
final long expectedCycle = parseTime("2007-11-05T00:00:00.000Z");
- final NetworkPolicy policy = new NetworkPolicy(5, 1024L, 1024L);
+ final NetworkPolicy policy = new NetworkPolicy(TEMPLATE_WIFI, null, 5, 1024L, 1024L);
final long actualCycle = computeLastCycleBoundary(currentTime, policy);
assertEquals(expectedCycle, actualCycle);
}
@@ -307,7 +307,7 @@ public class NetworkPolicyManagerServiceTest extends AndroidTestCase {
final long currentTime = parseTime("2007-11-14T00:00:00.000Z");
final long expectedCycle = parseTime("2007-10-20T00:00:00.000Z");
- final NetworkPolicy policy = new NetworkPolicy(20, 1024L, 1024L);
+ final NetworkPolicy policy = new NetworkPolicy(TEMPLATE_WIFI, null, 20, 1024L, 1024L);
final long actualCycle = computeLastCycleBoundary(currentTime, policy);
assertEquals(expectedCycle, actualCycle);
}
@@ -317,7 +317,7 @@ public class NetworkPolicyManagerServiceTest extends AndroidTestCase {
final long currentTime = parseTime("2007-02-14T00:00:00.000Z");
final long expectedCycle = parseTime("2007-01-30T00:00:00.000Z");
- final NetworkPolicy policy = new NetworkPolicy(30, 1024L, 1024L);
+ final NetworkPolicy policy = new NetworkPolicy(TEMPLATE_WIFI, null, 30, 1024L, 1024L);
final long actualCycle = computeLastCycleBoundary(currentTime, policy);
assertEquals(expectedCycle, actualCycle);
}
@@ -327,7 +327,7 @@ public class NetworkPolicyManagerServiceTest extends AndroidTestCase {
final long currentTime = parseTime("2007-03-14T00:00:00.000Z");
final long expectedCycle = parseTime("2007-03-01T00:00:00.000Z");
- final NetworkPolicy policy = new NetworkPolicy(30, 1024L, 1024L);
+ final NetworkPolicy policy = new NetworkPolicy(TEMPLATE_WIFI, null, 30, 1024L, 1024L);
final long actualCycle = computeLastCycleBoundary(currentTime, policy);
assertEquals(expectedCycle, actualCycle);
}
@@ -366,7 +366,7 @@ public class NetworkPolicyManagerServiceTest extends AndroidTestCase {
// TODO: write up NetworkManagementService mock
replay();
- mService.setNetworkPolicy(TEMPLATE_WIFI, null, new NetworkPolicy(CYCLE_DAY, 1024L, 2048L));
+ setNetworkPolicies(new NetworkPolicy(TEMPLATE_WIFI, null, CYCLE_DAY, 1024L, 2048L));
verifyAndReset();
}
@@ -376,6 +376,10 @@ public class NetworkPolicyManagerServiceTest extends AndroidTestCase {
return result.toMillis(true);
}
+ private void setNetworkPolicies(NetworkPolicy... policies) {
+ mService.setNetworkPolicies(policies);
+ }
+
private static NetworkState buildWifi() {
final NetworkInfo info = new NetworkInfo(TYPE_WIFI, 0, null, null);
info.setDetailedState(DetailedState.CONNECTED, null, null);