harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r430328 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test: api/java/org/apache/harmony/luni/tests/java/util/ resources/serialization/java/util/ resources/serialization/org/apache/harmony/luni/tests/java/util/
Date Thu, 10 Aug 2006 09:09:13 GMT
Author: smishura
Date: Thu Aug 10 02:09:12 2006
New Revision: 430328

URL: http://svn.apache.org/viewvc?rev=430328&view=rev
Log:
Refactoring serialization tests to use new framework

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.golden.ser
      - copied unchanged from r430309, incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/util/FormatterClosedException.ser
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.golden.ser
      - copied unchanged from r430309, incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/util/InputMismatchExceptionTest.ser
Removed:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/util/FormatterClosedException.ser
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/util/InputMismatchExceptionTest.ser
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java?rev=430328&r1=430327&r2=430328&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java
Thu Aug 10 02:09:12 2006
@@ -17,13 +17,11 @@
 
 import java.util.FormatterClosedException;
 
-import tests.util.SerializationTester;
-
 import junit.framework.TestCase;
 
-public class FormatterClosedExceptionTest extends TestCase {
+import org.apache.harmony.testframework.serialization.SerializationTest;
 
-	private static final String SERIALIZATION_FILE_NAME = "serialization/java/util/FormatterClosedException.ser";
//$NON-NLS-1$
+public class FormatterClosedExceptionTest extends TestCase {
 
 	/**
 	 * @tests java.util.FormatterClosedException#FormatterClosedException
@@ -33,23 +31,19 @@
 		assertTrue(null != formatterClosedException);
 	}
 
-	/**
-	 * @tests serialization/deserilazation.
-	 */
-	public void test_serialization() throws Exception {
-		FormatterClosedException srcFormatterClosedException = new FormatterClosedException();
-		FormatterClosedException destFormatterClosedException = (FormatterClosedException) SerializationTester
-				.getDeserilizedObject(srcFormatterClosedException);
-	}
-
-	/**
-	 * @tests serialization/deserilazation compatibility with RI.
-	 */
-	public void test_serializationCompatibility() throws Exception {
-		FormatterClosedException srcFormatterClosedException = new FormatterClosedException();
-		FormatterClosedException destFormatterClosedException = (FormatterClosedException) SerializationTester
-				.readObject(srcFormatterClosedException,
-						SERIALIZATION_FILE_NAME);
-	}
+    /**
+     * @tests serialization/deserialization.
+     */
+    public void testSerializationSelf() throws Exception {
+
+        SerializationTest.verifySelf(new FormatterClosedException());
+    }
+
+    /**
+     * @tests serialization/deserialization compatibility with RI.
+     */
+    public void testSerializationCompatibility() throws Exception {
 
+        SerializationTest.verifyGolden(this, new FormatterClosedException());
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java?rev=430328&r1=430327&r2=430328&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java
Thu Aug 10 02:09:12 2006
@@ -18,13 +18,11 @@
 import java.util.InputMismatchException;
 import java.util.NoSuchElementException;
 
-import tests.util.SerializationTester;
-
 import junit.framework.TestCase;
 
-public class InputMismatchExceptionTest extends TestCase {
+import org.apache.harmony.testframework.serialization.SerializationTest;
 
-	private static final String SERIALIZATION_FILE_NAME = "serialization/java/util/InputMismatchExceptionTest.ser";
//$NON-NLS-1$
+public class InputMismatchExceptionTest extends TestCase {
 
 	private static final String ERROR_MESSAGE = "for serialization test"; //$NON-NLS-1$
 
@@ -47,25 +45,20 @@
 		assertEquals(ERROR_MESSAGE, exception.getMessage());
 	}
 
-	/**
-	 * @tests serialization/deserilazation.
-	 */
-	public void testSerialization() throws Exception {
-		InputMismatchException exception = new InputMismatchException(ERROR_MESSAGE);
-		InputMismatchException deserialedException = (InputMismatchException) SerializationTester
-				.getDeserilizedObject(exception);
-		assertEquals(exception.getMessage(), deserialedException.getMessage());
-		assertEquals(exception.getCause(), deserialedException.getCause());
-	}
-
-	/**
-	 * @tests serialization/deserilazation compatibility with RI.
-	 */
-	public void testSerializationCompatibility() throws Exception {
-		InputMismatchException exception = new InputMismatchException(ERROR_MESSAGE);
-		InputMismatchException deserialedException = (InputMismatchException) SerializationTester
-				.readObject(exception, SERIALIZATION_FILE_NAME);
-		assertEquals(deserialedException.getMessage(), exception.getMessage());
-		assertEquals(deserialedException.getCause(), exception.getCause());
-	}
-}
\ No newline at end of file
+    /**
+     * @tests serialization/deserialization.
+     */
+    public void testSerializationSelf() throws Exception {
+
+        SerializationTest.verifySelf(new InputMismatchException(ERROR_MESSAGE));
+    }
+
+    /**
+     * @tests serialization/deserialization compatibility with RI.
+     */
+    public void testSerializationCompatibility() throws Exception {
+
+        SerializationTest.verifyGolden(this, new InputMismatchException(
+                ERROR_MESSAGE));
+    }
+}



Mime
View raw message