[weld-commits] Weld SVN: r6956 - in cdi-tck/branches/1.0: impl/src/main/java/org/jboss/jsr299/tck and 1 other directory.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Aug 10 17:27:45 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-08-10 17:27:44 -0400 (Tue, 10 Aug 2010)
New Revision: 6956

Modified:
   cdi-tck/branches/1.0/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
Log:
CDITCK-94

Modified: cdi-tck/branches/1.0/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
===================================================================
--- cdi-tck/branches/1.0/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java	2010-08-10 21:16:42 UTC (rev 6955)
+++ cdi-tck/branches/1.0/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java	2010-08-10 21:27:44 UTC (rev 6956)
@@ -16,6 +16,8 @@
  */
 package org.jboss.jsr299.tck.spi;
 
+import java.io.IOException;
+
 /**
  * Provides Bean related operations.
  * 
@@ -41,5 +43,21 @@
     * @return true if the object is a proxy
     */
    public boolean isProxy(Object instance);
+
+   /**
+    * Serializes the object tree starting with the bean instance provided.
+    *
+    * @param instance The bean instance to serialize
+    * @return the serialized byte array of the bean instance
+    */
+   public byte[] serialize(Object instance) throws IOException;
+
+   /**
+    * Deserializes a bean instance from the given serialized bytes.
+    *
+    * @param bytes The serialized byte stream of a bean instance
+    * @return the serialized byte array of the bean instance
+    */
+   public Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException;
    
 }

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java	2010-08-10 21:16:42 UTC (rev 6955)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java	2010-08-10 21:27:44 UTC (rev 6956)
@@ -51,16 +51,12 @@
 
    protected byte[] serialize(Object instance) throws IOException
    {
-      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
-      ObjectOutputStream out = new ObjectOutputStream(bytes);
-      out.writeObject(instance);
-      return bytes.toByteArray();
+      return getCurrentConfiguration().getBeans().serialize(instance);
    }
 
    protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
    {
-      ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
-      return in.readObject();
+      return getCurrentConfiguration().getBeans().deserialize(bytes);
    }
 
    protected void setContextActive(Context context)



More information about the weld-commits mailing list