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 04:08:14 UTC

svn commit: r497695 - 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/statef...

Author: dblevins
Date: Thu Jan 18 19:08:13 2007
New Revision: 497695

URL: http://svn.apache.org/viewvc?view=rev&rev=497695
Log:
Moved persistence context tests out to another test.  Put calls to execute the session context lookup test where they were missing.

Added:
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulBean.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulHome.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulObject.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPersistenceContextTests.java
Modified:
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulBean.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulPojoBean.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulObject.java
    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/StatefulJndiEncTests.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPojoContextLookupTests.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessContextLookupTests.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessJndiEncTests.java
    incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoContextLookupTests.java

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulBean.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulBean.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulBean.java Thu Jan 18 19:08:13 2007
@@ -322,116 +322,6 @@
     }
 
 
-    public void lookupExtendedPersistenceContext() throws TestFailureException{
-        try{
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                if (extendedEntityManager != null) {
-                    Assert.assertSame("Extended entity manager should be the same instance that was found last time",
-                            extendedEntityManager,
-                            em);
-                    Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
-                            extendedEntityManager.getDelegate(),
-                            em.getDelegate());
-                }
-                extendedEntityManager = em;
-            } catch (Exception e){
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
-    public void lookupPropagatedPersistenceContext() throws TestFailureException{
-        try{
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                // get the raw entity manager so we can test it below
-                inheritedDelegate = (EntityManager) em.getDelegate();
-
-                // The extended entity manager is not propigated to a non-extended entity manager unless there is a transaction
-                EntityManager nonExtendedEm = (EntityManager)ctx.lookup("java:comp/env/persistence/TestContext");
-                nonExtendedEm.getFlushMode();
-                EntityManager nonExtendedDelegate = ((EntityManager) nonExtendedEm.getDelegate());
-                Assert.assertTrue("non-extended entity manager should be open", nonExtendedDelegate.isOpen());
-                Assert.assertNotSame("Extended non-extended entity manager shound not be the same instance as extendend entity manager when accessed out side of a transactions",
-                        inheritedDelegate,
-                        nonExtendedDelegate);
-
-                // When the non-extended entity manager is accessed within a transaction is should see the stateful extended context.
-                //
-                // Note: this code also tests EBJ 3.0 Persistence spec 5.9.1 "UserTransaction is begun within the method, the
-                // container associates the persistence context with the JTA transaction and calls EntityManager.joinTransaction."
-                // If our the extended entity manager were not associted with the transaction, the non-extended entity manager would
-                // not see it.
-                UserTransaction userTransaction = ejbContext.getUserTransaction();
-                userTransaction.begin();
-                try {
-                    Assert.assertSame("Extended non-extended entity manager to be same instance as extendend entity manager",
-                            inheritedDelegate,
-                            nonExtendedEm.getDelegate());
-                } finally {
-                    userTransaction.commit();
-                }
-
-                // When a stateful bean with an extended entity manager creates another stateful bean, the new bean will
-                // inherit the extended entity manager (assuming it contains an extended entity manager for the same persistence
-                // unit).
-                EncStatefulHome home = (EncStatefulHome) ejbContext.getEJBHome();
-                EncStatefulObject encStatefulObject = home.create("PropagatedPersistenceContext");
-
-                // test the new stateful bean recieved the context
-                encStatefulObject.testPropgation();
-
-                // remove the bean
-                encStatefulObject.remove();
-            } catch (Exception e){
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
-    public void testPropgation() throws TestFailureException {
-        if (inheritedDelegate == null) return;
-        try {
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                EntityManager delegate = (EntityManager) em.getDelegate();
-                Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
-                        inheritedDelegate,
-                        delegate);
-            } catch (Exception e){
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
     public void lookupSessionContext() throws TestFailureException{
         try{
             try{

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulPojoBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulPojoBean.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulPojoBean.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/ContextLookupStatefulPojoBean.java Thu Jan 18 19:08:13 2007
@@ -296,117 +296,6 @@
         }
     }
 
-    public void lookupExtendedPersistenceContext() throws TestFailureException{
-        try{
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                if (extendedEntityManager != null) {
-                    Assert.assertSame("Extended entity manager should be the same instance that was found last time",
-                            extendedEntityManager,
-                            em);
-                    Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
-                            extendedEntityManager.getDelegate(),
-                            em.getDelegate());
-                }
-                extendedEntityManager = em;
-            } catch (Exception e){
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
-    public void lookupPropagatedPersistenceContext() throws TestFailureException{
-        try{
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                // get the raw entity manager so we can test it below
-                inheritedDelegate = (EntityManager) em.getDelegate();
-
-                // The extended entity manager is not propigated to a non-extended entity manager unless there is a transaction
-                EntityManager nonExtendedEm = (EntityManager)ctx.lookup("java:comp/env/persistence/TestContext");
-                nonExtendedEm.getFlushMode();
-                EntityManager nonExtendedDelegate = ((EntityManager) nonExtendedEm.getDelegate());
-                Assert.assertTrue("non-extended entity manager should be open", nonExtendedDelegate.isOpen());
-                Assert.assertNotSame("Extended non-extended entity manager shound not be the same instance as extendend entity manager when accessed out side of a transactions",
-                        inheritedDelegate,
-                        nonExtendedDelegate);
-
-                // When the non-extended entity manager is accessed within a transaction is should see the stateful extended context.
-                //
-                // Note: this code also tests EBJ 3.0 Persistence spec 5.9.1 "UserTransaction is begun within the method, the
-                // container associates the persistence context with the JTA transaction and calls EntityManager.joinTransaction."
-                // If our the extended entity manager were not associted with the transaction, the non-extended entity manager would
-                // not see it.
-                UserTransaction userTransaction = ejbContext.getUserTransaction();
-                userTransaction.begin();
-                try {
-                    Assert.assertSame("Extended non-extended entity manager to be same instance as extendend entity manager",
-                            inheritedDelegate,
-                            nonExtendedEm.getDelegate());
-                } finally {
-                    userTransaction.commit();
-                }
-
-                // When a stateful bean with an extended entity manager creates another stateful bean, the new bean will
-                // inherit the extended entity manager (assuming it contains an extended entity manager for the same persistence
-                // unit).
-                EncStatefulHome home = (EncStatefulHome) ejbContext.getEJBHome();
-                EncStatefulObject encStatefulObject = home.create("PropagatedPersistenceContext");
-
-                // test the new stateful bean recieved the context
-                encStatefulObject.testPropgation();
-
-                // remove the bean
-                encStatefulObject.remove();
-            } catch (Exception e){
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
-    public void testPropgation() throws TestFailureException {
-        if (inheritedDelegate == null) return;
-        try {
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                EntityManager delegate = (EntityManager) em.getDelegate();
-                Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
-                        inheritedDelegate,
-                        delegate);
-            } catch (Exception e){
-                e.printStackTrace();
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
     public void lookupSessionContext() throws TestFailureException{
         try{
             try{

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java Thu Jan 18 19:08:13 2007
@@ -48,10 +48,6 @@
 
     private String name;
     private SessionContext ejbContext;
-    private EntityManager extendedEntityManager;
-
-    // Used for testing propigation
-    private static EntityManager inheritedDelegate;
 
     //=============================
     // Home interface methods
@@ -362,125 +358,6 @@
         }
     }
 
-    public void lookupExtendedPersistenceContext() throws TestFailureException{
-        try{
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                if (extendedEntityManager != null) {
-                    Assert.assertSame("Extended entity manager should be the same instance that was found last time",
-                            extendedEntityManager,
-                            em);
-                    Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
-                            extendedEntityManager.getDelegate(),
-                            em.getDelegate());
-                }
-                extendedEntityManager = em;
-
-                UserTransaction userTransaction = ejbContext.getUserTransaction();
-                userTransaction.begin();
-                try {
-                    em.getFlushMode();
-                } finally {
-                    userTransaction.commit();
-                }
-            } catch (Exception e){
-                e.printStackTrace();
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
-    public void lookupPropagatedPersistenceContext() throws TestFailureException{
-        try{
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                // get the raw entity manager so we can test it below
-                inheritedDelegate = (EntityManager) em.getDelegate();
-
-                // The extended entity manager is not propigated to a non-extended entity manager unless there is a transaction
-                EntityManager nonExtendedEm = (EntityManager)ctx.lookup("java:comp/env/persistence/TestContext");
-                nonExtendedEm.getFlushMode();
-                EntityManager nonExtendedDelegate = ((EntityManager) nonExtendedEm.getDelegate());
-                Assert.assertTrue("non-extended entity manager should be open", nonExtendedDelegate.isOpen());
-                Assert.assertNotSame("Extended non-extended entity manager shound not be the same instance as extendend entity manager when accessed out side of a transactions",
-                        inheritedDelegate,
-                        nonExtendedDelegate);
-
-                // When the non-extended entity manager is accessed within a transaction is should see the stateful extended context.
-                //
-                // Note: this code also tests EBJ 3.0 Persistence spec 5.9.1 "UserTransaction is begun within the method, the
-                // container associates the persistence context with the JTA transaction and calls EntityManager.joinTransaction."
-                // If our the extended entity manager were not associted with the transaction, the non-extended entity manager would
-                // not see it.
-                UserTransaction userTransaction = ejbContext.getUserTransaction();
-                userTransaction.begin();
-                try {
-                    Assert.assertSame("Extended non-extended entity manager to be same instance as extendend entity manager",
-                            inheritedDelegate,
-                            nonExtendedEm.getDelegate());
-                } finally {
-                    userTransaction.commit();
-                }
-
-                // When a stateful bean with an extended entity manager creates another stateful bean, the new bean will
-                // inherit the extended entity manager (assuming it contains an extended entity manager for the same persistence
-                // unit).
-                EncStatefulHome home = (EncStatefulHome) ejbContext.getEJBHome();
-                EncStatefulObject encStatefulObject = home.create("PropagatedPersistenceContext");
-
-                // test the new stateful bean recieved the context
-                encStatefulObject.testPropgation();
-
-                // remove the bean
-                encStatefulObject.remove();
-            } catch (Exception e){
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
-
-    public void testPropgation() throws TestFailureException {
-        if (inheritedDelegate == null) return;
-        try {
-            try{
-                InitialContext ctx = new InitialContext();
-                Assert.assertNotNull("The InitialContext is null", ctx);
-                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
-                Assert.assertNotNull("The EntityManager is null", em);
-
-                // call a do nothing method to assure entity manager actually exists
-                em.getFlushMode();
-
-                EntityManager delegate = (EntityManager) em.getDelegate();
-                Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
-                        inheritedDelegate,
-                        delegate);
-            } catch (Exception e){
-                e.printStackTrace();
-                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-            }
-        } catch (AssertionFailedError afe){
-            throw new TestFailureException(afe);
-        }
-    }
 
     public void lookupSessionContext() throws TestFailureException{
         try{

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulObject.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulObject.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulObject.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulObject.java Thu Jan 18 19:08:13 2007
@@ -34,9 +34,6 @@
     public void lookupResource() throws TestFailureException, RemoteException;
     public void lookupPersistenceUnit() throws TestFailureException, RemoteException;
     public void lookupPersistenceContext() throws TestFailureException, RemoteException;
-    public void lookupExtendedPersistenceContext() throws TestFailureException, RemoteException;
-    public void lookupPropagatedPersistenceContext() throws TestFailureException, RemoteException;
-    public void testPropgation() throws TestFailureException, RemoteException;
     public void lookupSessionContext() throws TestFailureException,RemoteException;
     public void lookupStringEntry()  throws TestFailureException, RemoteException;
     public void lookupDoubleEntry()  throws TestFailureException, RemoteException;

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulBean.java?view=auto&rev=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulBean.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulBean.java Thu Jan 18 19:08:13 2007
@@ -0,0 +1,181 @@
+/**
+ * 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 javax.ejb.SessionContext;
+import javax.naming.InitialContext;
+import javax.persistence.EntityManager;
+import javax.transaction.UserTransaction;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class PersistenceContextStatefulBean {
+
+    private EntityManager extendedEntityManager;
+
+    // Used for testing propigation
+    private static EntityManager inheritedDelegate;
+    private SessionContext ejbContext;
+
+    public void setSessionContext(SessionContext ctx) {
+        ejbContext = ctx;
+    }
+
+    public void testPersistenceContext() throws TestFailureException {
+        try{
+            try{
+                InitialContext ctx = new InitialContext();
+                Assert.assertNotNull("The InitialContext is null", ctx);
+                EntityManager em = (EntityManager)ctx.lookup("java:comp/env/persistence/TestContext");
+                Assert.assertNotNull("The EntityManager is null", em);
+
+                // 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 testExtendedPersistenceContext() throws TestFailureException {
+        try {
+            try {
+                InitialContext ctx = new InitialContext();
+                Assert.assertNotNull("The InitialContext is null", ctx);
+                EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
+                Assert.assertNotNull("The EntityManager is null", em);
+
+                // call a do nothing method to assure entity manager actually exists
+                em.getFlushMode();
+
+                if (extendedEntityManager != null) {
+                    Assert.assertSame("Extended entity manager should be the same instance that was found last time",
+                            extendedEntityManager,
+                            em);
+                    Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
+                            extendedEntityManager.getDelegate(),
+                            em.getDelegate());
+                }
+                extendedEntityManager = em;
+
+                UserTransaction userTransaction = ejbContext.getUserTransaction();
+                userTransaction.begin();
+                try {
+                    em.getFlushMode();
+                } finally {
+                    userTransaction.commit();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
+            }
+        } catch (AssertionFailedError afe) {
+            throw new TestFailureException(afe);
+        }
+    }
+
+    public void testPropagatedPersistenceContext() throws TestFailureException {
+        try {
+            try {
+                InitialContext ctx = new InitialContext();
+                Assert.assertNotNull("The InitialContext is null", ctx);
+                EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
+                Assert.assertNotNull("The EntityManager is null", em);
+
+                // call a do nothing method to assure entity manager actually exists
+                em.getFlushMode();
+
+                // get the raw entity manager so we can test it below
+                inheritedDelegate = (EntityManager) em.getDelegate();
+
+                // The extended entity manager is not propigated to a non-extended entity manager unless there is a transaction
+                EntityManager nonExtendedEm = (EntityManager) ctx.lookup("java:comp/env/persistence/TestContext");
+                nonExtendedEm.getFlushMode();
+                EntityManager nonExtendedDelegate = ((EntityManager) nonExtendedEm.getDelegate());
+                Assert.assertTrue("non-extended entity manager should be open", nonExtendedDelegate.isOpen());
+                Assert.assertNotSame("Extended non-extended entity manager shound not be the same instance as extendend entity manager when accessed out side of a transactions",
+                        inheritedDelegate,
+                        nonExtendedDelegate);
+
+                // When the non-extended entity manager is accessed within a transaction is should see the stateful extended context.
+                //
+                // Note: this code also tests EBJ 3.0 Persistence spec 5.9.1 "UserTransaction is begun within the method, the
+                // container associates the persistence context with the JTA transaction and calls EntityManager.joinTransaction."
+                // If our the extended entity manager were not associted with the transaction, the non-extended entity manager would
+                // not see it.
+                UserTransaction userTransaction = ejbContext.getUserTransaction();
+                userTransaction.begin();
+                try {
+                    Assert.assertSame("Extended non-extended entity manager to be same instance as extendend entity manager",
+                            inheritedDelegate,
+                            nonExtendedEm.getDelegate());
+                } finally {
+                    userTransaction.commit();
+                }
+
+                // When a stateful bean with an extended entity manager creates another stateful bean, the new bean will
+                // inherit the extended entity manager (assuming it contains an extended entity manager for the same persistence
+                // unit).
+                PersistenceContextStatefulHome home = (PersistenceContextStatefulHome) ejbContext.getEJBHome();
+                PersistenceContextStatefulObject object = home.create();
+
+                // test the new stateful bean recieved the context
+                object.testPropgation();
+
+                // remove the bean
+                object.remove();
+            } catch (Exception e) {
+                Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
+            }
+        } catch (AssertionFailedError afe) {
+            throw new TestFailureException(afe);
+        }
+    }
+
+    public void testPropgation() throws TestFailureException {
+        if (inheritedDelegate == null) return;
+        try {
+            try {
+                InitialContext ctx = new InitialContext();
+                Assert.assertNotNull("The InitialContext is null", ctx);
+                EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/ExtendedTestContext");
+                Assert.assertNotNull("The EntityManager is null", em);
+
+                // call a do nothing method to assure entity manager actually exists
+                em.getFlushMode();
+
+                EntityManager delegate = (EntityManager) em.getDelegate();
+                Assert.assertSame("Extended entity manager delegate should be the same instance that was found last time",
+                        inheritedDelegate,
+                        delegate);
+            } catch (Exception e) {
+                e.printStackTrace();
+                Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
+            }
+        } catch (AssertionFailedError afe) {
+            throw new TestFailureException(afe);
+        }
+    }
+
+}

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulHome.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulHome.java?view=auto&rev=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulHome.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulHome.java Thu Jan 18 19:08:13 2007
@@ -0,0 +1,30 @@
+/**
+ * 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.TestFailureException;
+
+import javax.ejb.EJBObject;
+import javax.ejb.EJBHome;
+import java.rmi.RemoteException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface PersistenceContextStatefulHome extends EJBHome {
+    PersistenceContextStatefulObject create() throws javax.ejb.CreateException, RemoteException;
+}

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulObject.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulObject.java?view=auto&rev=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulObject.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/PersistenceContextStatefulObject.java Thu Jan 18 19:08:13 2007
@@ -0,0 +1,34 @@
+/**
+ * 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.TestFailureException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface PersistenceContextStatefulObject extends EJBObject {
+    void testPropgation() throws TestFailureException;
+
+    void testPersistenceContext() throws TestFailureException;
+
+    void testExtendedPersistenceContext() throws TestFailureException;
+
+    void testPropagatedPersistenceContext() throws TestFailureException;
+}

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=497695&r1=497694&r2=497695
==============================================================================
--- 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 19:08:13 2007
@@ -1057,7 +1057,7 @@
       <resource-env-ref>
         <resource-env-ref-name>sessioncontext</resource-env-ref-name>
         <resource-env-ref-type>javax.ejb.SessionContext</resource-env-ref-type>
-      </resource-env-ref>      
+      </resource-env-ref>
       <persistence-unit-ref>
         <description>
           Persistence unit for testing the functionality.
@@ -1084,6 +1084,36 @@
 
     <!--
     ########################################################
+    ID:  client/tests/stateful/EncBean
+    ########################################################
+    -->
+
+    <session>
+      <ejb-name>PersistenceContextStatefulBean</ejb-name>
+      <home>org.apache.openejb.test.stateful.PersistenceContextStatefulHome</home>
+      <remote>org.apache.openejb.test.stateful.PersistenceContextStatefulObject</remote>
+      <ejb-class>org.apache.openejb.test.stateful.PersistenceContextStatefulBean</ejb-class>
+      <session-type>Stateful</session-type>
+      <transaction-type>Bean</transaction-type>
+      <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>
+      </persistence-context-ref>
+      <persistence-context-ref>
+        <description>
+          Persistence context for testing the functionality.
+        </description>
+        <persistence-context-ref-name>persistence/ExtendedTestContext</persistence-context-ref-name>
+        <persistence-unit-name>openjpa-test-unit</persistence-unit-name>
+        <persistence-context-type>Extended</persistence-context-type>
+      </persistence-context-ref>
+    </session>
+
+    <!--
+    ########################################################
     ID:  client/tests/stateful/ContextLookupStatefulBean
     ########################################################
     -->
@@ -1176,7 +1206,7 @@
       <resource-env-ref>
         <resource-env-ref-name>sessioncontext</resource-env-ref-name>
         <resource-env-ref-type>javax.ejb.SessionContext</resource-env-ref-type>
-      </resource-env-ref>            
+      </resource-env-ref>
       <persistence-unit-ref>
         <description>
           Persistence unit for testing the functionality.
@@ -1295,7 +1325,7 @@
       <resource-env-ref>
         <resource-env-ref-name>sessioncontext</resource-env-ref-name>
         <resource-env-ref-type>javax.ejb.SessionContext</resource-env-ref-type>
-      </resource-env-ref>            
+      </resource-env-ref>
       <persistence-unit-ref>
         <description>
           Persistence unit for testing the functionality.
@@ -1794,7 +1824,7 @@
       <resource-env-ref>
         <resource-env-ref-name>sessioncontext</resource-env-ref-name>
         <resource-env-ref-type>javax.ejb.SessionContext</resource-env-ref-type>
-      </resource-env-ref>            
+      </resource-env-ref>
       <persistence-unit-ref>
         <description>
           Persistence unit for testing the functionality.
@@ -1919,7 +1949,7 @@
       <resource-env-ref>
         <resource-env-ref-name>sessioncontext</resource-env-ref-name>
         <resource-env-ref-type>javax.ejb.SessionContext</resource-env-ref-type>
-      </resource-env-ref>            
+      </resource-env-ref>
       <persistence-unit-ref>
         <description>
           Persistence unit for testing the functionality.

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=497695&r1=497694&r2=497695
==============================================================================
--- 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 19:08:13 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="PersistenceContextStatefulBean" deployment-id="client/tests/stateful/PersistenceContextStatefulBean"
+                  container-id="Default Stateful Container">
+    <resource-link res-ref-name="datasource" res-id="Default JDBC Database"/>
+  </ejb-deployment>
   <ejb-deployment ejb-name="ContextLookupStatefulBean" deployment-id="client/tests/stateful/ContextLookupStatefulBean"
                   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=497695&r1=497694&r2=497695
==============================================================================
--- 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 19:08:13 2007
@@ -209,22 +209,9 @@
         }
     }
 
-    public void test16_lookupExtendedPersistenceContext() {
+    public void test18_lookupSessionContext() {
         try{
-            ejbObject.lookupExtendedPersistenceContext();
-
-            // call again to assure extended persistence context instance is the same
-            ejbObject.lookupExtendedPersistenceContext();
-        } catch (TestFailureException e){
-            throw e.error;
-        } catch (Exception e){
-            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-        }
-    }
-
-    public void test17_lookupPropagatedPersistenceContext() {
-        try{
-            ejbObject.lookupPropagatedPersistenceContext();
+            ejbObject.lookupSessionContext();
         } catch (TestFailureException e){
             throw e.error;
         } catch (Exception e){

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulJndiEncTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulJndiEncTests.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulJndiEncTests.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulJndiEncTests.java Thu Jan 18 19:08:13 2007
@@ -209,29 +209,6 @@
         }
     }
 
-    public void test16_lookupExtendedPersistenceContext() {
-        try{
-            ejbObject.lookupExtendedPersistenceContext();
-
-            // call again to assure extended persistence context instance is the same
-            ejbObject.lookupExtendedPersistenceContext();
-        } catch (TestFailureException e){
-            throw e.error;
-        } catch (Exception e){
-            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-        }
-    }
-
-    public void test17_lookupPropagatedPersistenceContext() {
-        try{
-            ejbObject.lookupPropagatedPersistenceContext();
-        } catch (TestFailureException e){
-            throw e.error;
-        } catch (Exception e){
-            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-        }
-    }
-
     public void test18_lookupSessionContext() {
         try{
             ejbObject.lookupSessionContext();

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPersistenceContextTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPersistenceContextTests.java?view=auto&rev=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPersistenceContextTests.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPersistenceContextTests.java Thu Jan 18 19:08:13 2007
@@ -0,0 +1,94 @@
+/**
+ * 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;
+
+public class StatefulPersistenceContextTests extends StatefulTestClient{
+
+    protected PersistenceContextStatefulObject ejbObject;
+    protected PersistenceContextStatefulHome ejbHome;
+
+    public StatefulPersistenceContextTests(){
+        super("PERSISTENCE_CONTEXT.");
+    }
+
+    protected void setUp() throws Exception{
+        super.setUp();
+        ejbHome = (PersistenceContextStatefulHome) initialContext.lookup("client/tests/stateful/PersistenceContextStatefulBean");
+        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_persistenceContext() {
+        try{
+            ejbObject.testPersistenceContext();
+        } catch (TestFailureException e){
+            throw e.error;
+        } catch (Exception e){
+            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+        }
+    }
+
+    public void test02_extendedPersistenceContext() {
+        try{
+            ejbObject.testExtendedPersistenceContext();
+        } catch (TestFailureException e){
+            throw e.error;
+        } catch (Exception e){
+            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+        }
+    }
+
+    public void test03_propagatedPersistenceContext() {
+        try{
+            ejbObject.testPropagatedPersistenceContext();
+        } catch (TestFailureException e){
+            throw e.error;
+        } catch (Exception e){
+            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+        }
+    }
+
+    public void test04_propogation() {
+        try{
+            ejbObject.testPropgation();
+        } 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/StatefulPojoContextLookupTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPojoContextLookupTests.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPojoContextLookupTests.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateful/StatefulPojoContextLookupTests.java Thu Jan 18 19:08:13 2007
@@ -209,22 +209,9 @@
         }
     }
 
-    public void test16_lookupExtendedPersistenceContext() {
+    public void test18_lookupSessionContext() {
         try{
-            ejbObject.lookupExtendedPersistenceContext();
-
-            // call again to assure extended persistence context instance is the same
-            ejbObject.lookupExtendedPersistenceContext();
-        } catch (TestFailureException e){
-            throw e.error;
-        } catch (Exception e){
-            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
-        }
-    }
-
-    public void test17_lookupPropagatedPersistenceContext() {
-        try{
-            ejbObject.lookupPropagatedPersistenceContext();
+            ejbObject.lookupSessionContext();
         } catch (TestFailureException e){
             throw e.error;
         } catch (Exception e){

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessContextLookupTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessContextLookupTests.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessContextLookupTests.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessContextLookupTests.java Thu Jan 18 19:08:13 2007
@@ -209,4 +209,15 @@
         }
     }
 
+    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/StatelessJndiEncTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessJndiEncTests.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessJndiEncTests.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessJndiEncTests.java Thu Jan 18 19:08:13 2007
@@ -218,4 +218,14 @@
         }
     }
 
+    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/StatelessPojoContextLookupTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoContextLookupTests.java?view=diff&rev=497695&r1=497694&r2=497695
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoContextLookupTests.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoContextLookupTests.java Thu Jan 18 19:08:13 2007
@@ -209,4 +209,14 @@
         }
     }
 
+    public void test18_lookupSessionContext() {
+        try{
+            ejbObject.lookupSessionContext();
+        } catch (TestFailureException e){
+            throw e.error;
+        } catch (Exception e){
+            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+        }
+    }
+    
 }