dain 2005/03/01 18:34:39
Modified:
modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/manytomany
ManyToManyCompoundPKTest.java ManyToManyTest.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.3 +20 -19
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/manytomany/ManyToManyCompoundPKTest.java
Index: ManyToManyCompoundPKTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/manytomany/ManyToManyCompoundPKTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ManyToManyCompoundPKTest.java 11 Nov 2004 13:27:44 -0000 1.2
+++ ManyToManyCompoundPKTest.java 1 Mar 2005 23:34:38 -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();
a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1), "value1"));
Set bSet = a.getB();
assertEquals(2, bSet.size());
@@ -84,10 +84,11 @@
fail();
}
}
+ ctx.commit();
}
public void testBGetAExistingAB() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
BLocal b = bhome.findByPrimaryKey(new Integer(22));
Set aSet = b.getA();
assertEquals(3, aSet.size());
@@ -118,7 +119,7 @@
}
public void testASetBDropExisting() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
ALocal a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1),
"value1"));
a.setB(new HashSet());
a = ahome.findByPrimaryKey(new CompoundPK(new Integer(2), "value2"));
@@ -131,7 +132,7 @@
}
public void testBSetADropExisting() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
BLocal b = bhome.findByPrimaryKey(new Integer(11));
b.setA(new HashSet());
b = bhome.findByPrimaryKey(new Integer(22));
@@ -141,10 +142,10 @@
assertStateDropExisting();
}
- private ContainerTransactionContext prepareNewAB() throws Exception {
+ private TransactionContext prepareNewAB() throws Exception {
CompoundPK pkA = new CompoundPK(new Integer(4), "value4");
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
a = ahome.create(pkA);
b = bhome.create(new Integer(33));
b.setField2("value33");
@@ -172,7 +173,7 @@
}
public void testASetBNewAB() throws Exception {
- ContainerTransactionContext ctx = prepareNewAB();
+ TransactionContext ctx = prepareNewAB();
Set bSet = a.getB();
bSet.add(b);
ctx.commit();
@@ -181,7 +182,7 @@
}
public void testBSetANewAB() throws Exception {
- ContainerTransactionContext ctx = prepareNewAB();
+ TransactionContext ctx = prepareNewAB();
Set aSet = b.getA();
aSet.add(a);
ctx.commit();
@@ -189,10 +190,10 @@
assertStateNewAB();
}
- private ContainerTransactionContext prepareExistingBNewA() throws
Exception {
+ private TransactionContext prepareExistingBNewA() throws Exception {
CompoundPK pkA = new CompoundPK(new Integer(4), "value4");
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
a = ahome.create(pkA);
b = bhome.findByPrimaryKey(new Integer(11));
return ctx;
@@ -215,7 +216,7 @@
}
public void testASetBExistingBNewA() throws Exception {
- ContainerTransactionContext ctx = prepareExistingBNewA();
+ TransactionContext ctx = prepareExistingBNewA();
Set bSet = a.getB();
bSet.add(b);
ctx.commit();
@@ -224,7 +225,7 @@
}
public void testBSetAExistingBNewA() throws Exception {
- ContainerTransactionContext ctx = prepareExistingBNewA();
+ TransactionContext ctx = prepareExistingBNewA();
Set aSet = b.getA();
aSet.add(a);
ctx.commit();
@@ -232,10 +233,10 @@
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");
@@ -259,7 +260,7 @@
}
public void testASetBExistingANewB() throws Exception {
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
Set bSet = a.getB();
bSet.add(b);
ctx.commit();
@@ -268,7 +269,7 @@
}
public void testBSetAExistingANewB() throws Exception {
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
Set aSet = b.getA();
aSet.add(a);
ctx.commit();
@@ -277,7 +278,7 @@
}
public void testRemoveRelationships() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
ALocal a = ahome.findByPrimaryKey(new CompoundPK(new Integer(1),
"value1"));
a.remove();
ctx.commit();
1.3 +20 -19
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/manytomany/ManyToManyTest.java
Index: ManyToManyTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/manytomany/ManyToManyTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ManyToManyTest.java 11 Nov 2004 13:27:44 -0000 1.2
+++ ManyToManyTest.java 1 Mar 2005 23:34:38 -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();
a = ahome.findByPrimaryKey(new Integer(1));
Set bSet = a.getB();
assertEquals(2, bSet.size());
@@ -83,10 +83,11 @@
fail();
}
}
+ ctx.commit();
}
public void testBGetAExistingAB() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
BLocal b = bhome.findByPrimaryKey(new Integer(22));
Set aSet = b.getA();
assertEquals(3, aSet.size());
@@ -117,7 +118,7 @@
}
public void testASetBDropExisting() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
ALocal a = ahome.findByPrimaryKey(new Integer(1));
a.setB(new HashSet());
a = ahome.findByPrimaryKey(new Integer(2));
@@ -130,7 +131,7 @@
}
public void testBSetADropExisting() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
BLocal b = bhome.findByPrimaryKey(new Integer(11));
b.setA(new HashSet());
b = bhome.findByPrimaryKey(new Integer(22));
@@ -140,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(4));
a.setField2("value4");
b = bhome.create(new Integer(33));
@@ -170,7 +171,7 @@
}
public void testASetBNewAB() throws Exception {
- ContainerTransactionContext ctx = prepareNewAB();
+ TransactionContext ctx = prepareNewAB();
Set bSet = a.getB();
bSet.add(b);
ctx.commit();
@@ -179,7 +180,7 @@
}
public void testBSetANewAB() throws Exception {
- ContainerTransactionContext ctx = prepareNewAB();
+ TransactionContext ctx = prepareNewAB();
Set aSet = b.getA();
aSet.add(a);
ctx.commit();
@@ -187,8 +188,8 @@
assertStateNewAB();
}
- private ContainerTransactionContext prepareExistingBNewA() throws
Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ private TransactionContext prepareExistingBNewA() throws Exception {
+ TransactionContext ctx = newTransactionContext();
a = ahome.create(new Integer(4));
a.setField2("value4");
b = bhome.findByPrimaryKey(new Integer(11));
@@ -212,7 +213,7 @@
}
public void testASetBExistingBNewA() throws Exception {
- ContainerTransactionContext ctx = prepareExistingBNewA();
+ TransactionContext ctx = prepareExistingBNewA();
Set bSet = a.getB();
bSet.add(b);
ctx.commit();
@@ -221,7 +222,7 @@
}
public void testBSetAExistingBNewA() throws Exception {
- ContainerTransactionContext ctx = prepareExistingBNewA();
+ TransactionContext ctx = prepareExistingBNewA();
Set aSet = b.getA();
aSet.add(a);
ctx.commit();
@@ -229,8 +230,8 @@
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");
@@ -254,7 +255,7 @@
}
public void testASetBExistingANewB() throws Exception {
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
Set bSet = a.getB();
bSet.add(b);
ctx.commit();
@@ -263,7 +264,7 @@
}
public void testBSetAExistingANewB() throws Exception {
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
Set aSet = b.getA();
aSet.add(a);
ctx.commit();
@@ -272,7 +273,7 @@
}
public void testRemoveRelationships() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
ALocal a = ahome.findByPrimaryKey(new Integer(1));
a.remove();
ctx.commit();