harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r436626 - in /incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs: NodeChangeEventTest.java PreferenceChangeEventTest.java
Date Fri, 25 Aug 2006 02:55:06 GMT
Author: smishura
Date: Thu Aug 24 19:55:06 2006
New Revision: 436626

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

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeEventTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeEventTest.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/NodeChangeEventTest.java?rev=436626&r1=436625&r2=436626&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeEventTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeEventTest.java
Thu Aug 24 19:55:06 2006
@@ -15,12 +15,15 @@
 
 package org.apache.harmony.prefs.tests.java.util.prefs;
 
+import java.io.ByteArrayOutputStream;
 import java.io.NotSerializableException;
+import java.io.ObjectOutputStream;
 import java.util.prefs.NodeChangeEvent;
 import java.util.prefs.Preferences;
 
 import junit.framework.TestCase;
-import tests.util.SerializationTester;
+
+import org.apache.harmony.testframework.serialization.SerializationTest;
 
 /**
  * 
@@ -51,12 +54,14 @@
 	}
 
 	public void testSerialization() throws Exception {
-		try {
-			SerializationTester.writeObject(new NodeChangeEvent(Preferences
-					.systemRoot(), null), "test.txt");
-			fail();
-		} catch (NotSerializableException e) {
-		}
-	}
+        
+        event = new NodeChangeEvent(Preferences.systemRoot(), null);
 
+        try {
+            SerializationTest.putObjectToStream(event, new ObjectOutputStream(
+                    new ByteArrayOutputStream()));
+            fail("No expected NotSerializableException");
+        } catch (NotSerializableException e) {
+        }
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeEventTest.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/PreferenceChangeEventTest.java?rev=436626&r1=436625&r2=436626&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeEventTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeEventTest.java
Thu Aug 24 19:55:06 2006
@@ -15,14 +15,16 @@
 
 package org.apache.harmony.prefs.tests.java.util.prefs;
 
+import java.io.ByteArrayOutputStream;
 import java.io.NotSerializableException;
+import java.io.ObjectOutputStream;
 import java.util.prefs.PreferenceChangeEvent;
 import java.util.prefs.Preferences;
 
-import tests.util.SerializationTester;
-
 import junit.framework.TestCase;
 
+import org.apache.harmony.testframework.serialization.SerializationTest;
+
 /**
  * 
  */
@@ -74,14 +76,13 @@
 	}
 
 	public void testSerialization() throws Exception {
-		event = new PreferenceChangeEvent(Preferences.userRoot(), "key",
-				"value");
-		try {
-			SerializationTester.writeObject(event, "test.txt");
-			fail();
-		} catch (NotSerializableException e) {
-		}
-
-	}
-
+        event = new PreferenceChangeEvent(Preferences.userRoot(), "key",
+                "value");
+        try {
+            SerializationTest.putObjectToStream(event, new ObjectOutputStream(
+                    new ByteArrayOutputStream()));
+            fail("No expected NotSerializableException");
+        } catch (NotSerializableException e) {
+        }
+    }
 }



Mime
View raw message