You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/07/07 21:07:53 UTC
svn commit: r1608563 [13/38] - in /tomee/tomee/branches/tomee-1.7.x/itests:
failover-ejb/src/main/java/org/apache/openejb/itest/failover/ejb/
failover/src/main/java/org/apache/openejb/itest/failover/
failover/src/main/java/org/apache/openejb/server/con...
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/SetterInjectionSingletonBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/SetterInjectionSingletonBean.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/SetterInjectionSingletonBean.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/SetterInjectionSingletonBean.java Mon Jul 7 19:07:41 2014
@@ -77,7 +77,7 @@ public class SetterInjectionSingletonBea
return statefulBusinessLocalField;
}
- public void setStatefulBusinessLocal(BasicStatefulBusinessLocal statefulBusinessLocal) {
+ public void setStatefulBusinessLocal(final BasicStatefulBusinessLocal statefulBusinessLocal) {
this.statefulBusinessLocalField = statefulBusinessLocal;
}
@@ -85,7 +85,7 @@ public class SetterInjectionSingletonBea
return statefulBusinessLocalFieldBean;
}
- public void setStatefulBusinessLocalBean(BasicStatefulPojoBean statefulBusinessLocalBean) {
+ public void setStatefulBusinessLocalBean(final BasicStatefulPojoBean statefulBusinessLocalBean) {
this.statefulBusinessLocalFieldBean = statefulBusinessLocalBean;
}
@@ -93,7 +93,7 @@ public class SetterInjectionSingletonBea
return statefulBusinessRemoteField;
}
- public void setStatefulBusinessRemote(BasicStatefulBusinessRemote statefulBusinessRemote) {
+ public void setStatefulBusinessRemote(final BasicStatefulBusinessRemote statefulBusinessRemote) {
this.statefulBusinessRemoteField = statefulBusinessRemote;
}
@@ -101,7 +101,7 @@ public class SetterInjectionSingletonBea
return singletonBusinessLocalField;
}
- public void setSingletonBusinessLocal(BasicSingletonBusinessLocal singletonBusinessLocal) {
+ public void setSingletonBusinessLocal(final BasicSingletonBusinessLocal singletonBusinessLocal) {
this.singletonBusinessLocalField = singletonBusinessLocal;
}
@@ -109,7 +109,7 @@ public class SetterInjectionSingletonBea
return singletonBusinessLocalFieldBean;
}
- public void setSingletonBusinessLocalBean(BasicSingletonPojoBean singletonBusinessLocalBean) {
+ public void setSingletonBusinessLocalBean(final BasicSingletonPojoBean singletonBusinessLocalBean) {
this.singletonBusinessLocalFieldBean = singletonBusinessLocalBean;
}
@@ -117,7 +117,7 @@ public class SetterInjectionSingletonBea
return singletonBusinessRemoteField;
}
- public void setSingletonBusinessRemote(BasicSingletonBusinessRemote singletonBusinessRemote) {
+ public void setSingletonBusinessRemote(final BasicSingletonBusinessRemote singletonBusinessRemote) {
this.singletonBusinessRemoteField = singletonBusinessRemote;
}
@@ -125,7 +125,7 @@ public class SetterInjectionSingletonBea
return bmpHomeField;
}
- public void setBmpHome(BasicBmpHome bmpHome) {
+ public void setBmpHome(final BasicBmpHome bmpHome) {
this.bmpHomeField = bmpHome;
}
@@ -133,7 +133,7 @@ public class SetterInjectionSingletonBea
return boooleanField;
}
- public void setBooolean(Boolean booolean) {
+ public void setBooolean(final Boolean booolean) {
this.boooleanField = booolean;
}
@@ -141,7 +141,7 @@ public class SetterInjectionSingletonBea
return byyteField;
}
- public void setByyte(Byte byyte) {
+ public void setByyte(final Byte byyte) {
this.byyteField = byyte;
}
@@ -149,7 +149,7 @@ public class SetterInjectionSingletonBea
return chaaracterField;
}
- public void setChaaracter(Character chaaracter) {
+ public void setChaaracter(final Character chaaracter) {
this.chaaracterField = chaaracter;
}
@@ -157,7 +157,7 @@ public class SetterInjectionSingletonBea
return daataSourceField;
}
- public void setDaataSource(DataSource daataSource) {
+ public void setDaataSource(final DataSource daataSource) {
this.daataSourceField = daataSource;
}
@@ -165,7 +165,7 @@ public class SetterInjectionSingletonBea
return coonnectionFactory;
}
- public void setCoonnectionFactory(ConnectionFactory coonnectionFactory) {
+ public void setCoonnectionFactory(final ConnectionFactory coonnectionFactory) {
this.coonnectionFactory = coonnectionFactory;
}
@@ -173,7 +173,7 @@ public class SetterInjectionSingletonBea
return queueCoonnectionFactory;
}
- public void setQueueCoonnectionFactory(QueueConnectionFactory queueCoonnectionFactory) {
+ public void setQueueCoonnectionFactory(final QueueConnectionFactory queueCoonnectionFactory) {
this.queueCoonnectionFactory = queueCoonnectionFactory;
}
@@ -181,7 +181,7 @@ public class SetterInjectionSingletonBea
return topicCoonnectionFactory;
}
- public void setTopicCoonnectionFactory(TopicConnectionFactory topicCoonnectionFactory) {
+ public void setTopicCoonnectionFactory(final TopicConnectionFactory topicCoonnectionFactory) {
this.topicCoonnectionFactory = topicCoonnectionFactory;
}
@@ -189,7 +189,7 @@ public class SetterInjectionSingletonBea
return dooubleField;
}
- public void setDoouble(Double doouble) {
+ public void setDoouble(final Double doouble) {
this.dooubleField = doouble;
}
@@ -197,7 +197,7 @@ public class SetterInjectionSingletonBea
return eemField;
}
- public void setEem(EntityManager eem) {
+ public void setEem(final EntityManager eem) {
this.eemField = eem;
}
@@ -205,7 +205,7 @@ public class SetterInjectionSingletonBea
return ejbContextField;
}
- public void setEjbContext(SessionContext ejbContext) {
+ public void setEjbContext(final SessionContext ejbContext) {
this.ejbContextField = ejbContext;
}
@@ -213,7 +213,7 @@ public class SetterInjectionSingletonBea
return emField;
}
- public void setEm(EntityManager em) {
+ public void setEm(final EntityManager em) {
this.emField = em;
}
@@ -221,7 +221,7 @@ public class SetterInjectionSingletonBea
return emfField;
}
- public void setEmf(EntityManagerFactory emf) {
+ public void setEmf(final EntityManagerFactory emf) {
this.emfField = emf;
}
@@ -229,7 +229,7 @@ public class SetterInjectionSingletonBea
return flooatField;
}
- public void setFlooat(Float flooat) {
+ public void setFlooat(final Float flooat) {
this.flooatField = flooat;
}
@@ -237,7 +237,7 @@ public class SetterInjectionSingletonBea
return inteegerField;
}
- public void setInteeger(Integer inteeger) {
+ public void setInteeger(final Integer inteeger) {
this.inteegerField = inteeger;
}
@@ -245,7 +245,7 @@ public class SetterInjectionSingletonBea
return loongField;
}
- public void setLoong(Long loong) {
+ public void setLoong(final Long loong) {
this.loongField = loong;
}
@@ -253,7 +253,7 @@ public class SetterInjectionSingletonBea
return pemField;
}
- public void setPem(EntityManager pem) {
+ public void setPem(final EntityManager pem) {
this.pemField = pem;
}
@@ -261,7 +261,7 @@ public class SetterInjectionSingletonBea
return shoortField;
}
- public void setShoort(Short shoort) {
+ public void setShoort(final Short shoort) {
this.shoortField = shoort;
}
@@ -269,7 +269,7 @@ public class SetterInjectionSingletonBea
return statefulHomeField;
}
- public void setStatefulHome(BasicStatefulHome statefulHome) {
+ public void setStatefulHome(final BasicStatefulHome statefulHome) {
this.statefulHomeField = statefulHome;
}
@@ -277,7 +277,7 @@ public class SetterInjectionSingletonBea
return singletonHomeField;
}
- public void setSingletonHome(BasicSingletonHome singletonHome) {
+ public void setSingletonHome(final BasicSingletonHome singletonHome) {
this.singletonHomeField = singletonHome;
}
@@ -285,7 +285,7 @@ public class SetterInjectionSingletonBea
return striingField;
}
- public void setStriing(String striing) {
+ public void setStriing(final String striing) {
this.striingField = striing;
}
@@ -295,7 +295,7 @@ public class SetterInjectionSingletonBea
public void lookupEntityBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJBObject is null", bmpHomeField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -303,7 +303,7 @@ public class SetterInjectionSingletonBea
public void lookupStatefulBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJBObject is null", statefulHomeField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -311,55 +311,55 @@ public class SetterInjectionSingletonBea
public void lookupSingletonBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJBObject is null", singletonHomeField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupSingletonBusinessLocal() throws TestFailureException{
- try{
- Assert.assertNotNull("The EJB BusinessLocal is null", singletonBusinessLocalField );
- } catch (AssertionFailedError afe){
+ public void lookupSingletonBusinessLocal() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJB BusinessLocal is null", singletonBusinessLocalField);
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupSingletonBusinessLocalBean() throws TestFailureException{
- try{
- Assert.assertNotNull("The EJB BusinessLocalBean is null", singletonBusinessLocalFieldBean );
- } catch (AssertionFailedError afe){
+ public void lookupSingletonBusinessLocalBean() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJB BusinessLocalBean is null", singletonBusinessLocalFieldBean);
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupSingletonBusinessRemote() throws TestFailureException{
- try{
- Assert.assertNotNull("The EJB BusinessRemote is null", singletonBusinessRemoteField );
- } catch (AssertionFailedError afe){
+ public void lookupSingletonBusinessRemote() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJB BusinessRemote is null", singletonBusinessRemoteField);
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupStatefulBusinessLocal() throws TestFailureException{
- try{
- Assert.assertNotNull("The EJB BusinessLocal is null", statefulBusinessLocalField );
- } catch (AssertionFailedError afe){
+ public void lookupStatefulBusinessLocal() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJB BusinessLocal is null", statefulBusinessLocalField);
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupStatefulBusinessLocalBean() throws TestFailureException{
- try{
- Assert.assertNotNull("The EJB BusinessLocalBean is null", statefulBusinessLocalFieldBean );
- } catch (AssertionFailedError afe){
+ public void lookupStatefulBusinessLocalBean() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJB BusinessLocalBean is null", statefulBusinessLocalFieldBean);
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupStatefulBusinessRemote() throws TestFailureException{
- try{
- Assert.assertNotNull("The EJB BusinessRemote is null", statefulBusinessRemoteField );
- } catch (AssertionFailedError afe){
+ public void lookupStatefulBusinessRemote() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJB BusinessRemote is null", statefulBusinessRemoteField);
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -367,100 +367,100 @@ public class SetterInjectionSingletonBea
public void lookupStringEntry() throws TestFailureException {
try {
- String expected = new String("1");
+ final String expected = new String("1");
Assert.assertNotNull("The String looked up is null", striingField);
Assert.assertEquals(expected, striingField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupDoubleEntry() throws TestFailureException {
try {
- Double expected = new Double(1.0D);
+ final Double expected = new Double(1.0D);
Assert.assertNotNull("The Double looked up is null", dooubleField);
Assert.assertEquals(expected, dooubleField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupLongEntry() throws TestFailureException {
try {
- Long expected = new Long(1L);
+ final Long expected = new Long(1L);
Assert.assertNotNull("The Long looked up is null", loongField);
Assert.assertEquals(expected, loongField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupFloatEntry() throws TestFailureException {
try {
- Float expected = new Float(1.0F);
+ final Float expected = new Float(1.0F);
Assert.assertNotNull("The Float looked up is null", flooatField);
Assert.assertEquals(expected, flooatField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupIntegerEntry() throws TestFailureException {
try {
- Integer expected = new Integer(1);
+ final Integer expected = new Integer(1);
Assert.assertNotNull("The Integer looked up is null", inteegerField);
Assert.assertEquals(expected, inteegerField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupShortEntry() throws TestFailureException {
try {
- Short expected = new Short((short) 1);
+ final Short expected = new Short((short) 1);
Assert.assertNotNull("The Short looked up is null", shoortField);
Assert.assertEquals(expected, shoortField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupBooleanEntry() throws TestFailureException {
try {
- Boolean expected = new Boolean(true);
+ final Boolean expected = new Boolean(true);
Assert.assertNotNull("The Boolean looked up is null", boooleanField);
Assert.assertEquals(expected, boooleanField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupByteEntry() throws TestFailureException {
try {
- Byte expected = new Byte((byte) 1);
+ final Byte expected = new Byte((byte) 1);
Assert.assertNotNull("The Byte looked up is null", byyteField);
Assert.assertEquals(expected, byyteField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupCharacterEntry() throws TestFailureException {
try {
- Character expected = new Character('D');
+ final Character expected = new Character('D');
Assert.assertNotNull("The Character looked up is null", chaaracterField);
Assert.assertEquals(expected, chaaracterField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -468,30 +468,30 @@ public class SetterInjectionSingletonBea
public void lookupResource() throws TestFailureException {
try {
Assert.assertNotNull("The DataSource is null", daataSourceField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupJMSConnectionFactory() throws TestFailureException{
- try{
- try{
+ public void lookupJMSConnectionFactory() throws TestFailureException {
+ try {
+ try {
testJmsConnection(coonnectionFactory.createConnection());
testJmsConnection(queueCoonnectionFactory.createConnection());
testJmsConnection(topicCoonnectionFactory.createConnection());
- } catch (Exception e){
+ } catch (final Exception e) {
e.printStackTrace();
- Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
- } catch (AssertionFailedError afe){
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- private void testJmsConnection(javax.jms.Connection connection) throws JMSException {
- Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
- Topic topic = session.createTopic("test");
- MessageProducer producer = session.createProducer(topic);
+ private void testJmsConnection(final javax.jms.Connection connection) throws JMSException {
+ final Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
+ final Topic topic = session.createTopic("test");
+ final MessageProducer producer = session.createProducer(topic);
producer.send(session.createMessage());
producer.close();
session.close();
@@ -501,7 +501,7 @@ public class SetterInjectionSingletonBea
public void lookupPersistenceUnit() throws TestFailureException {
try {
Assert.assertNotNull("The EntityManagerFactory is null", emfField);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -513,10 +513,10 @@ public class SetterInjectionSingletonBea
try {
// call a do nothing method to assure entity manager actually exists
emField.getFlushMode();
- } catch (Exception e) {
+ } catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -525,7 +525,7 @@ public class SetterInjectionSingletonBea
try {
// TODO: DMB: Can't seem to find where to make this work
// Assert.assertNotNull("The SessionContext is null", ejbContext);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
@@ -540,6 +540,6 @@ public class SetterInjectionSingletonBea
public void ejbRemove() throws EJBException, RemoteException {
}
- public void setSessionContext(SessionContext sessionContext) throws EJBException, RemoteException {
+ public void setSessionContext(final SessionContext sessionContext) throws EJBException, RemoteException {
}
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/AnnotatedFieldInjectionStatefulBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/AnnotatedFieldInjectionStatefulBean.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/AnnotatedFieldInjectionStatefulBean.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/AnnotatedFieldInjectionStatefulBean.java Mon Jul 7 19:07:41 2014
@@ -70,11 +70,11 @@ public class AnnotatedFieldInjectionStat
@Resource
private Integer inteeger = 1;
@Resource
- private Short shoort = (short)1;
+ private Short shoort = (short) 1;
@Resource
private Boolean booolean = true;
@Resource
- private Byte byyte = (byte)1;
+ private Byte byyte = (byte) 1;
@Resource
private Character chaaracter = 'D';
@Resource
@@ -104,17 +104,17 @@ public class AnnotatedFieldInjectionStat
@Init
- public void create(String name) {
+ public void create(final String name) {
}
@Remove
- public void remove(){
+ public void remove() {
}
-
+
public void lookupEntityBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJBObject is null", bmpHome);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -122,7 +122,7 @@ public class AnnotatedFieldInjectionStat
public void lookupStatefulBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJBObject is null", statefulHome);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -130,7 +130,7 @@ public class AnnotatedFieldInjectionStat
public void lookupStatelessBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJBObject is null", statelessHome);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -138,7 +138,7 @@ public class AnnotatedFieldInjectionStat
public void lookupStatelessBusinessLocal() throws TestFailureException {
try {
Assert.assertNotNull("The EJB BusinessLocal is null", statelessBusinessLocal);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -146,7 +146,7 @@ public class AnnotatedFieldInjectionStat
public void lookupStatelessBusinessLocalBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJB BusinessLocalBean is null", statelessBusinessLocalBean);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -154,7 +154,7 @@ public class AnnotatedFieldInjectionStat
public void lookupStatelessBusinessRemote() throws TestFailureException {
try {
Assert.assertNotNull("The EJB BusinessRemote is null", statelessBusinessRemote);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -162,7 +162,7 @@ public class AnnotatedFieldInjectionStat
public void lookupStatefulBusinessLocal() throws TestFailureException {
try {
Assert.assertNotNull("The EJB BusinessLocal is null", statefulBusinessLocal);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -170,7 +170,7 @@ public class AnnotatedFieldInjectionStat
public void lookupStatefulBusinessLocalBean() throws TestFailureException {
try {
Assert.assertNotNull("The EJB BusinessLocalBean is null", statefulBusinessLocalBean);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -178,107 +178,107 @@ public class AnnotatedFieldInjectionStat
public void lookupStatefulBusinessRemote() throws TestFailureException {
try {
Assert.assertNotNull("The EJB BusinessRemote is null", statefulBusinessRemote);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupStringEntry() throws TestFailureException {
try {
- String expected = new String("1");
+ final String expected = new String("1");
Assert.assertNotNull("The String looked up is null", striing);
Assert.assertEquals(expected, striing);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupDoubleEntry() throws TestFailureException {
try {
- Double expected = new Double(1.0D);
+ final Double expected = new Double(1.0D);
Assert.assertNotNull("The Double looked up is null", doouble);
Assert.assertEquals(expected, doouble);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupLongEntry() throws TestFailureException {
try {
- Long expected = new Long(1L);
+ final Long expected = new Long(1L);
Assert.assertNotNull("The Long looked up is null", loong);
Assert.assertEquals(expected, loong);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupFloatEntry() throws TestFailureException {
try {
- Float expected = new Float(1.0F);
+ final Float expected = new Float(1.0F);
Assert.assertNotNull("The Float looked up is null", flooat);
Assert.assertEquals(expected, flooat);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupIntegerEntry() throws TestFailureException {
try {
- Integer expected = new Integer(1);
+ final Integer expected = new Integer(1);
Assert.assertNotNull("The Integer looked up is null", inteeger);
Assert.assertEquals(expected, inteeger);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupShortEntry() throws TestFailureException {
try {
- Short expected = new Short((short) 1);
+ final Short expected = new Short((short) 1);
Assert.assertNotNull("The Short looked up is null", shoort);
Assert.assertEquals(expected, shoort);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupBooleanEntry() throws TestFailureException {
try {
- Boolean expected = new Boolean(true);
+ final Boolean expected = new Boolean(true);
Assert.assertNotNull("The Boolean looked up is null", booolean);
Assert.assertEquals(expected, booolean);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupByteEntry() throws TestFailureException {
try {
- Byte expected = new Byte((byte) 1);
+ final Byte expected = new Byte((byte) 1);
Assert.assertNotNull("The Byte looked up is null", byyte);
Assert.assertEquals(expected, byyte);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
public void lookupCharacterEntry() throws TestFailureException {
try {
- Character expected = new Character('D');
+ final Character expected = new Character('D');
Assert.assertNotNull("The Character looked up is null", chaaracter);
Assert.assertEquals(expected, chaaracter);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -286,30 +286,30 @@ public class AnnotatedFieldInjectionStat
public void lookupResource() throws TestFailureException {
try {
Assert.assertNotNull("The DataSource is null", daataSource);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- public void lookupJMSConnectionFactory() throws TestFailureException{
- try{
- try{
+ public void lookupJMSConnectionFactory() throws TestFailureException {
+ try {
+ try {
testJmsConnection(coonnectionFactory.createConnection());
testJmsConnection(queueCoonnectionFactory.createConnection());
testJmsConnection(topicCoonnectionFactory.createConnection());
- } catch (Exception e){
+ } catch (final Exception e) {
e.printStackTrace();
- Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
- } catch (AssertionFailedError afe){
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
- private void testJmsConnection(javax.jms.Connection connection) throws JMSException {
- Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
- Topic topic = session.createTopic("test");
- MessageProducer producer = session.createProducer(topic);
+ private void testJmsConnection(final javax.jms.Connection connection) throws JMSException {
+ final Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
+ final Topic topic = session.createTopic("test");
+ final MessageProducer producer = session.createProducer(topic);
producer.send(session.createMessage());
producer.close();
session.close();
@@ -319,7 +319,7 @@ public class AnnotatedFieldInjectionStat
public void lookupPersistenceUnit() throws TestFailureException {
try {
Assert.assertNotNull("The EntityManagerFactory is null", emf);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -331,10 +331,10 @@ public class AnnotatedFieldInjectionStat
try {
// call a do nothing method to assure entity manager actually exists
em.getFlushMode();
- } catch (Exception e) {
+ } catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
}
@@ -343,7 +343,7 @@ public class AnnotatedFieldInjectionStat
try {
// TODO: DMB: Can't seem to find where to make this work
// Assert.assertNotNull("The SessionContext is null", ejbContext);
- } catch (AssertionFailedError afe) {
+ } catch (final AssertionFailedError afe) {
throw new TestFailureException(afe);
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BMTStatefulBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BMTStatefulBean.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BMTStatefulBean.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BMTStatefulBean.java Mon Jul 7 19:07:41 2014
@@ -28,103 +28,101 @@ import org.apache.openejb.test.object.Op
/**
* A Stateful SessionBean with bean-managed transaction demarcation
- *
*/
public class BMTStatefulBean implements javax.ejb.SessionBean {
-
+
private String name;
private SessionContext ejbContext;
private Hashtable allowedOperationsTable = new Hashtable();
-
-
+
+
//=============================
// Home interface methods
//
+
/**
* Maps to BasicStatefulHome.create
- *
+ *
* @param name
- * @exception javax.ejb.CreateException
+ * @throws javax.ejb.CreateException
* @see BasicStatefulHome#createObject
*/
- public void ejbCreateObject(String name)
- throws javax.ejb.CreateException{
+ public void ejbCreateObject(final String name)
+ throws javax.ejb.CreateException {
testAllowedOperations("ejbCreate");
this.name = name;
}
-
+
//
// Home interface methods
//=============================
-
+
//=============================
// Remote interface methods
//
-
+
/**
* Maps to BasicStatefulObject.businessMethod
- *
- * @return
+ *
+ * @return
* @see BasicStatefulObject#businessMethod
*/
- public String businessMethod(String text){
+ public String businessMethod(final String text) {
testAllowedOperations("businessMethod");
- StringBuffer b = new StringBuffer(text);
+ final StringBuffer b = new StringBuffer(text);
return b.reverse().toString();
}
/**
* Throws an ApplicationException when invoked
- *
*/
- public void throwApplicationException() throws ApplicationException{
+ public void throwApplicationException() throws ApplicationException {
throw new ApplicationException("Don't Panic");
}
-
+
/**
* Throws a java.lang.NullPointerException when invoked
- * This is a system exception and should result in the
+ * This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
- *
*/
public void throwSystemException_NullPointer() {
throw new NullPointerException("Panic");
}
-
+
/**
* Maps to BasicStatefulObject.getPermissionsReport
- *
+ * <p/>
* Returns a report of the bean's
* runtime permissions
- *
- * @return
+ *
+ * @return
* @see BasicStatefulObject#getPermissionsReport
*/
- public Properties getPermissionsReport(){
+ public Properties getPermissionsReport() {
/* TO DO: */
return null;
}
-
+
/**
* Maps to BasicStatefulObject.getAllowedOperationsReport
- *
+ * <p/>
* Returns a report of the allowed opperations
* for one of the bean's methods.
- *
+ *
* @param methodName The method for which to get the allowed opperations report
- * @return
+ * @return
* @see BasicStatefulObject#getAllowedOperationsReport
*/
- public OperationsPolicy getAllowedOperationsReport(String methodName){
+ public OperationsPolicy getAllowedOperationsReport(final String methodName) {
return (OperationsPolicy) allowedOperationsTable.get(methodName);
}
-
- public String remove(String arg) {
+
+ public String remove(final String arg) {
return arg;
}
-
+
//
// Remote interface methods
//=============================
@@ -133,87 +131,98 @@ public class BMTStatefulBean implements
//=================================
// SessionBean interface methods
//
+
/**
* Set the associated session context. The container calls this method
* after the instance creation.
*/
- public void setSessionContext(SessionContext ctx) throws EJBException,RemoteException {
+ public void setSessionContext(final SessionContext ctx) throws EJBException, RemoteException {
ejbContext = ctx;
testAllowedOperations("setSessionContext");
}
+
/**
* A container invokes this method before it ends the life of the session
* object. This happens as a result of a client's invoking a remove
* operation, or when a container decides to terminate the session object
* after a timeout.
*/
- public void ejbRemove() throws EJBException,RemoteException {
+ public void ejbRemove() throws EJBException, RemoteException {
testAllowedOperations("ejbRemove");
}
+
/**
* The activate method is called when the instance is activated
* from its "passive" state. The instance should acquire any resource
* that it has released earlier in the ejbPassivate() method.
*/
- public void ejbActivate() throws EJBException,RemoteException {
+ public void ejbActivate() throws EJBException, RemoteException {
testAllowedOperations("ejbActivate");
}
+
/**
* The passivate method is called before the instance enters
* the "passive" state. The instance should release any resources that
* it can re-acquire later in the ejbActivate() method.
*/
- public void ejbPassivate() throws EJBException,RemoteException {
+ public void ejbPassivate() throws EJBException, RemoteException {
testAllowedOperations("ejbPassivate");
}
//
// StatefulBean interface methods
//==================================
- protected void testAllowedOperations(String methodName){
- OperationsPolicy policy = new OperationsPolicy();
+ protected void testAllowedOperations(final String methodName) {
+ final OperationsPolicy policy = new OperationsPolicy();
- /*[1] Test getEJBHome /////////////////*/
- try{
+ /*[1] Test getEJBHome /////////////////*/
+ try {
ejbContext.getEJBHome();
policy.allow(policy.Context_getEJBHome);
- }catch(IllegalStateException ise){}
+ } catch (final IllegalStateException ise) {
+ }
- /*[2] Test getCallerPrincipal /////////*/
- try{
+ /*[2] Test getCallerPrincipal /////////*/
+ try {
ejbContext.getCallerPrincipal();
- policy.allow( policy.Context_getCallerPrincipal );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getCallerPrincipal);
+ } catch (final IllegalStateException ise) {
+ }
- /*[3] Test isCallerInRole /////////////*/
- try{
+ /*[3] Test isCallerInRole /////////////*/
+ try {
ejbContext.isCallerInRole("TheMan");
- policy.allow( policy.Context_isCallerInRole );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_isCallerInRole);
+ } catch (final IllegalStateException ise) {
+ }
- /*[4] Test getRollbackOnly ////////////*/
- try{
+ /*[4] Test getRollbackOnly ////////////*/
+ try {
ejbContext.getRollbackOnly();
- policy.allow( policy.Context_getRollbackOnly );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getRollbackOnly);
+ } catch (final IllegalStateException ise) {
+ }
- /*[5] Test setRollbackOnly ////////////*/
- try{
+ /*[5] Test setRollbackOnly ////////////*/
+ try {
ejbContext.setRollbackOnly();
- policy.allow( policy.Context_setRollbackOnly );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_setRollbackOnly);
+ } catch (final IllegalStateException ise) {
+ }
- /*[6] Test getUserTransaction /////////*/
- try{
+ /*[6] Test getUserTransaction /////////*/
+ try {
ejbContext.getUserTransaction();
- policy.allow( policy.Context_getUserTransaction );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getUserTransaction);
+ } catch (final IllegalStateException ise) {
+ }
- /*[7] Test getEJBObject ///////////////*/
- try{
+ /*[7] Test getEJBObject ///////////////*/
+ try {
ejbContext.getEJBObject();
- policy.allow( policy.Context_getEJBObject );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getEJBObject);
+ } catch (final IllegalStateException ise) {
+ }
/* TO DO:
* Check for policy.Enterprise_bean_access
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBean.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBean.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBean.java Mon Jul 7 19:07:41 2014
@@ -29,97 +29,96 @@ import org.apache.openejb.test.object.Op
public class BasicStatefulBean implements javax.ejb.SessionBean, SessionSynchronization {
-
+
private String name;
private SessionContext ejbContext;
private Hashtable allowedOperationsTable = new Hashtable();
-
-
+
+
//=============================
// Home interface methods
//
+
/**
* Maps to BasicStatefulHome.create
- *
+ *
* @param name
- * @exception javax.ejb.CreateException
+ * @throws javax.ejb.CreateException
* @see BasicStatefulHome#createObject
*/
- public void ejbCreateObject(String name)
- throws javax.ejb.CreateException{
+ public void ejbCreateObject(final String name)
+ throws javax.ejb.CreateException {
testAllowedOperations("ejbCreate");
this.name = name;
}
//
// Home interface methods
//=============================
-
+
//=============================
// Remote interface methods
//
-
+
/**
* Maps to BasicStatefulObject.businessMethod
- *
- * @return
+ *
+ * @return
* @see BasicStatefulObject#businessMethod
*/
- public String businessMethod(String text){
+ public String businessMethod(final String text) {
testAllowedOperations("businessMethod");
- StringBuffer b = new StringBuffer(text);
+ final StringBuffer b = new StringBuffer(text);
return b.reverse().toString();
}
/**
* Throws an ApplicationException when invoked
- *
*/
- public void throwApplicationException() throws ApplicationException{
+ public void throwApplicationException() throws ApplicationException {
throw new ApplicationException("Testing ability to throw Application Exceptions");
}
-
+
/**
* Throws a java.lang.NullPointerException when invoked
- * This is a system exception and should result in the
+ * This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
- *
*/
public void throwSystemException_NullPointer() {
throw new NullPointerException("Testing ability to throw System Exceptions");
}
-
+
/**
* Maps to BasicStatefulObject.getPermissionsReport
- *
+ * <p/>
* Returns a report of the bean's
* runtime permissions
- *
- * @return
+ *
+ * @return
* @see BasicStatefulObject#getPermissionsReport
*/
- public Properties getPermissionsReport(){
+ public Properties getPermissionsReport() {
/* TO DO: */
return null;
}
-
+
/**
* Maps to BasicStatefulObject.getAllowedOperationsReport
- *
+ * <p/>
* Returns a report of the allowed opperations
* for one of the bean's methods.
- *
+ *
* @param methodName The method for which to get the allowed opperations report
- * @return
+ * @return
* @see BasicStatefulObject#getAllowedOperationsReport
*/
- public OperationsPolicy getAllowedOperationsReport(String methodName){
+ public OperationsPolicy getAllowedOperationsReport(final String methodName) {
return (OperationsPolicy) allowedOperationsTable.get(methodName);
}
-
-
- public String remove(String str){
+
+
+ public String remove(final String str) {
return str;
}
//
@@ -130,119 +129,133 @@ public class BasicStatefulBean implement
//=================================
// SessionBean interface methods
//
+
/**
* Set the associated session context. The container calls this method
* after the instance creation.
*/
- public void setSessionContext(SessionContext ctx) throws EJBException,RemoteException {
+ public void setSessionContext(final SessionContext ctx) throws EJBException, RemoteException {
ejbContext = ctx;
testAllowedOperations("setSessionContext");
}
+
/**
* A container invokes this method before it ends the life of the session
* object. This happens as a result of a client's invoking a remove
* operation, or when a container decides to terminate the session object
* after a timeout.
*/
- public void ejbRemove() throws EJBException,RemoteException {
+ public void ejbRemove() throws EJBException, RemoteException {
testAllowedOperations("ejbRemove");
}
+
/**
* The activate method is called when the instance is activated
* from its "passive" state. The instance should acquire any resource
* that it has released earlier in the ejbPassivate() method.
*/
- public void ejbActivate() throws EJBException,RemoteException {
+ public void ejbActivate() throws EJBException, RemoteException {
testAllowedOperations("ejbActivate");
}
+
/**
* The passivate method is called before the instance enters
* the "passive" state. The instance should release any resources that
* it can re-acquire later in the ejbActivate() method.
*/
- public void ejbPassivate() throws EJBException,RemoteException {
+ public void ejbPassivate() throws EJBException, RemoteException {
testAllowedOperations("ejbPassivate");
}
//
// SessionBean interface methods
//==================================
-
-
+
+
//============================================
// SessionSynchronization interface methods
//
+
/**
* The afterBegin method notifies a session Bean instance that a new
* transaction has started, and that the subsequent business methods on the
* instance will be invoked in the context of the transaction.
*/
- public void afterBegin() throws EJBException,RemoteException {
+ public void afterBegin() throws EJBException, RemoteException {
testAllowedOperations("afterBegin");
}
+
/**
* The beforeCompletion method notifies a session Bean instance that
* a transaction is about to be committed. The instance can use this
* method, for example, to write any cached data to a database.
*/
- public void beforeCompletion() throws EJBException,RemoteException {
+ public void beforeCompletion() throws EJBException, RemoteException {
testAllowedOperations("beforeCompletion");
}
+
/**
* The afterCompletion method notifies a session Bean instance that a
* transaction commit protocol has completed, and tells the instance
* whether the transaction has been committed or rolled back.
*/
- public void afterCompletion(boolean committed) throws EJBException,RemoteException {
+ public void afterCompletion(final boolean committed) throws EJBException, RemoteException {
testAllowedOperations("afterCompletion");
}
//
// SessionSynchronization interface methods
//============================================
- protected void testAllowedOperations(String methodName){
- OperationsPolicy policy = new OperationsPolicy();
+ protected void testAllowedOperations(final String methodName) {
+ final OperationsPolicy policy = new OperationsPolicy();
- /*[1] Test getEJBHome /////////////////*/
- try{
+ /*[1] Test getEJBHome /////////////////*/
+ try {
ejbContext.getEJBHome();
policy.allow(policy.Context_getEJBHome);
- }catch(IllegalStateException ise){}
+ } catch (final IllegalStateException ise) {
+ }
- /*[2] Test getCallerPrincipal /////////*/
- try{
+ /*[2] Test getCallerPrincipal /////////*/
+ try {
ejbContext.getCallerPrincipal();
- policy.allow( policy.Context_getCallerPrincipal );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getCallerPrincipal);
+ } catch (final IllegalStateException ise) {
+ }
- /*[3] Test isCallerInRole /////////////*/
- try{
+ /*[3] Test isCallerInRole /////////////*/
+ try {
ejbContext.isCallerInRole("TheMan");
- policy.allow( policy.Context_isCallerInRole );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_isCallerInRole);
+ } catch (final IllegalStateException ise) {
+ }
- /*[4] Test getRollbackOnly ////////////*/
- try{
+ /*[4] Test getRollbackOnly ////////////*/
+ try {
ejbContext.getRollbackOnly();
- policy.allow( policy.Context_getRollbackOnly );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getRollbackOnly);
+ } catch (final IllegalStateException ise) {
+ }
- /*[5] Test setRollbackOnly ////////////*/
- try{
+ /*[5] Test setRollbackOnly ////////////*/
+ try {
ejbContext.setRollbackOnly();
- policy.allow( policy.Context_setRollbackOnly );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_setRollbackOnly);
+ } catch (final IllegalStateException ise) {
+ }
- /*[6] Test getUserTransaction /////////*/
- try{
+ /*[6] Test getUserTransaction /////////*/
+ try {
ejbContext.getUserTransaction();
- policy.allow( policy.Context_getUserTransaction );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getUserTransaction);
+ } catch (final IllegalStateException ise) {
+ }
- /*[7] Test getEJBObject ///////////////*/
- try{
+ /*[7] Test getEJBObject ///////////////*/
+ try {
ejbContext.getEJBObject();
- policy.allow( policy.Context_getEJBObject );
- }catch(IllegalStateException ise){}
+ policy.allow(policy.Context_getEJBObject);
+ } catch (final IllegalStateException ise) {
+ }
/* TO DO:
* Check for policy.Enterprise_bean_access
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessLocal.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessLocal.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessLocal.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessLocal.java Mon Jul 7 19:07:41 2014
@@ -34,7 +34,6 @@ public interface BasicStatefulBusinessLo
/**
* Throws an ApplicationException when invoked
- *
*/
public void throwApplicationException() throws ApplicationException;
@@ -43,7 +42,6 @@ public interface BasicStatefulBusinessLo
* This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
- *
*/
public void throwSystemException_NullPointer();
@@ -63,9 +61,9 @@ public interface BasicStatefulBusinessLo
* @return operations policy
*/
public OperationsPolicy getAllowedOperationsReport(String methodName);
-
+
/**
* Verify if we can invoke remove() on a stateful session bean as a business method
- */
+ */
public Object remove();
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessRemote.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessRemote.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessRemote.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulBusinessRemote.java Mon Jul 7 19:07:41 2014
@@ -34,7 +34,6 @@ public interface BasicStatefulBusinessRe
/**
* Throws an ApplicationException when invoked
- *
*/
public void throwApplicationException() throws ApplicationException;
@@ -43,7 +42,6 @@ public interface BasicStatefulBusinessRe
* This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
- *
*/
public void throwSystemException_NullPointer();
@@ -63,9 +61,9 @@ public interface BasicStatefulBusinessRe
* @return operations policy
*/
public OperationsPolicy getAllowedOperationsReport(String methodName);
-
+
/**
* Verify if we can invoke remove() on a stateful session bean as a business method
- */
+ */
public Object remove();
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulHome.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulHome.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulHome.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulHome.java Mon Jul 7 19:07:41 2014
@@ -20,5 +20,5 @@ package org.apache.openejb.test.stateful
public interface BasicStatefulHome extends javax.ejb.EJBHome {
public BasicStatefulObject createObject(String name)
- throws javax.ejb.CreateException, java.rmi.RemoteException;
+ throws javax.ejb.CreateException, java.rmi.RemoteException;
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedBean.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedBean.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedBean.java Mon Jul 7 19:07:41 2014
@@ -38,34 +38,36 @@ import org.apache.openejb.test.intercept
/**
* @version $Rev$ $Date$
*/
-@Stateful(name="BasicStatefulIntercepted")
+@Stateful(name = "BasicStatefulIntercepted")
@Interceptors({ClassInterceptor.class, SecondClassInterceptor.class})
-public class BasicStatefulInterceptedBean extends SuperInterceptedBean
- implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
-
- private static Map<String, Object> contextData = new HashMap<String, Object>();
+public class BasicStatefulInterceptedBean extends SuperInterceptedBean
+ implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
+
+ private static Map<String, Object> contextData = new HashMap<String, Object>();
/**
* A simple dummy business method to concat 2 strings
+ *
* @see org.apache.openejb.test.stateful.BasicStatefulInterceptedLocal#concat(java.lang.String, java.lang.String)
*/
- public String concat(String str1, String str2) {
+ public String concat(final String str1, final String str2) {
return str1.concat(str2);
}
/**
* A simple dummy busines method to reverse a string
+ *
* @see org.apache.openejb.test.stateful.BasicStatefulInterceptedLocal#reverse(java.lang.String)
*/
@Interceptors({MethodInterceptor.class})
- public String reverse(String str) {
- StringBuffer b = new StringBuffer(str);
+ public String reverse(final String str) {
+ final StringBuffer b = new StringBuffer(str);
return b.reverse().toString();
}
-
+
/**
* <code>ClassInterceptor</code> should not intercept this.
- *
+ *
* @return the contextData
*/
@ExcludeClassInterceptors
@@ -76,80 +78,77 @@ public class BasicStatefulInterceptedBea
/**
* @param ctxData the contextData to set
*/
- private void setContextData(Map<String, Object> ctxData) {
+ private void setContextData(final Map<String, Object> ctxData) {
BasicStatefulInterceptedBean.contextData.putAll(ctxData);
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept all business methods in this bean class.
* It cannot exclude even those annotated with <code>@ExcludeClassInterceptors</code>
- *
+ *
* @param ctx - InvocationContext
- *
- * @return - the result of the next method invoked. If a method returns void, proceed returns null.
- * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
- * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
+ * @return - the result of the next method invoked. If a method returns void, proceed returns null.
+ * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
+ * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
* If there is more than one such interceptor method, the invocation of proceed causes the container to execute those methods in order.
- *
* @throws Exception runtime exceptions or application exceptions that are allowed in the throws clause of the business method.
*/
@AroundInvoke
- public Object inBeanInterceptor(InvocationContext ctx) throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
+ public Object inBeanInterceptor(final InvocationContext ctx) throws Exception {
+ final Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
setContextData(ctxData);
return ctx.proceed();
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postConstruct of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostConstruct
public void inBeanInterceptorPostConstruct() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
setContextData(ctxData);
}
-
-
+
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postActivate of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostActivate
public void inBeanInterceptorPostActivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept prePassivate of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PrePassivate
public void inBeanInterceptorPrePassivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPrePassivate");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPrePassivate");
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept preDestroy of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PreDestroy
public void inBeanInterceptorPreDestroy() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
setContextData(ctxData);
}
-
-
+
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedLocal.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedLocal.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedLocal.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedLocal.java Mon Jul 7 19:07:41 2014
@@ -19,16 +19,14 @@ package org.apache.openejb.test.stateful
import java.util.Map;
/**
- *
- *
* @version $Rev$ $Date$
*/
public interface BasicStatefulInterceptedLocal {
-
+
public String reverse(String str);
-
+
public String concat(String str1, String str2);
-
+
public Map<String, Object> getContextData();
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedRemote.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedRemote.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedRemote.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulInterceptedRemote.java Mon Jul 7 19:07:41 2014
@@ -21,18 +21,16 @@ import java.util.Map;
import javax.ejb.Remote;
/**
- *
- *
* @version $Rev$ $Date$
*/
@Remote
public interface BasicStatefulInterceptedRemote {
-
+
public String reverse(String str);
-
+
public String concat(String str1, String str2);
-
+
public Map<String, Object> getContextData();
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalHome.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalHome.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalHome.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalHome.java Mon Jul 7 19:07:41 2014
@@ -19,13 +19,12 @@ package org.apache.openejb.test.stateful
/**
* The local home interface for BasicStatefulPojoBean.
- *
- *
+ *
* @version $Rev$ $Date$
*/
public interface BasicStatefulLocalHome extends javax.ejb.EJBLocalHome {
public BasicStatefulLocalObject create(String name) throws javax.ejb.CreateException;
-
+
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalObject.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalObject.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalObject.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulLocalObject.java Mon Jul 7 19:07:41 2014
@@ -23,47 +23,42 @@ import org.apache.openejb.test.object.Op
/**
* The local interface for BasicStatefulPojoBean.
- *
- *
+ *
* @version $Rev$ $Date$
*/
public interface BasicStatefulLocalObject extends javax.ejb.EJBLocalObject {
-
+
/**
* Reverses the string passed in then returns it
- *
*/
public String businessMethod(String text);
-
+
/**
* Throws an ApplicationException when invoked
- *
*/
public void throwApplicationException() throws ApplicationException;
-
+
/**
* Throws a java.lang.NullPointerException when invoked
- * This is a system exception and should result in the
+ * This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
- *
*/
public void throwSystemException_NullPointer();
-
+
/**
- * Returns a report of the bean's
+ * Returns a report of the bean's
* runtime permissions
- *
*/
public Properties getPermissionsReport();
-
+
/**
* Returns a report of the allowed opperations
* for one of the bean's methods.
- *
+ *
* @param methodName The method for which to get the allowed opperations report
*/
public OperationsPolicy getAllowedOperationsReport(String methodName);
-
+
public String remove(String obj);
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulObject.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulObject.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulObject.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulObject.java Mon Jul 7 19:07:41 2014
@@ -22,43 +22,39 @@ import java.util.Properties;
import org.apache.openejb.test.ApplicationException;
import org.apache.openejb.test.object.OperationsPolicy;
-public interface BasicStatefulObject extends javax.ejb.EJBObject{
-
+public interface BasicStatefulObject extends javax.ejb.EJBObject {
+
/**
* Reverses the string passed in then returns it
- *
*/
public String businessMethod(String text) throws RemoteException;
-
+
/**
* Throws an ApplicationException when invoked
- *
*/
public void throwApplicationException() throws RemoteException, ApplicationException;
-
+
/**
* Throws a java.lang.NullPointerException when invoked
- * This is a system exception and should result in the
+ * This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
- *
*/
public void throwSystemException_NullPointer() throws RemoteException;
-
+
/**
- * Returns a report of the bean's
+ * Returns a report of the bean's
* runtime permissions
- *
*/
public Properties getPermissionsReport() throws RemoteException;
-
+
/**
* Returns a report of the allowed opperations
* for one of the bean's methods.
- *
+ *
* @param methodName The method for which to get the allowed opperations report
*/
public OperationsPolicy getAllowedOperationsReport(String methodName) throws RemoteException;
-
+
public String remove(String obj) throws RemoteException;
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulPojoBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulPojoBean.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulPojoBean.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BasicStatefulPojoBean.java Mon Jul 7 19:07:41 2014
@@ -30,11 +30,11 @@ import org.apache.openejb.test.object.Op
public class BasicStatefulPojoBean implements BasicStatefulBusinessLocal, BasicStatefulBusinessRemote {
- public void create(String name) {
+ public void create(final String name) {
}
@Remove
- public void removeBean(){
+ public void removeBean() {
}
/**
@@ -43,18 +43,17 @@ public class BasicStatefulPojoBean imple
* @return
* @see org.apache.openejb.test.stateless.BasicStatelessObject#businessMethod
*/
- public String businessMethod(String text){
- StringBuffer b = new StringBuffer(text);
+ public String businessMethod(final String text) {
+ final StringBuffer b = new StringBuffer(text);
return b.reverse().toString();
}
- public Object echo(Object object) {
+ public Object echo(final Object object) {
return object;
}
/**
* Throws an ApplicationException when invoked
- *
*/
public void throwApplicationException() throws ApplicationException {
throw new ApplicationException("Testing ability to throw Application Exceptions");
@@ -65,7 +64,6 @@ public class BasicStatefulPojoBean imple
* This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
- *
*/
public void throwSystemException_NullPointer() {
throw new NullPointerException("Testing ability to throw System Exceptions");
@@ -73,21 +71,21 @@ public class BasicStatefulPojoBean imple
/**
* Maps to BasicStatelessObject.getPermissionsReport
- *
+ * <p/>
* Returns a report of the bean's
* runtime permissions
*
* @return
* @see org.apache.openejb.test.stateless.BasicStatelessObject#getPermissionsReport
*/
- public Properties getPermissionsReport(){
+ public Properties getPermissionsReport() {
/* TO DO: */
return null;
}
/**
* Maps to BasicStatelessObject.getAllowedOperationsReport
- *
+ * <p/>
* Returns a report of the allowed opperations
* for one of the bean's methods.
*
@@ -95,19 +93,19 @@ public class BasicStatefulPojoBean imple
* @return
* @see org.apache.openejb.test.stateless.BasicStatelessObject#getAllowedOperationsReport
*/
- public OperationsPolicy getAllowedOperationsReport(String methodName){
+ public OperationsPolicy getAllowedOperationsReport(final String methodName) {
return null;
}
@Resource
- public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException {
+ public void setSessionContext(final SessionContext ctx) throws EJBException, RemoteException {
}
-
+
public Object remove() {
return new String("Executed remove() Method");
}
-
- public String remove(String arg) {
+
+ public String remove(final String arg) {
return arg;
}
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java Mon Jul 7 19:07:41 2014
@@ -32,87 +32,87 @@ import javax.transaction.UserTransaction
import org.apache.openejb.test.object.Account;
import org.apache.openejb.test.object.Transaction;
-public class BeanTxStatefulBean implements javax.ejb.SessionBean{
+public class BeanTxStatefulBean implements javax.ejb.SessionBean {
+
-
private String name;
private SessionContext ejbContext;
private InitialContext jndiContext;
public final String jndiDatabaseEntry = "jdbc/stateful/beanManagedTransaction/database";
-
//=============================
// Home interface methods
//
+
/**
* Maps to BasicStatefulHome.create
- *
+ *
* @param name
- * @exception javax.ejb.CreateException
+ * @throws javax.ejb.CreateException
* @see BasicStatefulHome#createObject
*/
- public void ejbCreate(String name)
- throws javax.ejb.CreateException{
+ public void ejbCreate(final String name)
+ throws javax.ejb.CreateException {
this.name = name;
try {
- jndiContext = new InitialContext();
- } catch (Exception e){
- throw new CreateException("Can not get the initial context: "+e.getMessage());
+ jndiContext = new InitialContext();
+ } catch (final Exception e) {
+ throw new CreateException("Can not get the initial context: " + e.getMessage());
}
}
//
// Home interface methods
//=============================
-
+
//=============================
// Remote interface methods
//
-
+
/**
* Maps to BasicStatefulObject.businessMethod
- *
- * @return
+ *
+ * @return
* @see BasicStatefulObject#businessMethod
*/
- public Transaction getUserTransaction() throws RemoteException{
-
+ public Transaction getUserTransaction() throws RemoteException {
+
UserTransaction ut = null;
- try{
+ try {
ut = ejbContext.getUserTransaction();
- } catch (IllegalStateException ise){
+ } catch (final IllegalStateException ise) {
throw new RemoteException(ise.getMessage());
}
if (ut == null) return null;
return new Transaction(ut);
}
-
- public Transaction jndiUserTransaction() throws RemoteException{
+
+ public Transaction jndiUserTransaction() throws RemoteException {
UserTransaction ut = null;
- try{
- ut = (UserTransaction)jndiContext.lookup("java:comp/UserTransaction");
- } catch (Exception e){
+ try {
+ ut = (UserTransaction) jndiContext.lookup("java:comp/UserTransaction");
+ } catch (final Exception e) {
throw new RemoteException(e.getMessage());
}
if (ut == null) return null;
return new Transaction(ut);
}
- public void openAccount(Account acct, Boolean rollback) throws RemoteException, RollbackException{
-
- try{
-
- DataSource ds = (DataSource)javax.rmi.PortableRemoteObject.narrow( jndiContext.lookup("java:comp/env/datasource"), DataSource.class);
- Connection con = ds.getConnection();
+ public void openAccount(final Account acct, final Boolean rollback) throws RemoteException, RollbackException {
+
+ try {
+
+ final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/datasource"), DataSource.class);
+ final Connection con = ds.getConnection();
try {
- UserTransaction ut = ejbContext.getUserTransaction();
+ final UserTransaction ut = ejbContext.getUserTransaction();
/*[1] Begin the transaction */
ut.begin();
/*[2] Update the table */
- PreparedStatement stmt = con.prepareStatement("insert into Account (SSN, First_name, Last_name, Balance) values (?,?,?,?)");
+ final PreparedStatement stmt = con.prepareStatement("insert into Account (SSN, First_name, Last_name, Balance) values (?,?,?,?)");
try {
stmt.setString(1, acct.getSsn());
stmt.setString(2, acct.getFirstName());
@@ -132,45 +132,45 @@ public class BeanTxStatefulBean implemen
} finally {
con.close();
}
- } catch (RollbackException re){
+ } catch (final RollbackException re) {
throw re;
- } catch (Exception e){
+ } catch (final Exception e) {
e.printStackTrace();
- throw new RemoteException("[Bean] "+e.getClass().getName()+" : "+e.getMessage());
+ throw new RemoteException("[Bean] " + e.getClass().getName() + " : " + e.getMessage());
}
}
- public Account retreiveAccount(String ssn) throws RemoteException {
- Account acct = new Account();
- try{
- DataSource ds = (DataSource)javax.rmi.PortableRemoteObject.narrow( jndiContext.lookup("java:comp/env/datasource"), DataSource.class);
- Connection con = ds.getConnection();
+ public Account retreiveAccount(final String ssn) throws RemoteException {
+ final Account acct = new Account();
+ try {
+ final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/datasource"), DataSource.class);
+ final Connection con = ds.getConnection();
try {
- PreparedStatement stmt = con.prepareStatement("select * from Account where SSN = ?");
+ final PreparedStatement stmt = con.prepareStatement("select * from Account where SSN = ?");
try {
stmt.setString(1, ssn);
- ResultSet rs = stmt.executeQuery();
+ final ResultSet rs = stmt.executeQuery();
if (!rs.next()) return null;
- acct.setSsn( rs.getString(1) );
- acct.setFirstName( rs.getString(2) );
- acct.setLastName( rs.getString(3) );
- acct.setBalance( rs.getInt(4) );
+ acct.setSsn(rs.getString(1));
+ acct.setFirstName(rs.getString(2));
+ acct.setLastName(rs.getString(3));
+ acct.setBalance(rs.getInt(4));
} finally {
stmt.close();
}
} finally {
con.close();
}
- } catch (Exception e){
+ } catch (final Exception e) {
e.printStackTrace();
- throw new RemoteException("[Bean] "+e.getClass().getName()+" : "+e.getMessage());
+ throw new RemoteException("[Bean] " + e.getClass().getName() + " : " + e.getMessage());
}
return acct;
}
- public String remove(String arg) {
+ public String remove(final String arg) {
return arg;
}
//
@@ -181,37 +181,41 @@ public class BeanTxStatefulBean implemen
//=================================
// SessionBean interface methods
//
+
/**
* Set the associated session context. The container calls this method
* after the instance creation.
*/
- public void setSessionContext(SessionContext ctx) throws EJBException,RemoteException {
+ public void setSessionContext(final SessionContext ctx) throws EJBException, RemoteException {
ejbContext = ctx;
}
+
/**
* A container invokes this method before it ends the life of the session
* object. This happens as a result of a client's invoking a remove
* operation, or when a container decides to terminate the session object
* after a timeout.
*/
- public void ejbRemove() throws EJBException,RemoteException {
+ public void ejbRemove() throws EJBException, RemoteException {
}
+
/**
* The activate method is called when the instance is activated
* from its "passive" state. The instance should acquire any resource
* that it has released earlier in the ejbPassivate() method.
*/
- public void ejbActivate() throws EJBException,RemoteException {
+ public void ejbActivate() throws EJBException, RemoteException {
}
+
/**
* The passivate method is called before the instance enters
* the "passive" state. The instance should release any resources that
* it can re-acquire later in the ejbActivate() method.
*/
- public void ejbPassivate() throws EJBException,RemoteException {
+ public void ejbPassivate() throws EJBException, RemoteException {
}
//
// SessionBean interface methods
//==================================
-
+
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulHome.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulHome.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulHome.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulHome.java Mon Jul 7 19:07:41 2014
@@ -20,5 +20,5 @@ package org.apache.openejb.test.stateful
public interface BeanTxStatefulHome extends javax.ejb.EJBHome {
public BeanTxStatefulObject create(String name)
- throws javax.ejb.CreateException, java.rmi.RemoteException;
+ throws javax.ejb.CreateException, java.rmi.RemoteException;
}
Modified: tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulObject.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulObject.java?rev=1608563&r1=1608562&r2=1608563&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulObject.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulObject.java Mon Jul 7 19:07:41 2014
@@ -21,10 +21,10 @@ import java.rmi.RemoteException;
import org.apache.openejb.test.object.Account;
import org.apache.openejb.test.object.Transaction;
-public interface BeanTxStatefulObject extends javax.ejb.EJBObject{
-
+public interface BeanTxStatefulObject extends javax.ejb.EJBObject {
+
public Transaction getUserTransaction() throws RemoteException;
-
+
public Transaction jndiUserTransaction() throws RemoteException;
public void openAccount(Account account, Boolean commit) throws RemoteException, javax.transaction.RollbackException;