dain 2005/03/01 18:34:40
Modified:
modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetoone
OneToOneCompoundPKTest.java OneToOneTest.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 -20
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetoone/OneToOneCompoundPKTest.java
Index: OneToOneCompoundPKTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetoone/OneToOneCompoundPKTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- OneToOneCompoundPKTest.java 11 Nov 2004 13:27:45 -0000 1.2
+++ OneToOneCompoundPKTest.java 1 Mar 2005 23:34:39 -0000 1.3
@@ -53,7 +53,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;
@@ -68,7 +68,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"));
BLocal b = a.getB();
assertNotNull(b);
@@ -78,7 +78,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);
@@ -103,7 +103,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(null);
ctx.commit();
@@ -116,7 +116,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);
ctx.commit();
@@ -124,10 +124,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");
@@ -152,7 +152,7 @@
}
public void testASetBNewAB() throws Exception {
- ContainerTransactionContext ctx = prepareNewAB();
+ TransactionContext ctx = prepareNewAB();
a.setB(b);
ctx.commit();
@@ -160,17 +160,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;
@@ -194,7 +194,7 @@
}
public void testASetBExistingBNewA() throws Exception {
- ContainerTransactionContext ctx = prepareExistingBNewA();
+ TransactionContext ctx = prepareExistingBNewA();
a.setB(b);
ctx.commit();
@@ -202,17 +202,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(22));
b.setField2("value22");
@@ -242,7 +242,7 @@
* @see OneToOneTest for more details.
*/
public void XtestASetBExistingANewB() throws Exception {
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
a.setB(b);
ctx.commit();
@@ -255,7 +255,7 @@
* @see OneToOneTest for more details.
*/
public void XtestBSetAExistingANewB() throws Exception {
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
b.setA(a);
ctx.commit();
@@ -267,7 +267,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();
@@ -287,7 +287,7 @@
}
public void testCascadeDelete() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
BLocal b = bhome.findByPrimaryKey(new Integer(11));
b.remove();
ctx.commit();
1.3 +20 -20
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetoone/OneToOneTest.java
Index: OneToOneTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/onetoone/OneToOneTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- OneToOneTest.java 11 Nov 2004 13:27:45 -0000 1.2
+++ OneToOneTest.java 1 Mar 2005 23:34:39 -0000 1.3
@@ -53,7 +53,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;
/**
@@ -67,7 +67,7 @@
private BLocal b;
public void testAGetBExistingAB() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
ALocal a = ahome.findByPrimaryKey(new Integer(1));
BLocal b = a.getB();
assertNotNull(b);
@@ -77,7 +77,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);
@@ -102,7 +102,7 @@
* DB DataSource successfully.
*/
public void XtestASetBDropExisting() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
ALocal a = ahome.findByPrimaryKey(new Integer(1));
a.setB(null);
ctx.commit();
@@ -115,7 +115,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);
ctx.commit();
@@ -123,8 +123,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));
@@ -150,7 +150,7 @@
}
public void testASetBNewAB() throws Exception {
- ContainerTransactionContext ctx = prepareNewAB();
+ TransactionContext ctx = prepareNewAB();
a.setB(b);
ctx.commit();
@@ -158,15 +158,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));
@@ -191,7 +191,7 @@
}
public void testASetBExistingBNewA() throws Exception {
- ContainerTransactionContext ctx = prepareExistingBNewA();
+ TransactionContext ctx = prepareExistingBNewA();
a.setB(b);
ctx.commit();
@@ -199,15 +199,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(22));
b.setField2("value22");
@@ -246,7 +246,7 @@
// ps.setInt(5, 1);
// ps.execute();
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
a.setB(b);
ctx.commit();
@@ -258,7 +258,7 @@
* DB DataSource successfully.
*/
public void XtestBSetAExistingANewB() throws Exception {
- ContainerTransactionContext ctx = prepareExistingANewB();
+ TransactionContext ctx = prepareExistingANewB();
b.setA(a);
ctx.commit();
@@ -270,7 +270,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();
@@ -290,7 +290,7 @@
}
public void testCascadeDelete() throws Exception {
- ContainerTransactionContext ctx = newTransactionContext();
+ TransactionContext ctx = newTransactionContext();
BLocal b = bhome.findByPrimaryKey(new Integer(11));
b.remove();
ctx.commit();