diff options
author | Paul Duffin <paulduffin@google.com> | 2017-02-23 16:25:04 +0000 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2017-02-27 15:07:45 +0000 |
commit | 30307ec0c76a51b91701f3b90d764ad6ef679dc3 (patch) | |
tree | f70d94a1311e545115383c4ae69188f58a0ff7fa /support | |
parent | dbafcb7bfc98ae72e2f1ce4945e1dbf94cd16c34 (diff) |
Fix InetAddress.getByName tests
Removes suppression of legacy harmony tests that fail on
Android.
Changes:
1) Switches libcore InetAddressTest to parameterized Junit4 test
framework to make additions of test data easier / clearer.
2) Removes failing harmony test cases. This seemed like the
correct approach as the harmony tests expected completely
opposite behavior to the libcore tests but while the libcore
tests pass the harmony tests have been broken for over 3 years.
3) Adds test cases to libcore InetAddressTest to assert the
behavior of addresses removed from the harmony test cases.
4) Removes suppression of harmony test cases.
5) Handles knock-ons in SerializationTester; it assumed that all
tests extend TestCase, no longer the case with JUnit 4.
Bug: 11689863
Test: with cts and vogar
Change-Id: Iea6ba11fda18f058068e4eea1490d98ee7a3eb2d
Diffstat (limited to 'support')
-rw-r--r-- | support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java b/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java index 4f0b90be0e..005e931cbc 100644 --- a/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java +++ b/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java @@ -266,7 +266,7 @@ public abstract class SerializationTest extends TestCase { * @param object - object to be compared * @return object's comparator */ - public static SerializableAssert defineComparator(TestCase test, Object object) + public static SerializableAssert defineComparator(Object test, Object object) throws Exception { if (test instanceof SerializableAssert) { @@ -300,7 +300,7 @@ public abstract class SerializationTest extends TestCase { * @param test - test case * @param object - to be compared */ - public static void verifyGolden(TestCase test, Object object) throws Exception { + public static void verifyGolden(Object test, Object object) throws Exception { verifyGolden(test, object, defineComparator(test, object)); } @@ -316,7 +316,7 @@ public abstract class SerializationTest extends TestCase { * @param object - to be compared * @param comparator - for comparing (de)serialized objects */ - public static void verifyGolden(TestCase test, Object object, SerializableAssert comparator) + public static void verifyGolden(Object test, Object object, SerializableAssert comparator) throws Exception { assertNotNull("Null comparator", comparator); Serializable deserialized = getObject(test, ".golden.ser"); @@ -333,7 +333,7 @@ public abstract class SerializationTest extends TestCase { * @param test - test case * @param objects - array of objects to be compared */ - public static void verifyGolden(TestCase test, Object[] objects) throws Exception { + public static void verifyGolden(Object test, Object[] objects) throws Exception { assertFalse("Empty array", objects.length == 0); verifyGolden(test, objects, defineComparator(test, objects[0])); } @@ -353,7 +353,7 @@ public abstract class SerializationTest extends TestCase { * @param objects - array of objects to be compared * @param comparator - for comparing (de)serialized objects */ - public static void verifyGolden(TestCase test, Object[] objects, SerializableAssert comparator) + public static void verifyGolden(Object test, Object[] objects, SerializableAssert comparator) throws Exception { assertFalse("Empty array", objects.length == 0); for (int i = 0; i < objects.length; i++) { @@ -420,7 +420,7 @@ public abstract class SerializationTest extends TestCase { } } - private static Serializable getObject(TestCase test, String toAppend) throws Exception { + private static Serializable getObject(Object test, String toAppend) throws Exception { StringBuilder path = new StringBuilder("/serialization"); path.append(File.separatorChar); path.append(test.getClass().getName().replace('.', File.separatorChar)); |