[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/util ...
Manik Surtani
manik at jboss.org
Sun Jun 10 17:34:47 EDT 2007
User: msurtani
Date: 07/06/10 17:34:47
Modified: tests/functional/org/jboss/cache/util MapCopyTest.java
Log:
Added test for deserialization with ctx class loaders
Revision Changes Path
1.4 +18 -1 JBossCache/tests/functional/org/jboss/cache/util/MapCopyTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MapCopyTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/util/MapCopyTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- MapCopyTest.java 3 Jan 2007 16:41:33 -0000 1.3
+++ MapCopyTest.java 10 Jun 2007 21:34:47 -0000 1.4
@@ -1,6 +1,8 @@
package org.jboss.cache.util;
import junit.framework.TestCase;
+import org.jboss.util.stream.MarshalledValueInputStream;
+import org.jboss.util.stream.MarshalledValueOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -11,7 +13,6 @@
public class MapCopyTest extends TestCase
{
-
public void testSerializable() throws Exception
{
HashMap hm = new HashMap();
@@ -28,6 +29,22 @@
assertEquals(hm, o);
}
+ public void testSerializableWithMarshalledValueStream() throws Exception
+ {
+ HashMap hm = new HashMap();
+ hm.put(null, null);
+ hm.put("y", "z");
+ MapCopy mc = new MapCopy(hm);
+ assertEquals(hm, mc);
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new MarshalledValueOutputStream(os);
+ oos.writeObject(mc);
+ ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
+ ObjectInputStream ois = new MarshalledValueInputStream(is);
+ Object o = ois.readObject();
+ assertEquals(hm, o);
+ }
+
public void testNull()
{
HashMap hm = new HashMap();
More information about the jboss-cvs-commits
mailing list