dain 2005/02/14 22:24:05
Modified: modules/itests/src/itest/org/openejb/test/stateful
StatefulAllowedOperationsTests.java
StatefulEjbObjectTests.java
Log:
o Finished GERONIMO-181 Transaction propogation accross calls to stateful
session beans
o Added code resume and suspend the BMT transaction to
StatefulInstanceInterceptor. This code must be here because the instance
context holds the suspended transaction, and this context is not available in
the transaction interceptor. Also the code that "finds" the correct instance
relies on the transaction context already being established
o Enabled stateful tests for session synchronization callbacks
o Session synchronization callbacks now go through the system interceptor
chain
o Container policies now setRollbackOnly and throw a
TransactionRolledbac[Local]Exception when a system exception is thrown in an
inherited transaction
o Fixed GERONIMO-579 UserTransaction broken after BMT calls BMT
o Added support for ejb-ql back into the openejb-jar.xml file so 1.1 beans
can use ejb-ql for a query specification
o Fixed client side handle serialization code
o Fixed stateful session ejb object isIdentical code; was not comparing
primary key
o Fixed handling of remove methods
Revision Changes Path
1.2 +68 -70
openejb/modules/itests/src/itest/org/openejb/test/stateful/StatefulAllowedOperationsTests.java
Index: StatefulAllowedOperationsTests.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/itest/org/openejb/test/stateful/StatefulAllowedOperationsTests.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatefulAllowedOperationsTests.java 8 Sep 2004 07:20:14 -0000
1.1
+++ StatefulAllowedOperationsTests.java 15 Feb 2005 03:24:05 -0000
1.2
@@ -161,8 +161,8 @@
public void test01_setSessionContext() {
try {
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("setSessionContext");
@@ -172,7 +172,6 @@
} catch (Exception e) {
fail("Received Exception " + e.getClass() + " : " +
e.getMessage());
}
-
}
/**
@@ -194,13 +193,13 @@
public void test02_ejbCreate() {
try {
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("ejbCreate");
@@ -236,13 +235,13 @@
// in a static when calling the bean
//
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("ejbRemove");
@@ -277,13 +276,13 @@
// This test is not really possible as it requires a forced
passivation and activation
//
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("ejbActivate");
@@ -318,13 +317,13 @@
// This test is not really possible as it requires a forced
passivation and activation
//
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("ejbPassivate");
@@ -358,15 +357,15 @@
public void test06_businessMethod() {
try {
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_getRollbackOnly);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_setRollbackOnly);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_getRollbackOnly);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ //policy.allow(OperationsPolicy.Context_setRollbackOnly);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("businessMethod");
@@ -377,7 +376,6 @@
} catch (Exception e) {
fail("Received Exception " + e.getClass() + " : " +
e.getMessage());
}
-
}
/**
@@ -398,22 +396,22 @@
*
______________________|__________________________________________________
* </PRE>
*/
- public void TODO_test07_afterBegin() {
+ public void test07_afterBegin() {
try {
//
// todo should this be deleated?
// This is a container managed bean so this should never be
called
//
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_getRollbackOnly);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_setRollbackOnly);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_getRollbackOnly);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ //policy.allow(OperationsPolicy.Context_setRollbackOnly);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("afterBegin");
@@ -444,22 +442,22 @@
*
______________________|__________________________________________________
* </PRE>
*/
- public void TODO_test08_beforeCompletion() {
+ public void test08_beforeCompletion() {
try {
//
// todo should this be deleated?
// This is a container managed bean so this should never be
called
//
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_getRollbackOnly);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_setRollbackOnly);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_getRollbackOnly);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ //policy.allow(OperationsPolicy.Context_setRollbackOnly);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("beforeCompletion");
@@ -488,20 +486,20 @@
*
______________________|__________________________________________________
* </PRE>
*/
- public void TODO_test09_afterCompletion() {
+ public void test09_afterCompletion() {
try {
//
// todo should this be deleated?
// This is a container managed bean so this should never be
called
//
OperationsPolicy policy = new OperationsPolicy();
- policy.allow(policy.Context_getEJBHome);
- policy.allow(policy.Context_getCallerPrincipal);
- policy.allow(policy.Context_isCallerInRole);
- policy.allow(policy.Context_getEJBObject);
- policy.allow(policy.JNDI_access_to_java_comp_env);
- policy.allow(policy.Resource_manager_access);
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
+ policy.allow(OperationsPolicy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
Object expected = policy;
Object actual =
ejbObject.getAllowedOperationsReport("afterCompletion");
1.3 +2 -2
openejb/modules/itests/src/itest/org/openejb/test/stateful/StatefulEjbObjectTests.java
Index: StatefulEjbObjectTests.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/itest/org/openejb/test/stateful/StatefulEjbObjectTests.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StatefulEjbObjectTests.java 13 Oct 2004 18:53:26 -0000 1.2
+++ StatefulEjbObjectTests.java 15 Feb 2005 03:24:05 -0000 1.3
@@ -111,7 +111,7 @@
*/
public void test04_getPrimaryKey() {
try {
- Object key = ejbObject.getPrimaryKey();
+ ejbObject.getPrimaryKey();
} catch (java.rmi.RemoteException e) {
assertTrue(true);
return;