[jbosscache-commits] JBoss Cache SVN: r5490 - core/trunk/src/test/java/org/jboss/cache/marshall.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Apr 2 04:29:46 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-04-02 04:29:46 -0400 (Wed, 02 Apr 2008)
New Revision: 5490

Modified:
   core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java
Log:
Updated to deal with new versioning headers

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java	2008-04-02 01:32:05 UTC (rev 5489)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java	2008-04-02 08:29:46 UTC (rev 5490)
@@ -40,9 +40,12 @@
 
    public void testMarshallerSelection()
    {
-      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.1.0.GA");
+      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.2.0.GA");
       assertEquals(CacheMarshaller210.class, marshaller.defaultMarshaller.getClass());
 
+      marshaller = createVAMandRestartCache("2.1.0.GA");
+      assertEquals(CacheMarshaller210.class, marshaller.defaultMarshaller.getClass());
+
       marshaller = createVAMandRestartCache("2.0.0.GA");
       assertEquals(CacheMarshaller200.class, marshaller.defaultMarshaller.getClass());
 
@@ -75,6 +78,16 @@
       byte[] bytes = marshaller.objectToByteBuffer("Hello");
       ObjectStreamPool pool = (ObjectStreamPool) TestingUtil.extractField(marshaller, "pool");
       ObjectInputStream in = pool.getInputStream(bytes);
+      assertEquals("Version header short should be '22'", 22, in.readShort());
+   }
+
+   public void testVersionHeader210() throws Exception
+   {
+      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.1.0.GA");
+
+      byte[] bytes = marshaller.objectToByteBuffer("Hello");
+      ObjectStreamPool pool = (ObjectStreamPool) TestingUtil.extractField(marshaller, "pool");
+      ObjectInputStream in = pool.getInputStream(bytes);
       assertEquals("Version header short should be '21'", 21, in.readShort());
    }
 
@@ -87,5 +100,4 @@
       ObjectInputStream in = pool.getInputStream(bytes);
       assertEquals("Version header short should be '20'", 20, in.readShort());
    }
-
 }




More information about the jbosscache-commits mailing list