[jboss-cvs] JBossAS SVN: r63178 - in branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock: interfaces and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 22 06:17:29 EDT 2007


Author: alex.loubyansky at jboss.com
Date: 2007-05-22 06:17:29 -0400 (Tue, 22 May 2007)
New Revision: 63178

Modified:
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/ejb/FacadeBean.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/interfaces/Facade.java
Log:
JBPAPP-173 sleep before the concurrent transaction commits, not after

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/ejb/FacadeBean.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/ejb/FacadeBean.java	2007-05-21 23:14:04 UTC (rev 63177)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/ejb/FacadeBean.java	2007-05-22 10:17:29 UTC (rev 63178)
@@ -133,7 +133,7 @@
       entity.setIntegerGroup1(new Integer(111));
       entity.setStringGroup2("modified in testKeygenStrategyFail");
       entity.getDoubleGroup1();
-      myHome.create().modifyGroup1InRequiresNew(jndiName, id);
+      myHome.create().modifyGroup1InRequiresNew(jndiName, id, 0);
       log.debug("testKeygenStrategyFail> done");
    }
 
@@ -160,7 +160,7 @@
       entity.setIntegerGroup1(new Integer(111));
       entity.setStringGroup2("modified in testTimestampStrategyFail");
       entity.getDoubleGroup1();
-      myHome.create().modifyGroup1InRequiresNew(jndiName, id);
+      myHome.create().modifyGroup1InRequiresNew(jndiName, id, 1000);
 
       // to make a difference in the timestamp
       Thread.sleep(1000);
@@ -191,7 +191,7 @@
       entity.setIntegerGroup1(new Integer(111));
       entity.setStringGroup2("modified in testVersionStrategyFail");
       entity.getDoubleGroup1();
-      myHome.create().modifyGroup1InRequiresNew(jndiName, id);
+      myHome.create().modifyGroup1InRequiresNew(jndiName, id, 0);
       log.debug("testVersionStrategyFail> done");
    }
 
@@ -205,7 +205,7 @@
       entity.setIntegerGroup1(new Integer(111));
       entity.setStringGroup2("modified in testGroupStrategyPass");
       entity.getDoubleGroup1();
-      myHome.create().modifyGroup1InRequiresNew(jndiName, id);
+      myHome.create().modifyGroup1InRequiresNew(jndiName, id, 0);
       log.debug("testGroupStrategyPass> done");
    }
 
@@ -294,13 +294,18 @@
     * @ejb.interface-method
     * @ejb.transaction type="RequiresNew"
     */
-   public void modifyGroup1InRequiresNew(String jndiName, Integer id) throws Exception
+   public void modifyGroup1InRequiresNew(String jndiName, Integer id, long sleep) throws Exception
    {
       log.debug("modifyGroup1InRequiresNew");
       CmpEntityLocal entity = getCmpEntityHome(jndiName).findByPrimaryKey(id);
       entity.setIntegerGroup1(new Integer(333));
       entity.setStringGroup1("modified by modifyGroup1InRequiresNew");
       entity.setDoubleGroup1(new Double(333.333));
+
+      if(sleep > 0)
+      {
+         Thread.sleep(sleep);
+      }
    }
 
    /**

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/interfaces/Facade.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/interfaces/Facade.java	2007-05-21 23:14:04 UTC (rev 63177)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/cmp2/optimisticlock/interfaces/Facade.java	2007-05-22 10:17:29 UTC (rev 63178)
@@ -76,7 +76,7 @@
    public void modifyGroup2InRequiresNew( String jndiName,Integer id )
       throws Exception, java.rmi.RemoteException;
 
-   public void modifyGroup1InRequiresNew( String jndiName,Integer id )
+   public void modifyGroup1InRequiresNew( String jndiName,Integer id, long sleep )
       throws Exception, java.rmi.RemoteException;
 
    public void testUpdateLockOnSync( String jndiName,Integer id )




More information about the jboss-cvs-commits mailing list