tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject [2/2] tomee git commit: jndi:ext context injection in test
Date Fri, 06 Mar 2015 08:36:43 GMT
jndi:ext context injection in test


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/6ffa2ca7
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/6ffa2ca7
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/6ffa2ca7

Branch: refs/heads/develop
Commit: 6ffa2ca71d9af240b491f5bd1a203b339e984f38
Parents: 4b5a48b
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Fri Mar 6 09:36:31 2015 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Fri Mar 6 09:36:31 2015 +0100

----------------------------------------------------------------------
 .../openejb/server/ejbd/Server2ServerEjbRefTest.java    | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/6ffa2ca7/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/Server2ServerEjbRefTest.java
----------------------------------------------------------------------
diff --git a/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/Server2ServerEjbRefTest.java
b/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/Server2ServerEjbRefTest.java
index 1f946be..a57fa3a 100644
--- a/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/Server2ServerEjbRefTest.java
+++ b/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/Server2ServerEjbRefTest.java
@@ -32,10 +32,12 @@ import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.server.ServiceDaemon;
 import org.apache.openejb.server.ServicePool;
 
+import javax.annotation.Resource;
 import javax.ejb.EJB;
 import javax.ejb.Remote;
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import java.util.Properties;
 
 /**
@@ -127,10 +129,20 @@ public class Server2ServerEjbRefTest extends TestCase {
         @EJB(mappedName = "jndi:ext://orange/OrangeBeanRemote")
         private OrangeRemote orangeRemote;
 
+        @Resource(lookup = "openejb:remote_jndi_contexts/orange")
+        private Context ctx;
+
         @Override
         public void hasOrangeRemote() {
             Assert.assertNotNull("orangeRemote is null", orangeRemote);
             assertEquals("olleh", orangeRemote.echo("hello"));
+            try {
+                final OrangeRemote bean = OrangeRemote.class.cast(ctx.lookup("OrangeBeanRemoteWell
"));
+                assertNotNull(bean);
+                assertEquals("olleh", bean.echo("hello"));
+            } catch (final NamingException e) {
+                fail(e.getMessage());
+            }
         }
     }
 


Mime
View raw message