summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2011-05-02 13:29:22 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-02 13:29:22 -0700
commitdb46fa25be0a3e8040b118f688b69dd526aed86d (patch)
tree5b2cabf4eecfe86a209d6a9a47653320111892bb /core/tests
parentd369d64ee7931726d479e60e64d76a31fdba4a8f (diff)
parenta47c40193fcbe9ca07facea78b2828afdae5e025 (diff)
downloadframeworks_base-db46fa25be0a3e8040b118f688b69dd526aed86d.zip
frameworks_base-db46fa25be0a3e8040b118f688b69dd526aed86d.tar.gz
frameworks_base-db46fa25be0a3e8040b118f688b69dd526aed86d.tar.bz2
am a47c4019: Merge "Add RouteInfo objects for tracking routes." into honeycomb-LTE
* commit 'a47c40193fcbe9ca07facea78b2828afdae5e025': Add RouteInfo objects for tracking routes.
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java3
-rw-r--r--core/tests/coretests/src/android/net/LinkPropertiesTest.java33
2 files changed, 19 insertions, 17 deletions
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java
index d22356d..27363e8 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java
@@ -30,6 +30,7 @@ import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.net.wifi.WifiConfiguration.ProxySettings;
import android.net.LinkAddress;
import android.net.LinkProperties;
+import android.net.RouteInfo;
import android.util.Log;
import java.io.InputStream;
@@ -301,7 +302,7 @@ public class AccessPointParserHelper {
if (!InetAddress.isNumeric(gwAddr)) {
throw new SAXException();
}
- mLinkProperties.addGateway(InetAddress.getByName(gwAddr));
+ mLinkProperties.addRoute(new RouteInfo(InetAddress.getByName(gwAddr)));
} catch (UnknownHostException e) {
throw new SAXException();
}
diff --git a/core/tests/coretests/src/android/net/LinkPropertiesTest.java b/core/tests/coretests/src/android/net/LinkPropertiesTest.java
index 50666b4..e3b6b5f 100644
--- a/core/tests/coretests/src/android/net/LinkPropertiesTest.java
+++ b/core/tests/coretests/src/android/net/LinkPropertiesTest.java
@@ -17,6 +17,7 @@
package android.net;
import android.net.LinkProperties;
+import android.net.RouteInfo;
import android.test.suitebuilder.annotation.SmallTest;
import junit.framework.TestCase;
@@ -55,8 +56,8 @@ public class LinkPropertiesTest extends TestCase {
source.addDns(NetworkUtils.numericToInetAddress(DNS1));
source.addDns(NetworkUtils.numericToInetAddress(DNS2));
// set 2 gateways
- source.addGateway(NetworkUtils.numericToInetAddress(GATEWAY1));
- source.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
+ source.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY1)));
+ source.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
LinkProperties target = new LinkProperties();
@@ -68,8 +69,8 @@ public class LinkPropertiesTest extends TestCase {
NetworkUtils.numericToInetAddress(ADDRV6), 128));
target.addDns(NetworkUtils.numericToInetAddress(DNS1));
target.addDns(NetworkUtils.numericToInetAddress(DNS2));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY1));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY1)));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
assertTrue(source.equals(target));
assertTrue(source.hashCode() == target.hashCode());
@@ -83,8 +84,8 @@ public class LinkPropertiesTest extends TestCase {
NetworkUtils.numericToInetAddress(ADDRV6), 128));
target.addDns(NetworkUtils.numericToInetAddress(DNS1));
target.addDns(NetworkUtils.numericToInetAddress(DNS2));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY1));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY1)));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
assertFalse(source.equals(target));
target.clear();
@@ -96,8 +97,8 @@ public class LinkPropertiesTest extends TestCase {
NetworkUtils.numericToInetAddress(ADDRV6), 128));
target.addDns(NetworkUtils.numericToInetAddress(DNS1));
target.addDns(NetworkUtils.numericToInetAddress(DNS2));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY1));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY1)));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
assertFalse(source.equals(target));
target.clear();
@@ -109,8 +110,8 @@ public class LinkPropertiesTest extends TestCase {
// change dnses
target.addDns(NetworkUtils.numericToInetAddress("75.208.7.2"));
target.addDns(NetworkUtils.numericToInetAddress(DNS2));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY1));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY1)));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
assertFalse(source.equals(target));
target.clear();
@@ -122,8 +123,8 @@ public class LinkPropertiesTest extends TestCase {
target.addDns(NetworkUtils.numericToInetAddress(DNS1));
target.addDns(NetworkUtils.numericToInetAddress(DNS2));
// change gateway
- target.addGateway(NetworkUtils.numericToInetAddress("75.208.8.2"));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress("75.208.8.2")));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
assertFalse(source.equals(target));
} catch (Exception e) {
@@ -146,8 +147,8 @@ public class LinkPropertiesTest extends TestCase {
source.addDns(NetworkUtils.numericToInetAddress(DNS1));
source.addDns(NetworkUtils.numericToInetAddress(DNS2));
// set 2 gateways
- source.addGateway(NetworkUtils.numericToInetAddress(GATEWAY1));
- source.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
+ source.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY1)));
+ source.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
LinkProperties target = new LinkProperties();
// Exchange order
@@ -158,8 +159,8 @@ public class LinkPropertiesTest extends TestCase {
NetworkUtils.numericToInetAddress(ADDRV4), 32));
target.addDns(NetworkUtils.numericToInetAddress(DNS2));
target.addDns(NetworkUtils.numericToInetAddress(DNS1));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY2));
- target.addGateway(NetworkUtils.numericToInetAddress(GATEWAY1));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY2)));
+ target.addRoute(new RouteInfo(NetworkUtils.numericToInetAddress(GATEWAY1)));
assertTrue(source.equals(target));
assertTrue(source.hashCode() == target.hashCode());