[jboss-cvs] JBossAS SVN: r107041 - projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 22 18:12:48 EDT 2010


Author: pferraro
Date: 2010-07-22 18:12:47 -0400 (Thu, 22 Jul 2010)
New Revision: 107041

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/SessionAttributeMarshallerTest.java
Log:
Validate serializability

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/SessionAttributeMarshallerTest.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/SessionAttributeMarshallerTest.java	2010-07-22 22:06:35 UTC (rev 107040)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/SessionAttributeMarshallerTest.java	2010-07-22 22:12:47 UTC (rev 107041)
@@ -40,10 +40,11 @@
    private final LocalDistributableSessionManager manager = EasyMock.createStrictMock(LocalDistributableSessionManager.class);
    
    private final SessionAttributeMarshaller marshaller = new SessionAttributeMarshallerImpl(this.manager, new MarshalledValueObjectStreamSource());
+   
    @Test
    public void test() throws IOException, ClassNotFoundException
    {
-      this.test(null, true);
+      this.test((Serializable) null, true);
       this.test("test", true);
       this.test(Boolean.TRUE, true);
       this.test(Byte.valueOf(Byte.MAX_VALUE), true);
@@ -83,13 +84,21 @@
       {
          Object marshalled = this.marshaller.marshal(original);
          
+         if (original != null)
+         {
+            Assert.assertTrue(original instanceof Serializable);
+         }
+         if (marshalled != null)
+         {
+            Assert.assertTrue(marshalled instanceof Serializable);
+         }
+         
          if (same)
          {
             Assert.assertSame(original, marshalled);
          }
          else
          {
-            Assert.assertTrue(marshalled instanceof Serializable);
             Assert.assertNotSame(original, marshalled);
          }
          
@@ -111,7 +120,6 @@
          }
          else
          {
-            Assert.assertTrue(marshalled instanceof Serializable);
             Assert.assertNotSame(marshalled, unmarshalled);
             Assert.assertEquals(original, unmarshalled);
          }



More information about the jboss-cvs-commits mailing list