[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/options ...

Manik Surtani manik at jboss.org
Wed Mar 7 18:44:00 EST 2007


  User: msurtani
  Date: 07/03/07 18:44:00

  Modified:    tests/functional/org/jboss/cache/options  
                        ExplicitVersionsTest.java
                        ExplicitVersionsReplTest.java
  Log:
  more tests + removed UnmodifiableList wrapper for modifications returned by the transaction entry
  
  Revision  Changes    Path
  1.16      +6 -7      JBossCache/tests/functional/org/jboss/cache/options/ExplicitVersionsTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExplicitVersionsTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/options/ExplicitVersionsTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- ExplicitVersionsTest.java	7 Feb 2007 22:06:47 -0000	1.15
  +++ ExplicitVersionsTest.java	7 Mar 2007 23:44:00 -0000	1.16
  @@ -14,7 +14,6 @@
   import org.jboss.cache.Node;
   import org.jboss.cache.NodeSPI;
   import org.jboss.cache.config.Configuration;
  -import org.jboss.cache.config.Option;
   import org.jboss.cache.optimistic.DataVersion;
   import org.jboss.cache.optimistic.DefaultDataVersion;
   
  @@ -121,7 +120,7 @@
         cache.getInvocationContext().getOptionOverrides().setDataVersion(v);
         cache.put(Fqn.fromString("/org/domain/Entity/EntityInstance#1"), "k", "v");
   
  -      assertEquals(2, ((DefaultDataVersion) ((NodeSPI) cache.get("/org/domain/Entity")).getVersion()).getRawVersion());
  +      assertEquals(1, ((DefaultDataVersion) ((NodeSPI) cache.get("/org/domain/Entity")).getVersion()).getRawVersion());
         assertEquals(v, ((NodeSPI) cache.get("/org/domain/Entity/EntityInstance#1")).getVersion());
      }
   
  @@ -179,8 +178,8 @@
         cache.put(Fqn.fromString("/parent"), "k", "v");
         cache.getTransactionManager().commit();
   
  -      assertEquals(1, ((DefaultDataVersion)((NodeSPI)cache.get("/")).getVersion()).getRawVersion());
  -      assertEquals(vParent, ((NodeSPI)cache.get("/parent")).getVersion());
  +      assertEquals(0, ((DefaultDataVersion) ((NodeSPI) cache.get("/")).getVersion()).getRawVersion());
  +      assertEquals(vParent, ((NodeSPI) cache.get("/parent")).getVersion());
   
         TestVersion vChild = new TestVersion("Child-Version");
   
  @@ -189,9 +188,9 @@
         cache.put(Fqn.fromString("/parent/child"), "k", "v");
         cache.getTransactionManager().commit();
   
  -      assertEquals(1, ((DefaultDataVersion)((NodeSPI)cache.get("/")).getVersion()).getRawVersion());
  -      assertEquals(vParent, ((NodeSPI)cache.get("/parent")).getVersion());
  -      assertEquals(vChild, ((NodeSPI)cache.get("/parent/child")).getVersion());
  +      assertEquals(0, ((DefaultDataVersion) ((NodeSPI) cache.get("/")).getVersion()).getRawVersion());
  +      assertEquals(vParent, ((NodeSPI) cache.get("/parent")).getVersion());
  +      assertEquals(vChild, ((NodeSPI) cache.get("/parent/child")).getVersion());
      }
   
   }
  
  
  
  1.13      +12 -14    JBossCache/tests/functional/org/jboss/cache/options/ExplicitVersionsReplTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExplicitVersionsReplTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/options/ExplicitVersionsReplTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- ExplicitVersionsReplTest.java	7 Feb 2007 22:06:47 -0000	1.12
  +++ ExplicitVersionsReplTest.java	7 Mar 2007 23:44:00 -0000	1.13
  @@ -7,11 +7,9 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.NodeSPI;
   import org.jboss.cache.config.Configuration;
  -import org.jboss.cache.config.Option;
   import org.jboss.cache.misc.TestingUtil;
   import org.jboss.cache.optimistic.DataVersion;
   import org.jboss.cache.optimistic.DefaultDataVersion;
  -import org.jboss.cache.optimistic.DataVersioningException;
   
   import javax.transaction.RollbackException;
   import javax.transaction.TransactionManager;
  @@ -319,9 +317,9 @@
   
         cache[0].put(Fqn.fromString("/org/domain/Entity/EntityInstance#1"), "k", "v");
   
  -      assertEquals(2, ((DefaultDataVersion) ((NodeSPI) cache[0].get("/org/domain/Entity")).getVersion()).getRawVersion());
  +      assertEquals(1, ((DefaultDataVersion) ((NodeSPI) cache[0].get("/org/domain/Entity")).getVersion()).getRawVersion());
         assertEquals(v, ((NodeSPI) cache[0].get("/org/domain/Entity/EntityInstance#1")).getVersion());
  -      assertEquals(2, ((DefaultDataVersion) ((NodeSPI) cache[1].get("/org/domain/Entity")).getVersion()).getRawVersion());
  +      assertEquals(1, ((DefaultDataVersion) ((NodeSPI) cache[1].get("/org/domain/Entity")).getVersion()).getRawVersion());
         assertEquals(v, ((NodeSPI) cache[1].get("/org/domain/Entity/EntityInstance#1")).getVersion());
   
      }
  @@ -349,10 +347,10 @@
         cache[0].put(Fqn.fromString("/parent"), "k", "v");
         cache[0].getTransactionManager().commit();
   
  -      assertEquals(1, ((DefaultDataVersion)((NodeSPI)cache[0].get("/")).getVersion()).getRawVersion());
  -      assertEquals(vParent, ((NodeSPI)cache[0].get("/parent")).getVersion());
  -      assertEquals(1, ((DefaultDataVersion)((NodeSPI)cache[1].get("/")).getVersion()).getRawVersion());
  -      assertEquals(vParent, ((NodeSPI)cache[1].get("/parent")).getVersion());
  +      assertEquals(0, ((DefaultDataVersion) ((NodeSPI) cache[0].get("/")).getVersion()).getRawVersion());
  +      assertEquals(vParent, ((NodeSPI) cache[0].get("/parent")).getVersion());
  +      assertEquals(0, ((DefaultDataVersion) ((NodeSPI) cache[1].get("/")).getVersion()).getRawVersion());
  +      assertEquals(vParent, ((NodeSPI) cache[1].get("/parent")).getVersion());
   
   
         TestVersion vChild = new TestVersion("Child-Version");
  @@ -362,12 +360,12 @@
         cache[0].put(Fqn.fromString("/parent/child"), "k", "v");
         cache[0].getTransactionManager().commit();
   
  -      assertEquals(1, ((DefaultDataVersion)((NodeSPI)cache[0].get("/")).getVersion()).getRawVersion());
  -      assertEquals(vParent, ((NodeSPI)cache[0].get("/parent")).getVersion());
  -      assertEquals(vChild, ((NodeSPI)cache[0].get("/parent/child")).getVersion());
  -      assertEquals(1, ((DefaultDataVersion)((NodeSPI)cache[1].get("/")).getVersion()).getRawVersion());
  -      assertEquals(vParent, ((NodeSPI)cache[1].get("/parent")).getVersion());
  -      assertEquals(vChild, ((NodeSPI)cache[1].get("/parent/child")).getVersion());
  +      assertEquals(1, ((DefaultDataVersion) ((NodeSPI) cache[0].get("/")).getVersion()).getRawVersion());
  +      assertEquals(vParent, ((NodeSPI) cache[0].get("/parent")).getVersion());
  +      assertEquals(vChild, ((NodeSPI) cache[0].get("/parent/child")).getVersion());
  +      assertEquals(1, ((DefaultDataVersion) ((NodeSPI) cache[1].get("/")).getVersion()).getRawVersion());
  +      assertEquals(vParent, ((NodeSPI) cache[1].get("/parent")).getVersion());
  +      assertEquals(vChild, ((NodeSPI) cache[1].get("/parent/child")).getVersion());
   
      }
   }
  
  
  



More information about the jboss-cvs-commits mailing list