User: user57
Date: 01/07/10 22:52:08
Modified: src/main/org/jboss/test/lock/bean EnterpriseEntityBean.java
Log:
o updated lock test to excersise commit-option a, b (c & d but those are
not enabled at the moment).
o abstracted the actuall test outside of Worker, into Task so it is easier
to add new lock tests
o the test will also do a single bean, bean-to-bean
Revision Changes Path
1.3 +86 -70
jbosstest/src/main/org/jboss/test/lock/bean/EnterpriseEntityBean.java
Index: EnterpriseEntityBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/lock/bean/EnterpriseEntityBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EnterpriseEntityBean.java 2000/10/19 01:28:06 1.2
+++ EnterpriseEntityBean.java 2001/07/11 05:52:08 1.3
@@ -6,80 +6,96 @@
import org.jboss.test.lock.interfaces.EnterpriseEntityHome;
import org.jboss.test.lock.interfaces.EnterpriseEntity;
-public class EnterpriseEntityBean implements EntityBean {
- private EntityContext entityContext;
- public String name;
- public String field;
- public EnterpriseEntity nextEntity;
-
- public String ejbCreate(String name) throws RemoteException, CreateException {
- this.name = name;
- return null;
- }
-
- public void ejbPostCreate(String name) throws RemoteException, CreateException
{
- }
-
-
- public void ejbActivate() throws RemoteException {
- }
-
- public void ejbLoad() throws RemoteException {
- }
-
- public void ejbPassivate() throws RemoteException {
- }
-
- public void ejbRemove() throws RemoteException, RemoveException {
- }
-
- public void ejbStore() throws RemoteException {
- }
-
-
- public void setField(String field) throws RemoteException {
- System.out.println("Bean "+name+", setField("+field+") called");
- this.field = field;
- }
-
- public String getField() throws RemoteException {
- return field;
- }
+public class EnterpriseEntityBean
+ implements EntityBean
+{
+ private EntityContext entityContext;
+
+ public String name;
+ public String field;
+ public EnterpriseEntity nextEntity;
+
+ public String ejbCreate(final String name)
+ throws RemoteException, CreateException
+ {
+ this.name = name;
+ return null;
+ }
+
+ public void ejbPostCreate(String name)
+ throws RemoteException, CreateException
+ {
+ // empty
+ }
+
+ public void ejbActivate() throws RemoteException {
+ // empty
+ }
+
+ public void ejbLoad() throws RemoteException {
+ // empty
+ }
+
+ public void ejbPassivate() throws RemoteException {
+ // empty
+ }
+
+ public void ejbRemove() throws RemoteException, RemoveException {
+ // empty
+ }
+
+ public void ejbStore() throws RemoteException {
+ // empty
+ }
+
+ public void setField(String field) throws RemoteException {
+ System.out.println("Bean "+name+", setField("+field+") called");
+ this.field = field;
+ }
+
+ public String getField() throws RemoteException {
+ return field;
+ }
-
- public void setAndCopyField(String field) throws RemoteException {
- System.out.println("Bean "+name+", setAndCopyField("+field+") called");
+ public void setAndCopyField(String field) throws RemoteException {
+ System.out.println("Bean "+name+", setAndCopyField("+field+") called");
- setField(field);
- nextEntity.setField(field);
- }
+ setField(field);
+ nextEntity.setField(field);
+ }
-
- public void setNextEntity(String beanName) throws RemoteException {
-
- System.out.println("EntityBean.createEntity() called");
+ public void setNextEntity(String beanName) throws RemoteException {
+ System.out.println("EntityBean.createEntity() called");
- try {
- EJBObject ejbObject = entityContext.getEJBObject();
- EnterpriseEntityHome home =
(EnterpriseEntityHome)entityContext.getEJBObject().getEJBHome();
+ try {
+ EJBObject ejbObject = entityContext.getEJBObject();
+ EnterpriseEntityHome home =
+ (EnterpriseEntityHome)entityContext.getEJBObject().getEJBHome();
- try {
- nextEntity =
(EnterpriseEntity)home.findByPrimaryKey(beanName);
- } catch (FinderException e) {
- nextEntity = (EnterpriseEntity)home.create(beanName);
- }
+ try {
+ nextEntity = (EnterpriseEntity)home.findByPrimaryKey(beanName);
+ } catch (FinderException e) {
+ nextEntity = (EnterpriseEntity)home.create(beanName);
+ }
- } catch(Exception e) {
- e.printStackTrace();
- throw new RemoteException("create entity did not work check
messages");
- }
- }
-
- public void setEntityContext(EntityContext context) throws RemoteException {
- entityContext = context;
- }
-
- public void unsetEntityContext() throws RemoteException {
- entityContext = null;
- }
+ } catch(Exception e) {
+ e.printStackTrace();
+ throw new RemoteException
+ ("create entity did not work check messages");
+ }
+ }
+
+ public void setEntityContext(EntityContext context)
+ throws RemoteException
+ {
+ entityContext = context;
+ }
+
+ public void unsetEntityContext() throws RemoteException {
+ entityContext = null;
+ }
+
+ public void sleep(long time) throws InterruptedException {
+ Thread.sleep(time);
+ }
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development