[infinispan-commits] Infinispan SVN: r835 - trunk/core/src/test/java/org/infinispan/marshall.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Fri Sep 18 07:10:19 EDT 2009


Author: galder.zamarreno at jboss.com
Date: 2009-09-18 07:10:19 -0400 (Fri, 18 Sep 2009)
New Revision: 835

Modified:
   trunk/core/src/test/java/org/infinispan/marshall/VersionAwareMarshallerTest.java
Log:
Added MIMECacheEntry marshalling test.

Modified: trunk/core/src/test/java/org/infinispan/marshall/VersionAwareMarshallerTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/marshall/VersionAwareMarshallerTest.java	2009-09-18 10:01:33 UTC (rev 834)
+++ trunk/core/src/test/java/org/infinispan/marshall/VersionAwareMarshallerTest.java	2009-09-18 11:10:19 UTC (rev 835)
@@ -55,6 +55,7 @@
 import org.infinispan.marshall.VersionAwareMarshaller;
 import org.infinispan.marshall.jboss.JBossMarshallingTest.CustomReadObjectMethod;
 import org.infinispan.marshall.jboss.JBossMarshallingTest.ObjectThatContainsACustomReadObjectMethod;
+import org.infinispan.remoting.MIMECacheEntry;
 import org.infinispan.remoting.responses.ExceptionResponse;
 import org.infinispan.remoting.responses.ExtendedResponse;
 import org.infinispan.remoting.responses.RequestIgnoredResponse;
@@ -69,6 +70,8 @@
 import org.infinispan.util.FastCopyHashMap;
 import org.infinispan.util.Immutables;
 import org.infinispan.util.concurrent.TimeoutException;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
 import org.jgroups.stack.IpAddress;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
@@ -83,6 +86,7 @@
 @Test(groups = "functional", testName = "marshall.VersionAwareMarshallerTest")
 public class VersionAwareMarshallerTest {
 
+   private static final Log log = LogFactory.getLog(VersionAwareMarshallerTest.class);
    private final VersionAwareMarshaller marshaller = new VersionAwareMarshaller();
 
    private GlobalTransactionFactory gtf = new GlobalTransactionFactory();
@@ -407,6 +411,15 @@
       marshallAndAssertEquality(obj);
    }
 
+   public void testMIMECacheEntryMarshalling() throws Exception {
+      MIMECacheEntry entry = new MIMECacheEntry("rm", new byte[] {1, 2, 3});
+      byte[] bytes = marshaller.objectToByteBuffer(entry);
+      MIMECacheEntry rEntry = (MIMECacheEntry) marshaller.objectFromByteBuffer(bytes);
+      assert Arrays.equals(rEntry.data, entry.data);
+      assert rEntry.contentType.equals(entry.contentType);
+      assert rEntry.lastModified == entry.lastModified;
+   }
+   
    protected void marshallAndAssertEquality(Object writeObj) throws Exception {
       byte[] bytes = marshaller.objectToByteBuffer(writeObj);
       Object readObj = marshaller.objectFromByteBuffer(bytes);



More information about the infinispan-commits mailing list