dain 2005/02/14 22:24:05
Modified: modules/itests/src/java/org/openejb/test/stateful
BasicStatefulBean.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.5 +22 -16
openejb/modules/itests/src/java/org/openejb/test/stateful/BasicStatefulBean.java
Index: BasicStatefulBean.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/java/org/openejb/test/stateful/BasicStatefulBean.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BasicStatefulBean.java 16 Sep 2004 15:33:29 -0000 1.4
+++ BasicStatefulBean.java 15 Feb 2005 03:24:05 -0000 1.5
@@ -62,7 +62,10 @@
private String name;
private SessionContext ejbContext;
private Hashtable allowedOperationsTable = new Hashtable();
-
+
+ public String getName() {
+ return name;
+ }
//=============================
// Home interface methods
@@ -220,43 +223,46 @@
/*[1] Test getEJBHome /////////////////*/
try{
ejbContext.getEJBHome();
- policy.allow(policy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
}catch(IllegalStateException ise){}
/*[2] Test getCallerPrincipal /////////*/
try{
ejbContext.getCallerPrincipal();
- policy.allow( policy.Context_getCallerPrincipal );
+ policy.allow( OperationsPolicy.Context_getCallerPrincipal );
}catch(IllegalStateException ise){}
/*[3] Test isCallerInRole /////////////*/
try{
ejbContext.isCallerInRole("ROLE");
- policy.allow( policy.Context_isCallerInRole );
+ policy.allow( OperationsPolicy.Context_isCallerInRole );
}catch(IllegalStateException ise){}
/*[4] Test getRollbackOnly ////////////*/
try{
ejbContext.getRollbackOnly();
- policy.allow( policy.Context_getRollbackOnly );
+ policy.allow( OperationsPolicy.Context_getRollbackOnly );
}catch(IllegalStateException ise){}
- /*[5] Test setRollbackOnly ////////////*/
- try{
- ejbContext.setRollbackOnly();
- policy.allow( policy.Context_setRollbackOnly );
- }catch(IllegalStateException ise){}
+ /*[5] Test setRollbackOnly ////////////*/
+ //
+ // this can not be effectively tested right now
+ //
+ //try{
+ // ejbContext.setRollbackOnly();
+ // policy.allow( OperationsPolicy.Context_setRollbackOnly );
+ //}catch(IllegalStateException ise){}
/*[6] Test getUserTransaction /////////*/
try{
ejbContext.getUserTransaction();
- policy.allow( policy.Context_getUserTransaction );
+ policy.allow( OperationsPolicy.Context_getUserTransaction );
}catch(IllegalStateException ise){}
/*[7] Test getEJBObject ///////////////*/
try{
ejbContext.getEJBObject();
- policy.allow( policy.Context_getEJBObject );
+ policy.allow( OperationsPolicy.Context_getEJBObject );
}catch(IllegalStateException ise){}
/*[8] Test JNDI_access_to_java_comp_env ///////////////*/
@@ -265,7 +271,7 @@
jndiContext.lookup("java:comp/env/stateful/references/JNDI_access_to_java_comp_env");
- policy.allow( policy.JNDI_access_to_java_comp_env );
+ policy.allow( OperationsPolicy.JNDI_access_to_java_comp_env );
} catch (IllegalStateException ise) {
} catch (javax.naming.NamingException ne) {
}
@@ -276,7 +282,7 @@
jndiContext.lookup("java:comp/env/stateful/references/Resource_manager_access");
- policy.allow( policy.Resource_manager_access );
+ policy.allow( OperationsPolicy.Resource_manager_access );
} catch (IllegalStateException ise) {
} catch (javax.naming.NamingException ne) {
}
@@ -287,7 +293,7 @@
jndiContext.lookup("java:comp/env/stateful/beanReferences/Enterprise_bean_access");
- policy.allow( policy.Enterprise_bean_access );
+ policy.allow( OperationsPolicy.Enterprise_bean_access );
} catch (IllegalStateException ise) {
} catch (javax.naming.NamingException ne) {
}