dain        2005/03/01 18:34:39

  Modified:    
modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany
                        OneToManyCascadeDeleteTest.java
                        OneToManyCompoundPKCascadeDeleteTest.java
                        OneToManyCompoundPKTest.java OneToManyTest.java
  Log:

  Changed to use new TransactionManagerContext methods managing bean 
transactions
  Fixed improper handling of bean transactions in StatefulInstanceInterceptor
  Removed excessive handling of bean transactions in the SFSB and SLSB vops
  
  Revision  Changes    Path
  1.2       +3 -3      
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyCascadeDeleteTest.java
  
  Index: OneToManyCascadeDeleteTest.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyCascadeDeleteTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OneToManyCascadeDeleteTest.java   11 Nov 2004 13:27:45 -0000      1.1
  +++ OneToManyCascadeDeleteTest.java   1 Mar 2005 23:34:39 -0000       1.2
  @@ -52,7 +52,7 @@
   import java.sql.SQLException;

   import java.sql.Statement;

   

  -import org.apache.geronimo.transaction.context.ContainerTransactionContext;

  +import org.apache.geronimo.transaction.context.TransactionContext;

   import org.openejb.deployment.entity.cmp.cmr.AbstractCMRTest;

   import org.openejb.deployment.entity.cmp.cmr.CompoundPK;

   

  @@ -67,7 +67,7 @@
       private BLocal b;

   

       public void testCascadeDelete() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1), 
"value1"));

           a.remove();

           ctx.commit();

  
  
  
  1.2       +3 -3      
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyCompoundPKCascadeDeleteTest.java
  
  Index: OneToManyCompoundPKCascadeDeleteTest.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyCompoundPKCascadeDeleteTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OneToManyCompoundPKCascadeDeleteTest.java 11 Nov 2004 13:27:45 -0000      
1.1
  +++ OneToManyCompoundPKCascadeDeleteTest.java 1 Mar 2005 23:34:39 -0000       
1.2
  @@ -52,7 +52,7 @@
   import java.sql.SQLException;

   import java.sql.Statement;

   

  -import org.apache.geronimo.transaction.context.ContainerTransactionContext;

  +import org.apache.geronimo.transaction.context.TransactionContext;

   import org.openejb.deployment.entity.cmp.cmr.AbstractCMRTest;

   import org.openejb.deployment.entity.cmp.cmr.CompoundPK;

   

  @@ -67,7 +67,7 @@
       private BLocal b;

   

       public void testCascadeDelete() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1), 
"value1"));

           a.remove();

           ctx.commit();

  
  
  
  1.3       +19 -19    
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyCompoundPKTest.java
  
  Index: OneToManyCompoundPKTest.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyCompoundPKTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OneToManyCompoundPKTest.java      11 Nov 2004 13:27:45 -0000      1.2
  +++ OneToManyCompoundPKTest.java      1 Mar 2005 23:34:39 -0000       1.3
  @@ -55,7 +55,7 @@
   import java.util.Iterator;

   import java.util.Set;

   

  -import org.apache.geronimo.transaction.context.ContainerTransactionContext;

  +import org.apache.geronimo.transaction.context.TransactionContext;

   import org.openejb.deployment.entity.cmp.cmr.AbstractCMRTest;

   import org.openejb.deployment.entity.cmp.cmr.CompoundPK;

   

  @@ -70,7 +70,7 @@
       private BLocal b;

   

       public void testAGetBExistingAB() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1), 
"value1"));

           Set bSet = a.getB();

           assertEquals(2, bSet.size());

  @@ -88,7 +88,7 @@
       }

       

       public void testBGetAExistingAB() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           BLocal b = bhome.findByPrimaryKey(new Integer(11));

           ALocal a = b.getA();

           assertNotNull(a);

  @@ -119,7 +119,7 @@
        * DB DataSource successfully.

        */

       public void XtestASetBDropExisting() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1), 
"value1"));

           a.setB(new HashSet());

           ctx.commit();

  @@ -132,7 +132,7 @@
        * DB DataSource successfully.

        */

       public void XtestBSetADropExisting() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           BLocal b = bhome.findByPrimaryKey(new Integer(11));

           b.setA(null);

           b = bhome.findByPrimaryKey(new Integer(22));

  @@ -142,10 +142,10 @@
           assertStateDropExisting();

       }

       

  -    private ContainerTransactionContext prepareNewAB() throws Exception {

  +    private TransactionContext prepareNewAB() throws Exception {

           CompoundPK pkA = new CompoundPK(new Integer(2), "value2");

           

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           a = ahome.create(pkA);

           b = bhome.create(new Integer(22));

           b.setField2("value22");

  @@ -170,7 +170,7 @@
       }

       

       public void testASetBNewAB() throws Exception {

  -        ContainerTransactionContext ctx = prepareNewAB();

  +        TransactionContext ctx = prepareNewAB();

           Set bSet = new HashSet();

           bSet.add(b);

           a.setB(bSet);

  @@ -180,17 +180,17 @@
       }

   

       public void testBSetANewAB() throws Exception {

  -        ContainerTransactionContext ctx = prepareNewAB();

  +        TransactionContext ctx = prepareNewAB();

           b.setA(a);

           ctx.commit();

           

           assertStateNewAB();

       }

       

  -    private ContainerTransactionContext prepareExistingBNewA() throws 
Exception {

  +    private TransactionContext prepareExistingBNewA() throws Exception {

           CompoundPK pkA = new CompoundPK(new Integer(2), "value2");

   

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           a = ahome.create(pkA);

           b = bhome.findByPrimaryKey(new Integer(11));

           return ctx;

  @@ -214,7 +214,7 @@
       }

       

       public void testASetBExistingBNewA() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingBNewA();

  +        TransactionContext ctx = prepareExistingBNewA();

           Set bSet = a.getB();

           bSet.add(b);

           ctx.commit();

  @@ -223,17 +223,17 @@
       }

   

       public void testBSetAExistingBNewA() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingBNewA();

  +        TransactionContext ctx = prepareExistingBNewA();

           b.setA(a);

           ctx.commit();

           

           assertStateExistingBNewA();

       }

       

  -    private ContainerTransactionContext prepareExistingANewB() throws 
Exception {

  +    private TransactionContext prepareExistingANewB() throws Exception {

           CompoundPK pkA = new CompoundPK(new Integer(1), "value1");

           

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           a = ahome.findByPrimaryKey(pkA);

           b = bhome.create(new Integer(33));

           b.setField2("value33");

  @@ -257,7 +257,7 @@
       }

       

       public void testASetBExistingANewB() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingANewB();

  +        TransactionContext ctx = prepareExistingANewB();

           Set bSet = a.getB();

           bSet.add(b);

           ctx.commit();

  @@ -266,7 +266,7 @@
       }

   

       public void testBSetAExistingANewB() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingANewB();

  +        TransactionContext ctx = prepareExistingANewB();

           b.setA(a);

           ctx.commit();

           

  @@ -278,7 +278,7 @@
        * DB DataSource successfully.

        */

       public void XtestRemoveRelationships() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1), 
"value1"));

           a.remove();

           ctx.commit();

  
  
  
  1.3       +19 -19    
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyTest.java
  
  Index: OneToManyTest.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetomany/OneToManyTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OneToManyTest.java        11 Nov 2004 13:27:45 -0000      1.2
  +++ OneToManyTest.java        1 Mar 2005 23:34:39 -0000       1.3
  @@ -55,7 +55,7 @@
   import java.util.Iterator;

   import java.util.Set;

   

  -import org.apache.geronimo.transaction.context.ContainerTransactionContext;

  +import org.apache.geronimo.transaction.context.TransactionContext;

   import org.openejb.deployment.entity.cmp.cmr.AbstractCMRTest;

   

   /**

  @@ -69,7 +69,7 @@
       private BLocal b;

   

       public void testAGetBExistingAB() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new Integer(1));

           Set bSet = a.getB();

           assertEquals(2, bSet.size());

  @@ -87,7 +87,7 @@
       }

       

       public void testBGetAExistingAB() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           BLocal b = bhome.findByPrimaryKey(new Integer(11));

           ALocal a = b.getA();

           assertNotNull(a);

  @@ -118,7 +118,7 @@
        * DB DataSource successfully.

        */

       public void XtestASetBDropExisting() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new Integer(1));

           a.setB(new HashSet());

           ctx.commit();

  @@ -131,7 +131,7 @@
        * DB DataSource successfully.

        */

       public void XtestBSetADropExisting() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           BLocal b = bhome.findByPrimaryKey(new Integer(11));

           b.setA(null);

           b = bhome.findByPrimaryKey(new Integer(22));

  @@ -141,8 +141,8 @@
           assertStateDropExisting();

       }

       

  -    private ContainerTransactionContext prepareNewAB() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +    private TransactionContext prepareNewAB() throws Exception {

  +        TransactionContext ctx = newTransactionContext();

           a = ahome.create(new Integer(2));

           a.setField2("value2");

           b = bhome.create(new Integer(22));

  @@ -168,7 +168,7 @@
       }

       

       public void testASetBNewAB() throws Exception {

  -        ContainerTransactionContext ctx = prepareNewAB();

  +        TransactionContext ctx = prepareNewAB();

           Set bSet = new HashSet();

           bSet.add(b);

           a.setB(bSet);

  @@ -178,15 +178,15 @@
       }

   

       public void testBSetANewAB() throws Exception {

  -        ContainerTransactionContext ctx = prepareNewAB();

  +        TransactionContext ctx = prepareNewAB();

           b.setA(a);

           ctx.commit();

           

           assertStateNewAB();

       }

       

  -    private ContainerTransactionContext prepareExistingBNewA() throws 
Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +    private TransactionContext prepareExistingBNewA() throws Exception {

  +        TransactionContext ctx = newTransactionContext();

           a = ahome.create(new Integer(2));

           a.setField2("value2");

           b = bhome.findByPrimaryKey(new Integer(11));

  @@ -211,7 +211,7 @@
       }

       

       public void testASetBExistingBNewA() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingBNewA();

  +        TransactionContext ctx = prepareExistingBNewA();

           Set bSet = a.getB();

           bSet.add(b);

           ctx.commit();

  @@ -220,15 +220,15 @@
       }

   

       public void testBSetAExistingBNewA() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingBNewA();

  +        TransactionContext ctx = prepareExistingBNewA();

           b.setA(a);

           ctx.commit();

           

           assertStateExistingBNewA();

       }

       

  -    private ContainerTransactionContext prepareExistingANewB() throws 
Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +    private TransactionContext prepareExistingANewB() throws Exception {

  +        TransactionContext ctx = newTransactionContext();

           a = ahome.findByPrimaryKey(new Integer(1));

           b = bhome.create(new Integer(33));

           b.setField2("value33");

  @@ -251,7 +251,7 @@
       }

       

       public void testASetBExistingANewB() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingANewB();

  +        TransactionContext ctx = prepareExistingANewB();

           Set bSet = a.getB();

           bSet.add(b);

           ctx.commit();

  @@ -260,7 +260,7 @@
       }

   

       public void testBSetAExistingANewB() throws Exception {

  -        ContainerTransactionContext ctx = prepareExistingANewB();

  +        TransactionContext ctx = prepareExistingANewB();

           b.setA(a);

           ctx.commit();

           

  @@ -272,7 +272,7 @@
        * DB DataSource successfully.

        */

       public void XtestRemoveRelationships() throws Exception {

  -        ContainerTransactionContext ctx = newTransactionContext();

  +        TransactionContext ctx = newTransactionContext();

           ALocal a = ahome.findByPrimaryKey(new Integer(1));

           a.remove();

           ctx.commit();

  
  
  

Reply via email to