You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2007/01/19 06:33:29 UTC
svn commit: r497708 - in /incubator/openejb/trunk/openejb3/itests:
openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/
openejb-itests-beans/src/main/resources/META-INF/
openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/
Author: dblevins
Date: Thu Jan 18 21:33:26 2007
New Revision: 497708
URL: http://svn.apache.org/viewvc?view=rev&rev=497708
Log:
basic field injection tests (not yet working and still disabled)
Added:
incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/FieldInjectionStatefulBean.java
incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java
Modified:
incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml
incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml
incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java
incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulLocalTestSuite.java
incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulTestSuite.java
Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/FieldInjectionStatefulBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/FieldInjectionStatefulBean.java?view=auto&rev=497708
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/FieldInjectionStatefulBean.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/FieldInjectionStatefulBean.java Thu Jan 18 21:33:26 2007
@@ -0,0 +1,258 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.test.stateful;
+
+import junit.framework.Assert;
+import junit.framework.AssertionFailedError;
+import org.apache.openejb.test.TestFailureException;
+import org.apache.openejb.test.entity.bmp.BasicBmpHome;
+import org.apache.openejb.test.stateless.BasicStatelessHome;
+
+import javax.ejb.CreateException;
+import javax.ejb.SessionContext;
+import javax.ejb.SessionBean;
+import javax.ejb.EJBException;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
+import java.rmi.RemoteException;
+
+/**
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ */
+public class FieldInjectionStatefulBean implements SessionBean {
+
+
+ private String name;
+ private SessionContext ejbContext;
+ private BasicBmpHome bmpHome;
+ private BasicStatefulHome statefulHome;
+ private BasicStatelessHome statelessHome;
+ private String striing;
+ private Double doouble;
+ private Long loong;
+ private Float flooat;
+ private Integer inteeger;
+ private Short shoort;
+ private Boolean booolean;
+ private Byte byyte;
+ private Character chaaracter;
+ private DataSource daataSource;
+ private EntityManagerFactory emf;
+ private EntityManager em;
+ private EntityManager eem;
+ private EntityManager pem;
+
+ //=============================
+ // Home interface methods
+ //
+
+ /**
+ * Maps to EncStatefulHome.create
+ *
+ * @param name
+ * @throws javax.ejb.CreateException
+ * @see EncStatefulHome#create
+ */
+ public void ejbCreate(String name) throws CreateException {
+ this.name = name;
+ }
+ //
+ // Home interface methods
+ //=============================
+
+ //=============================
+ // Remote interface methods
+ //
+
+ public void lookupEntityBean() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJBObject is null", bmpHome);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupStatefulBean() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJBObject is null", statefulHome);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupStatelessBean() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EJBObject is null", statelessHome);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupStringEntry() throws TestFailureException {
+ try {
+ String expected = new String("1");
+ Assert.assertNotNull("The String looked up is null", striing);
+ Assert.assertEquals(expected, striing);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupDoubleEntry() throws TestFailureException {
+ try {
+ Double expected = new Double(1.0D);
+
+ Assert.assertNotNull("The Double looked up is null", doouble);
+ Assert.assertEquals(expected, doouble);
+
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupLongEntry() throws TestFailureException {
+ try {
+ Long expected = new Long(1L);
+
+ Assert.assertNotNull("The Long looked up is null", loong);
+ Assert.assertEquals(expected, loong);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupFloatEntry() throws TestFailureException {
+ try {
+ Float expected = new Float(1.0F);
+
+ Assert.assertNotNull("The Float looked up is null", flooat);
+ Assert.assertEquals(expected, flooat);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupIntegerEntry() throws TestFailureException {
+ try {
+ Integer expected = new Integer(1);
+
+ Assert.assertNotNull("The Integer looked up is null", inteeger);
+ Assert.assertEquals(expected, inteeger);
+
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupShortEntry() throws TestFailureException {
+ try {
+ Short expected = new Short((short) 1);
+
+ Assert.assertNotNull("The Short looked up is null", shoort);
+ Assert.assertEquals(expected, shoort);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupBooleanEntry() throws TestFailureException {
+ try {
+ Boolean expected = new Boolean(true);
+
+ Assert.assertNotNull("The Boolean looked up is null", booolean);
+ Assert.assertEquals(expected, booolean);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupByteEntry() throws TestFailureException {
+ try {
+ Byte expected = new Byte((byte) 1);
+
+ Assert.assertNotNull("The Byte looked up is null", byyte);
+ Assert.assertEquals(expected, byyte);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupCharacterEntry() throws TestFailureException {
+ try {
+ Character expected = new Character('D');
+
+ Assert.assertNotNull("The Character looked up is null", chaaracter);
+ Assert.assertEquals(expected, chaaracter);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupResource() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The DataSource is null", daataSource);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupPersistenceUnit() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EntityManagerFactory is null", emf);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupPersistenceContext() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The EntityManager is null", em);
+
+ try {
+ // call a do nothing method to assure entity manager actually exists
+ em.getFlushMode();
+ } catch (Exception e) {
+ Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
+ }
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+ }
+
+ public void lookupSessionContext() throws TestFailureException {
+ try {
+ Assert.assertNotNull("The SessionContext is null", ejbContext);
+ } catch (AssertionFailedError afe) {
+ throw new TestFailureException(afe);
+ }
+
+ }
+
+ public void ejbActivate() throws EJBException, RemoteException {
+ }
+
+ public void ejbPassivate() throws EJBException, RemoteException {
+ }
+
+ public void ejbRemove() throws EJBException, RemoteException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException, RemoteException {
+ }
+}
Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml?view=diff&rev=497708&r1=497707&r2=497708
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml Thu Jan 18 21:33:26 2007
@@ -1084,6 +1084,174 @@
<!--
########################################################
+ ID: client/tests/stateful/FieldInjectionStatefulBean
+ ########################################################
+ -->
+
+ <session>
+ <ejb-name>FieldInjectionStatefulBean</ejb-name>
+ <home>org.apache.openejb.test.stateful.EncStatefulHome</home>
+ <remote>org.apache.openejb.test.stateful.EncStatefulObject</remote>
+ <ejb-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</ejb-class>
+ <session-type>Stateful</session-type>
+ <transaction-type>Bean</transaction-type>
+ <env-entry>
+ <env-entry-name>stateful/references/Boolean</env-entry-name>
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+ <env-entry-value>true</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>booolean</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/String</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>striing</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/Double</env-entry-name>
+ <env-entry-type>java.lang.Double</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>doouble</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/Long</env-entry-name>
+ <env-entry-type>java.lang.Long</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>loong</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/Float</env-entry-name>
+ <env-entry-type>java.lang.Float</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>flooat</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/Integer</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>inteeger</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/Short</env-entry-name>
+ <env-entry-type>java.lang.Short</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>shoort</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/Byte</env-entry-name>
+ <env-entry-type>java.lang.Byte</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>byyte</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>stateful/references/Character</env-entry-name>
+ <env-entry-type>java.lang.Character</env-entry-type>
+ <env-entry-value>D</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>chaaracter</injection-target-name>
+ </injection-target>
+ </env-entry>
+ <ejb-ref>
+ <ejb-ref-name>stateful/beanReferences/bmp_entity</ejb-ref-name>
+ <ejb-ref-type>Entity</ejb-ref-type>
+ <home>org.apache.openejb.test.entity.bmp.BasicBmpHome</home>
+ <remote>org.apache.openejb.test.entity.bmp.BasicBmpObject</remote>
+ <ejb-link>BasicBmpBean</ejb-link>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>bmpBean</injection-target-name>
+ </injection-target>
+ </ejb-ref>
+ <ejb-ref>
+ <ejb-ref-name>stateful/beanReferences/stateful</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <home>org.apache.openejb.test.stateful.BasicStatefulHome</home>
+ <remote>org.apache.openejb.test.stateful.BasicStatefulObject</remote>
+ <ejb-link>BasicStatefulBean</ejb-link>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>statefulBean</injection-target-name>
+ </injection-target>
+ </ejb-ref>
+ <ejb-ref>
+ <ejb-ref-name>stateful/beanReferences/stateless</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <home>org.apache.openejb.test.stateless.BasicStatelessHome</home>
+ <remote>org.apache.openejb.test.stateless.BasicStatelessObject</remote>
+ <ejb-link>BasicStatelessBean</ejb-link>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>statelessBean</injection-target-name>
+ </injection-target>
+ </ejb-ref>
+ <resource-ref>
+ <res-ref-name>datasource</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>daataSource</injection-target-name>
+ </injection-target>
+ </resource-ref>
+ <resource-env-ref>
+ <resource-env-ref-name>sessioncontext</resource-env-ref-name>
+ <resource-env-ref-type>javax.ejb.SessionContext</resource-env-ref-type>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>ejbContext</injection-target-name>
+ </injection-target>
+ </resource-env-ref>
+ <persistence-unit-ref>
+ <description>
+ Persistence unit for testing the functionality.
+ </description>
+ <persistence-unit-ref-name>persistence/TestUnit</persistence-unit-ref-name>
+ <persistence-unit-name>openjpa-test-unit</persistence-unit-name>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>emf</injection-target-name>
+ </injection-target>
+ </persistence-unit-ref>
+ <persistence-context-ref>
+ <description>
+ Persistence context for testing the functionality.
+ </description>
+ <persistence-context-ref-name>persistence/TestContext</persistence-context-ref-name>
+ <persistence-unit-name>openjpa-test-unit</persistence-unit-name>
+ <injection-target>
+ <injection-target-class>org.apache.openejb.test.stateful.FieldInjectionStatefulBean</injection-target-class>
+ <injection-target-name>em</injection-target-name>
+ </injection-target>
+ </persistence-context-ref>
+ </session>
+
+ <!--
+ ########################################################
ID: client/tests/stateful/EncBean
########################################################
-->
Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml?view=diff&rev=497708&r1=497707&r2=497708
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml Thu Jan 18 21:33:26 2007
@@ -163,6 +163,10 @@
container-id="Default Stateful Container">
<resource-link res-ref-name="datasource" res-id="Default JDBC Database"/>
</ejb-deployment>
+ <ejb-deployment ejb-name="FieldInjectionStatefulBean" deployment-id="client/tests/stateful/FieldInjectionStatefulBean"
+ container-id="Default Stateful Container">
+ <resource-link res-ref-name="datasource" res-id="Default JDBC Database"/>
+ </ejb-deployment>
<ejb-deployment ejb-name="PersistenceContextStatefulBean" deployment-id="client/tests/stateful/PersistenceContextStatefulBean"
container-id="Default Stateful Container">
<resource-link res-ref-name="datasource" res-id="Default JDBC Database"/>
Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java?view=diff&rev=497708&r1=497707&r2=497708
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulContextLookupTests.java Thu Jan 18 21:33:26 2007
@@ -31,7 +31,7 @@
protected EncStatefulObject ejbObject;
public StatefulContextLookupTests(){
- super("JNDI_ENC.");
+ super("EJB_CONTEXT_LOOKUP.");
}
protected void setUp() throws Exception{
Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java?view=auto&rev=497708
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulFieldInjectionTests.java Thu Jan 18 21:33:26 2007
@@ -0,0 +1,222 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.test.stateful;
+
+import org.apache.openejb.test.TestManager;
+import org.apache.openejb.test.TestFailureException;
+
+/**
+ * [4] Should be run as the fourth test suite of the StatefulTestClients
+ *
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ */
+public class StatefulFieldInjectionTests extends StatefulTestClient{
+
+ protected EncStatefulHome ejbHome;
+ protected EncStatefulObject ejbObject;
+
+ public StatefulFieldInjectionTests(){
+ super("EJB_CONTEXT_LOOKUP.");
+ }
+
+ protected void setUp() throws Exception{
+ super.setUp();
+ Object obj = initialContext.lookup("client/tests/stateful/FieldInjectionStatefulBean");
+ ejbHome = (EncStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatefulHome.class);
+ ejbObject = ejbHome.create("Enc Bean");
+
+ /*[2] Create database table */
+ TestManager.getDatabase().createEntityTable();
+ }
+
+ /**
+ * Tears down the fixture, for example, close a network connection.
+ * This method is called after a test is executed.
+ */
+ protected void tearDown() throws Exception {
+ try {
+ /*[1] Drop database table */
+ TestManager.getDatabase().dropEntityTable();
+ } catch (Exception e){
+ throw e;
+ } finally {
+ super.tearDown();
+ }
+ }
+
+ public void test01_lookupStringEntry() {
+ try{
+ ejbObject.lookupStringEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test02_lookupDoubleEntry() {
+ try{
+ ejbObject.lookupDoubleEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test03_lookupLongEntry() {
+ try{
+ ejbObject.lookupLongEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test04_lookupFloatEntry() {
+ try{
+ ejbObject.lookupFloatEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test05_lookupIntegerEntry() {
+ try{
+ ejbObject.lookupIntegerEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test06_lookupShortEntry() {
+ try{
+ ejbObject.lookupShortEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test07_lookupBooleanEntry() {
+ try{
+ ejbObject.lookupBooleanEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test08_lookupByteEntry() {
+ try{
+ ejbObject.lookupByteEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test09_lookupCharacterEntry() {
+ try{
+ ejbObject.lookupCharacterEntry();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test10_lookupEntityBean() {
+ try{
+ ejbObject.lookupEntityBean();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test11_lookupStatefulBean() {
+ try{
+ ejbObject.lookupStatefulBean();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test12_lookupStatelessBean() {
+ try{
+ ejbObject.lookupStatelessBean();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test13_lookupResource() {
+ try{
+ ejbObject.lookupResource();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test14_lookupPersistenceUnit() {
+ try{
+ ejbObject.lookupPersistenceUnit();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test15_lookupPersistenceContext() {
+ try{
+ ejbObject.lookupPersistenceContext();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ public void test18_lookupSessionContext() {
+ try{
+ ejbObject.lookupSessionContext();
+ } catch (TestFailureException e){
+ throw e.error;
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+}
Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulLocalTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulLocalTestSuite.java?view=diff&rev=497708&r1=497707&r2=497708
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulLocalTestSuite.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulLocalTestSuite.java Thu Jan 18 21:33:26 2007
@@ -54,6 +54,8 @@
suite.addTest(new StatefulJndiEncTests());
suite.addTest(new StatefulContextLookupTests());
suite.addTest(new StatefulPojoContextLookupTests());
+// suite.addTest(new StatefulFieldInjectionTests());
+// suite.addTest(new StatefulPersistenceContextTests());
suite.addTest(new StatefulRmiIiopTests());
/* TO DO
suite.addTest(new StatefulEjbContextTests());
Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulTestSuite.java?view=diff&rev=497708&r1=497707&r2=497708
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulTestSuite.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulTestSuite.java Thu Jan 18 21:33:26 2007
@@ -53,8 +53,10 @@
suite.addTest(new StatefulJndiEncTests());
suite.addTest(new StatefulContextLookupTests());
suite.addTest(new StatefulPojoContextLookupTests());
+// suite.addTest(new StatefulFieldInjectionTests());
+// suite.addTest(new StatefulPersistenceContextTests());
suite.addTest(new StatefulRmiIiopTests());
- /* TO DO
+ /* TO DO
suite.addTest(new StatefulEjbContextTests());
suite.addTest(new BMTStatefulEjbContextTests());
suite.addTest(new BMTStatefulEncTests());