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 11:55:42 UTC

svn commit: r497773 [2/2] - in /incubator/openejb/trunk/openejb3: container/openejb-core/src/main/java/org/apache/openejb/alt/config/ container/openejb-core/src/main/java/org/apache/openejb/core/stateful/ itests/openejb-itests-beans/src/main/java/org/a...

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessLocalTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessLocalTestSuite.java?view=diff&rev=497773&r1=497772&r2=497773
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessLocalTestSuite.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessLocalTestSuite.java Fri Jan 19 02:55:40 2007
@@ -22,12 +22,11 @@
  * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
  * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
  * @author <a href="mailto:nour.mohammad@gmail.com">Mohammad Nour El-Din</a>
- *
  * @version $Rev$ $Date$
  */
-public class StatelessLocalTestSuite extends junit.framework.TestCase{
+public class StatelessLocalTestSuite extends junit.framework.TestCase {
 
-    public StatelessLocalTestSuite(String name){
+    public StatelessLocalTestSuite(String name) {
         super(name);
     }
 
@@ -40,9 +39,9 @@
         suite.addTest(new StatelessLocalBusinessIntfcTests());
         // MNour: Why we put this remote test into this suite of local tests ???
         suite.addTest(new StatelessRemoteBusinessIntfcTests());
-        suite.addTest(new StatelessEjbHomeTests() );
-        suite.addTest(new StatelessPojoEjbLocalHomeTests() );
-        suite.addTest(new StatelessPojoEjbLocalObjectTests() );
+        suite.addTest(new StatelessEjbHomeTests());
+        suite.addTest(new StatelessPojoEjbLocalHomeTests());
+        suite.addTest(new StatelessPojoEjbLocalObjectTests());
         suite.addTest(new StatelessEjbObjectTests());
         suite.addTest(new StatelessRemoteIntfcTests());
         suite.addTest(new StatelessLocalIntfcTests());
@@ -55,6 +54,8 @@
         suite.addTest(new StatelessJndiEncTests());
         suite.addTest(new StatelessContextLookupTests());
         suite.addTest(new StatelessPojoContextLookupTests());
+        suite.addTest(new StatelessFieldInjectionTests());
+        suite.addTest(new StatelessSetterInjectionTests());
         suite.addTest(new StatelessRmiIiopTests());
         suite.addTest(new MiscEjbTests());
         /* TO DO

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java?view=auto&rev=497773
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java Fri Jan 19 02:55:40 2007
@@ -0,0 +1,223 @@
+/**
+ * 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.stateless;
+
+import org.apache.openejb.test.stateful.StatefulTestClient;
+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 StatelessSetterInjectionTests extends StatefulTestClient {
+
+    protected EncStatelessHome   ejbHome;
+    protected EncStatelessObject ejbObject;
+
+    public StatelessSetterInjectionTests(){
+        super("SetterInjection.");
+    }
+
+    protected void setUp() throws Exception{
+        super.setUp();
+        Object obj = initialContext.lookup("client/tests/stateless/SetterInjectionStatelessBean");
+        ejbHome = (EncStatelessHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatelessHome.class);
+        ejbObject = ejbHome.create();
+
+        /*[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/stateless/StatelessTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestSuite.java?view=diff&rev=497773&r1=497772&r2=497773
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestSuite.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestSuite.java Fri Jan 19 02:55:40 2007
@@ -56,6 +56,8 @@
         suite.addTest(new StatelessJndiEncTests());
         suite.addTest(new StatelessContextLookupTests());
         suite.addTest(new StatelessPojoContextLookupTests());
+        suite.addTest(new StatelessFieldInjectionTests());
+        suite.addTest(new StatelessSetterInjectionTests());
         suite.addTest(new StatelessRmiIiopTests());
         suite.addTest(new MiscEjbTests());
         /* TO DO