dain 2005/02/02 22:11:00
Modified: modules/itests/src/java/org/openejb/test/entity/bmp
AllowedOperationsBmpBean.java BasicBmpBean.java
Log:
Reenabled tests for ejbHome method
Cleaned up intellij warnings
Revision Changes Path
1.6 +13 -13
openejb/modules/itests/src/java/org/openejb/test/entity/bmp/AllowedOperationsBmpBean.java
Index: AllowedOperationsBmpBean.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/java/org/openejb/test/entity/bmp/AllowedOperationsBmpBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AllowedOperationsBmpBean.java 16 Sep 2004 15:33:27 -0000 1.5
+++ AllowedOperationsBmpBean.java 3 Feb 2005 03:11:00 -0000 1.6
@@ -60,7 +60,7 @@
public class AllowedOperationsBmpBean implements javax.ejb.EntityBean{
private EntityContext ejbContext;
- private static Hashtable allowedOperationsTable = new Hashtable();
+ private final static Hashtable allowedOperationsTable = new Hashtable();
//=============================
@@ -259,49 +259,49 @@
/*[0] Test getEJBHome /////////////////*/
try {
ejbContext.getEJBHome();
- policy.allow(policy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
} catch (IllegalStateException ise) {
}
/*[1] Test getCallerPrincipal /////////*/
try {
ejbContext.getCallerPrincipal();
- policy.allow( policy.Context_getCallerPrincipal );
+ policy.allow(
OperationsPolicy.Context_getCallerPrincipal );
} catch (IllegalStateException ise) {
}
/*[2] Test isCallerInRole /////////////*/
try {
ejbContext.isCallerInRole("ROLE");
- policy.allow( policy.Context_isCallerInRole );
+ policy.allow( OperationsPolicy.Context_isCallerInRole );
} catch (IllegalStateException ise) {
}
/*[3] Test getRollbackOnly ////////////*/
try {
ejbContext.getRollbackOnly();
- policy.allow( policy.Context_getRollbackOnly );
+ policy.allow( OperationsPolicy.Context_getRollbackOnly
);
} catch (IllegalStateException ise) {
}
/*[4] Test setRollbackOnly ////////////*/
try {
ejbContext.setRollbackOnly();
- policy.allow( policy.Context_setRollbackOnly );
+ policy.allow( OperationsPolicy.Context_setRollbackOnly
);
} catch (IllegalStateException ise) {
}
/*[5] Test getUserTransaction /////////*/
try {
ejbContext.getUserTransaction();
- policy.allow( policy.Context_getUserTransaction );
+ policy.allow(
OperationsPolicy.Context_getUserTransaction );
} catch (IllegalStateException ise) {
}
/*[6] Test getEJBObject ///////////////*/
try {
ejbContext.getEJBObject();
- policy.allow( policy.Context_getEJBObject );
+ policy.allow( OperationsPolicy.Context_getEJBObject );
} catch (IllegalStateException ise) {
}
@@ -311,7 +311,7 @@
*/
try {
ejbContext.getPrimaryKey();
- policy.allow( policy.Context_getPrimaryKey );
+ policy.allow( OperationsPolicy.Context_getPrimaryKey );
} catch (IllegalStateException ise) {
}
@@ -321,7 +321,7 @@
jndiContext.lookup("java:comp/env/entity/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) {
}
@@ -332,7 +332,7 @@
jndiContext.lookup("java:comp/env/entity/references/Resource_manager_access");
- policy.allow( policy.Resource_manager_access );
+ policy.allow( OperationsPolicy.Resource_manager_access
);
} catch (IllegalStateException ise) {
} catch (javax.naming.NamingException ne) {
}
@@ -343,7 +343,7 @@
jndiContext.lookup("java:comp/env/entity/beanReferences/Enterprise_bean_access");
- policy.allow( policy.Enterprise_bean_access );
+ policy.allow( OperationsPolicy.Enterprise_bean_access );
} catch (IllegalStateException ise) {
} catch (javax.naming.NamingException ne) {
}
1.6 +19 -20
openejb/modules/itests/src/java/org/openejb/test/entity/bmp/BasicBmpBean.java
Index: BasicBmpBean.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/java/org/openejb/test/entity/bmp/BasicBmpBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BasicBmpBean.java 16 Sep 2004 15:33:27 -0000 1.5
+++ BasicBmpBean.java 3 Feb 2005 03:11:00 -0000 1.6
@@ -44,7 +44,6 @@
*/
package org.openejb.test.entity.bmp;
-import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -93,7 +92,7 @@
}
- public Collection ejbFindEmptyCollection() throws FinderException,
RemoteException {
+ public Collection ejbFindEmptyCollection() throws FinderException {
return new Vector();
}
@@ -268,7 +267,7 @@
* instance to synchronize its state by loading it state from the
* underlying database.
*/
- public void ejbLoad() throws EJBException, RemoteException {
+ public void ejbLoad() {
Connection con = null;
PreparedStatement stmt = null;
try {
@@ -299,7 +298,7 @@
* Set the associated entity context. The container invokes this method
* on an instance after the instance has been created.
*/
- public void setEntityContext(EntityContext ctx) throws EJBException,
RemoteException {
+ public void setEntityContext(EntityContext ctx) {
ejbContext = ctx;
testAllowedOperations("setEntityContext");
}
@@ -308,7 +307,7 @@
* Unset the associated entity context. The container calls this method
* before removing the instance.
*/
- public void unsetEntityContext() throws EJBException, RemoteException {
+ public void unsetEntityContext() {
testAllowedOperations("unsetEntityContext");
}
@@ -317,7 +316,7 @@
* instance to synchronize its state by storing it to the underlying
* database.
*/
- public void ejbStore() throws EJBException, RemoteException {
+ public void ejbStore() {
Connection con = null;
PreparedStatement stmt = null;
try {
@@ -350,7 +349,7 @@
* This method transitions the instance from the ready state to the pool
* of available instances.
*/
- public void ejbRemove() throws RemoveException, EJBException,
RemoteException {
+ public void ejbRemove() throws RemoveException {
Connection con = null;
PreparedStatement stmt = null;
try {
@@ -380,7 +379,7 @@
* with a specific EJB object. This method transitions the instance to
* the ready state.
*/
- public void ejbActivate() throws EJBException, RemoteException {
+ public void ejbActivate() {
testAllowedOperations("ejbActivate");
}
@@ -390,7 +389,7 @@
* completes, the container will place the instance into the pool of
* available instances.
*/
- public void ejbPassivate() throws EJBException, RemoteException {
+ public void ejbPassivate() {
testAllowedOperations("ejbPassivate");
}
@@ -405,49 +404,49 @@
/*[0] Test getEJBHome /////////////////*/
try {
ejbContext.getEJBHome();
- policy.allow(policy.Context_getEJBHome);
+ policy.allow(OperationsPolicy.Context_getEJBHome);
} catch (IllegalStateException ise) {
}
/*[1] Test getCallerPrincipal /////////*/
try {
ejbContext.getCallerPrincipal();
- policy.allow(policy.Context_getCallerPrincipal);
+ policy.allow(OperationsPolicy.Context_getCallerPrincipal);
} catch (IllegalStateException ise) {
}
/*[2] Test isCallerInRole /////////////*/
try {
ejbContext.isCallerInRole("ROLE");
- policy.allow(policy.Context_isCallerInRole);
+ policy.allow(OperationsPolicy.Context_isCallerInRole);
} catch (IllegalStateException ise) {
}
/*[3] Test getRollbackOnly ////////////*/
try {
ejbContext.getRollbackOnly();
- policy.allow(policy.Context_getRollbackOnly);
+ policy.allow(OperationsPolicy.Context_getRollbackOnly);
} catch (IllegalStateException ise) {
}
/*[4] Test setRollbackOnly ////////////*/
try {
ejbContext.setRollbackOnly();
- policy.allow(policy.Context_setRollbackOnly);
+ policy.allow(OperationsPolicy.Context_setRollbackOnly);
} catch (IllegalStateException ise) {
}
/*[5] Test getUserTransaction /////////*/
try {
ejbContext.getUserTransaction();
- policy.allow(policy.Context_getUserTransaction);
+ policy.allow(OperationsPolicy.Context_getUserTransaction);
} catch (IllegalStateException ise) {
}
/*[6] Test getEJBObject ///////////////*/
try {
ejbContext.getEJBObject();
- policy.allow(policy.Context_getEJBObject);
+ policy.allow(OperationsPolicy.Context_getEJBObject);
} catch (IllegalStateException ise) {
}
@@ -462,7 +461,7 @@
jndiContext.lookup("java:comp/env/entity/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) {
}
@@ -473,7 +472,7 @@
jndiContext.lookup("java:comp/env/entity/references/Resource_manager_access");
- policy.allow(policy.Resource_manager_access);
+ policy.allow(OperationsPolicy.Resource_manager_access);
} catch (IllegalStateException ise) {
} catch (javax.naming.NamingException ne) {
}
@@ -484,7 +483,7 @@
jndiContext.lookup("java:comp/env/entity/beanReferences/Enterprise_bean_access");
- policy.allow(policy.Enterprise_bean_access);
+ policy.allow(OperationsPolicy.Enterprise_bean_access);
} catch (IllegalStateException ise) {
} catch (javax.naming.NamingException ne) {
}