diff options
author | Jesse Wilson <jessewilson@google.com> | 2009-09-30 15:39:36 -0700 |
---|---|---|
committer | Jesse Wilson <jessewilson@google.com> | 2009-09-30 15:39:36 -0700 |
commit | e2e14ddec9683c2d5fe244cd8e715ecd390a999b (patch) | |
tree | 8bd1c71df6d817f2412e4836ab94734b9a374639 | |
parent | bb710e3294c57587f327c5e365353af81aa2cb5f (diff) | |
download | dalvik-e2e14ddec9683c2d5fe244cd8e715ecd390a999b.tar.gz |
Remove @KnownFailure tags for tests that pass.
Also cleanup tests.api.java.io.SerializationStressTest4#test_writeObject_Proxy
4 files changed, 18 insertions, 43 deletions
diff --git a/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java b/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java index 8b03cede8..6bc1939a8 100644 --- a/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java +++ b/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java @@ -414,7 +414,6 @@ public class StringBuffer2Test extends junit.framework.TestCase { method = "ensureCapacity", args = {int.class} ) - @KnownFailure("Google TODO 1481226") public void test_ensureCapacityI() { // Test for method void java.lang.StringBuffer.ensureCapacity(int) StringBuffer sb = new StringBuffer(10); diff --git a/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java b/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java index b979628e2..b91ad5fb9 100644 --- a/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java +++ b/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java @@ -324,7 +324,6 @@ public class InetSocketAddressTest extends TestCase { method = "!SerializationGolden", args = {} ) - @KnownFailure("Problem with deserialization of Localhost vs. localhost") public void testSerializationCompatibility() throws Exception { Object[] testCases = { diff --git a/libcore/luni/src/test/java/tests/api/java/io/SerializationStressTest4.java b/libcore/luni/src/test/java/tests/api/java/io/SerializationStressTest4.java index 9b589c582..3b1a063c0 100644 --- a/libcore/luni/src/test/java/tests/api/java/io/SerializationStressTest4.java +++ b/libcore/luni/src/test/java/tests/api/java/io/SerializationStressTest4.java @@ -44,6 +44,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TimeZone; +import java.util.Collections; import tests.support.Support_Configuration; import tests.support.Support_Proxy_I1; @@ -2666,50 +2667,27 @@ public class SerializationStressTest4 extends SerializationStressTest { method = "!Serialization", args = {} ) - @KnownFailure("Proxy support broken when user classloader involved") - public void test_writeObject_Proxy() { - // Test for method void - // java.io.ObjectOutputStream.writeObject(java.security.GuardedObject) - - Object objToSave = null; - Object objLoaded = null; - - try { - objToSave = Proxy.getProxyClass(Support_Proxy_I1.class - .getClassLoader(), new Class[] { Support_Proxy_I1.class }); - if (DEBUG) - System.out.println("Obj = " + objToSave); - objLoaded = dumpAndReload(objToSave); + public void test_writeObject_Proxy() + throws ClassNotFoundException, IOException { - assertTrue(MSG_TEST_FAILED + "not a proxy class", Proxy - .isProxyClass((Class) objLoaded)); - Class[] interfaces = ((Class) objLoaded).getInterfaces(); - assertTrue(MSG_TEST_FAILED + "wrong interfaces length", - interfaces.length == 1); - assertTrue(MSG_TEST_FAILED + "wrong interface", - interfaces[0] == Support_Proxy_I1.class); + // serialize class + Class<?> proxyClass = Proxy.getProxyClass(Support_Proxy_I1.class + .getClassLoader(), new Class[]{Support_Proxy_I1.class}); + Class<?> proxyClassOut = (Class<?>) dumpAndReload(proxyClass); - InvocationHandler handler = new MyInvocationHandler(); - objToSave = Proxy.newProxyInstance(Support_Proxy_I1.class - .getClassLoader(), new Class[] { Support_Proxy_I1.class }, - handler); - if (DEBUG) - System.out.println("Obj = " + objToSave); - objLoaded = dumpAndReload(objToSave); + assertTrue(Proxy.isProxyClass(proxyClassOut)); + assertEquals(Collections.<Class>singletonList(Support_Proxy_I1.class), + Arrays.asList(proxyClassOut.getInterfaces())); - boolean equals = Proxy.getInvocationHandler(objLoaded).getClass() == MyInvocationHandler.class; - assertTrue(MSG_TEST_FAILED + objToSave, equals); + // serialize instance + InvocationHandler handler = new MyInvocationHandler(); + Object proxyInstance = Proxy.newProxyInstance(Support_Proxy_I1.class + .getClassLoader(), new Class[] { Support_Proxy_I1.class }, + handler); - } catch (IOException e) { - fail("Exception serializing " + objToSave + " : " + e.getMessage()); - } catch (ClassNotFoundException e) { - fail("ClassNotFoundException reading Object type: " - + e.getMessage()); - } catch (Error err) { - System.out.println("Error when obj = " + objToSave); - // err.printStackTrace(); - throw err; - } + Object proxyInstanceOut = dumpAndReload(proxyInstance); + assertEquals(MyInvocationHandler.class, + Proxy.getInvocationHandler(proxyInstanceOut).getClass()); } @TestTargetNew( diff --git a/libcore/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java b/libcore/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java index c515d2057..292c2f1a7 100644 --- a/libcore/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java +++ b/libcore/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java @@ -278,7 +278,6 @@ public class DocumentBuilderTest extends TestCase { method = "parse", args = {java.io.File.class} ) - @KnownFailure("d.getChildNodes returns an unexpected/strange #Text node") public void test_parseLjava_io_File() throws IOException { File f = resourceToTmpFile("/simple.xml"); |