You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2006/08/25 04:39:48 UTC
svn commit: r436621 - in
/incubator/harmony/enhanced/classlib/trunk/modules/prefs/src:
main/java/java/util/prefs/
test/java/org/apache/harmony/prefs/tests/java/util/prefs/
test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/
Author: smishura
Date: Thu Aug 24 19:39:48 2006
New Revision: 436621
URL: http://svn.apache.org/viewvc?rev=436621&view=rev
Log:
Fix for BackingStoreException:
-Remove throwing NotSerializableException: the statement that the class is not Serializable was removed from 1.5 spec
-Fix the test to use new testing framework
Added:
incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser (with props)
Modified:
incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/BackingStoreException.java
incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.java
Modified: incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/BackingStoreException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/BackingStoreException.java?rev=436621&r1=436620&r2=436621&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/BackingStoreException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/BackingStoreException.java Thu Aug 24 19:39:48 2006
@@ -16,17 +16,10 @@
package java.util.prefs;
-import java.io.NotSerializableException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
/**
* An exception to indicate that some error was encountered while accessing
* the backing store.
- * <p>
- * Please note that this class cannot be serialized actually, so relevant
- * serialization methods only throw <code>NotSerializableException</code>.
- * </p>
*
* @since 1.4
*/
@@ -52,22 +45,6 @@
*/
public BackingStoreException (Throwable t) {
super(t);
- }
-
- /*
- * This method always throws a <code>NotSerializableException</code>, because
- * this object cannot be serialized,
- */
- private void writeObject(ObjectOutputStream out) throws NotSerializableException{
- throw new NotSerializableException();
- }
-
- /*
- * This method always throws a <code>NotSerializableException</code>, because
- * this object cannot be serialized,
- */
- private void readObject(ObjectInputStream in) throws NotSerializableException{
- throw new NotSerializableException();
}
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.java?rev=436621&r1=436620&r2=436621&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.java Thu Aug 24 19:39:48 2006
@@ -15,11 +15,11 @@
package org.apache.harmony.prefs.tests.java.util.prefs;
-import java.io.NotSerializableException;
import java.util.prefs.BackingStoreException;
import junit.framework.TestCase;
-import tests.util.SerializationTester;
+
+import org.apache.harmony.testframework.serialization.SerializationTest;
/**
*
@@ -47,14 +47,20 @@
assertEquals(t, e.getCause());
}
- public void testSerialization() throws Exception {
- try {
- SerializationTester.writeObject(new BackingStoreException("msg"),
- "test.txt");
- fail();
- } catch (NotSerializableException e) {
- }
- }
+ /**
+ * @tests serialization/deserialization.
+ */
+ public void testSerializationSelf() throws Exception {
+
+ SerializationTest.verifySelf(new BackingStoreException("msg"));
+ }
+
+ /**
+ * @tests serialization/deserialization compatibility with RI.
+ */
+ public void testSerializationCompatibility() throws Exception {
+ SerializationTest.verifyGolden(this, new BackingStoreException("msg"));
+ }
}
Added: incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser?rev=436621&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream