summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorJorg Pleumann <>2009-04-27 09:15:18 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-27 09:15:18 -0700
commit1a7e762f344c111416b001a61e41451d01f605ad (patch)
tree7e0045a37b2f99a27890856a0c011036df7c4057 /luni
parent016a87c7952b25eededfc222615e25a5a72bcdda (diff)
downloadlibcore-1a7e762f344c111416b001a61e41451d01f605ad.zip
libcore-1a7e762f344c111416b001a61e41451d01f605ad.tar.gz
libcore-1a7e762f344c111416b001a61e41451d01f605ad.tar.bz2
AI 147838: A couple of fixes for making the
core tests work better in the CTS environment. Some tests had to be marked broken either because they either expose different behavior than in run-core-tests or they take too much time (beyond the CTS' timeout). BUG=1285921 Automated import of CL 147838
Diffstat (limited to 'luni')
-rw-r--r--luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java2
-rw-r--r--luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java2
-rw-r--r--luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java4
-rw-r--r--luni/src/test/java/tests/api/java/net/URLStreamHandlerFactoryTest.java16
-rw-r--r--luni/src/test/java/tests/api/java/util/CalendarTest.java3
5 files changed, 17 insertions, 10 deletions
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
index 8abfa1d..d517e07 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
@@ -17,6 +17,7 @@
package org.apache.harmony.luni.tests.internal.net.www.protocol.http;
+import dalvik.annotation.SideEffect;
import dalvik.annotation.BrokenTest;
import dalvik.annotation.KnownFailure;
import dalvik.annotation.TestTargetClass;
@@ -304,6 +305,7 @@ public class HttpURLConnectionTest extends TestCase {
args = {}
)
})
+ @SideEffect("Suffers from side effect of other, currently unknown test")
public void testProxyAuthorization() throws Exception {
// Set up test Authenticator
Authenticator.setDefault(new Authenticator() {
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java
index c151caf..972ab03 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java
@@ -17,6 +17,7 @@
package org.apache.harmony.luni.tests.java.lang;
+import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetNew;
@@ -528,6 +529,7 @@ public class String2Test extends junit.framework.TestCase {
method = "getBytes",
args = {}
)
+ @BrokenTest("Takes too long for the CTS host")
public void test_getBytes() {
// Test for method byte [] java.lang.String.getBytes()
byte[] sbytes = hw1.getBytes();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
index 1cfb1cb..1f1456f 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
@@ -17,6 +17,7 @@
package org.apache.harmony.luni.tests.java.net;
+import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
@@ -354,6 +355,7 @@ public class InetAddressTest extends junit.framework.TestCase {
method = "getHostName",
args = {}
)
+ @BrokenTest("Crashes VM in CTS due to a JNI error in networking code")
public void test_getHostName() throws Exception {
// Test for method java.lang.String java.net.InetAddress.getHostName()
InetAddress ia = InetAddress
@@ -633,6 +635,8 @@ public class InetAddressTest extends junit.framework.TestCase {
method = "isReachable",
args = {java.net.NetworkInterface.class, int.class, int.class}
)
+ @BrokenTest("Depends on external network address and shows different" +
+ "behavior with WLAN and 3G networks")
public void test_isReachableLjava_net_NetworkInterfaceII() throws Exception {
// tests local address
InetAddress ia = Inet4Address.getByName("127.0.0.1");
diff --git a/luni/src/test/java/tests/api/java/net/URLStreamHandlerFactoryTest.java b/luni/src/test/java/tests/api/java/net/URLStreamHandlerFactoryTest.java
index 7f4d735..ddfa473 100644
--- a/luni/src/test/java/tests/api/java/net/URLStreamHandlerFactoryTest.java
+++ b/luni/src/test/java/tests/api/java/net/URLStreamHandlerFactoryTest.java
@@ -1,13 +1,5 @@
package tests.api.java.net;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import tests.support.Support_Configuration;
-
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
@@ -16,6 +8,13 @@ import java.net.URLConnection;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
+import junit.framework.TestCase;
+import tests.support.Support_Configuration;
+import dalvik.annotation.SideEffect;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+
@TestTargetClass(URLStreamHandlerFactory.class)
public class URLStreamHandlerFactoryTest extends TestCase {
@@ -33,6 +32,7 @@ public class URLStreamHandlerFactoryTest extends TestCase {
method = "createURLStreamHandler",
args = {java.lang.String.class}
)
+ @SideEffect("Leaves wrong StreamHandlerFactory behind, affects other tests")
public void test_createURLStreamHandler() throws MalformedURLException {
if(isTestable) {
diff --git a/luni/src/test/java/tests/api/java/util/CalendarTest.java b/luni/src/test/java/tests/api/java/util/CalendarTest.java
index a3c003f..af43096 100644
--- a/luni/src/test/java/tests/api/java/util/CalendarTest.java
+++ b/luni/src/test/java/tests/api/java/util/CalendarTest.java
@@ -1283,8 +1283,7 @@ public class CalendarTest extends junit.framework.TestCase {
args = {int.class}
)
public void test_EdgeCases() {
- Locale.setDefault(Locale.US);
- Calendar c = Calendar.getInstance();
+ Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
c.setTimeInMillis(Long.MAX_VALUE);