tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject [5/6] tomee git commit: reducing our dependency on corba and rmi and ensuring we have jaxb there - this last change can need some adjustment to endorse or not jaxb
Date Wed, 03 May 2017 16:25:45 GMT
http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/EncSingletonBean.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/EncSingletonBean.java b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/EncSingletonBean.java
index bc704fa..b340d73 100644
--- a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/EncSingletonBean.java
+++ b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/singleton/EncSingletonBean.java
@@ -16,31 +16,32 @@
  */
 package org.apache.openejb.test.singleton;
 
-import java.rmi.RemoteException;
-import java.sql.Connection;
+import junit.framework.AssertionFailedError;
+import org.apache.openejb.test.TestFailureException;
+import org.apache.openejb.test.entity.bmp.BasicBmpHome;
+import org.apache.openejb.test.entity.bmp.BasicBmpObject;
+import org.apache.openejb.test.stateful.BasicStatefulBusinessLocal;
+import org.apache.openejb.test.stateful.BasicStatefulBusinessRemote;
+import org.apache.openejb.test.stateful.BasicStatefulHome;
+import org.apache.openejb.test.stateful.BasicStatefulObject;
+import org.apache.openejb.test.stateful.BasicStatefulPojoBean;
+import org.junit.Assert;
 
 import javax.ejb.EJBContext;
 import javax.ejb.EJBException;
 import javax.ejb.SessionContext;
-import javax.naming.InitialContext;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityManager;
-import javax.sql.DataSource;
 import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.QueueConnectionFactory;
 import javax.jms.Session;
 import javax.jms.Topic;
-import javax.jms.MessageProducer;
 import javax.jms.TopicConnectionFactory;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.JMSException;
-
-import org.junit.Assert;
-import junit.framework.AssertionFailedError;
-
-import org.apache.openejb.test.TestFailureException;
-import org.apache.openejb.test.entity.bmp.BasicBmpHome;
-import org.apache.openejb.test.entity.bmp.BasicBmpObject;
-import org.apache.openejb.test.stateful.*;
+import javax.naming.InitialContext;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
+import java.rmi.RemoteException;
 
 public class EncSingletonBean implements javax.ejb.SessionBean {
 
@@ -65,7 +66,7 @@ public class EncSingletonBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicBmpHome home = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/singleton/beanReferences/bmp_entity"), BasicBmpHome.class);
+                final BasicBmpHome home = (BasicBmpHome) ctx.lookup("java:comp/env/singleton/beanReferences/bmp_entity");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicBmpObject object = home.createObject("Enc Bean");
@@ -84,7 +85,7 @@ public class EncSingletonBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulHome home = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/singleton/beanReferences/stateful"), BasicStatefulHome.class);
+                final BasicStatefulHome home = (BasicStatefulHome) ctx.lookup("java:comp/env/singleton/beanReferences/stateful");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicStatefulObject object = home.createObject("Enc Bean");
@@ -103,7 +104,7 @@ public class EncSingletonBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicSingletonHome home = (BasicSingletonHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/singleton/beanReferences/singleton"), BasicSingletonHome.class);
+                final BasicSingletonHome home = (BasicSingletonHome) ctx.lookup("java:comp/env/singleton/beanReferences/singleton");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicSingletonObject object = home.createObject();
@@ -158,7 +159,7 @@ public class EncSingletonBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicSingletonBusinessRemote object = (BasicSingletonBusinessRemote) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/singleton/beanReferences/singleton-business-remote"), BasicSingletonBusinessRemote.class);
+                final BasicSingletonBusinessRemote object = (BasicSingletonBusinessRemote) ctx.lookup("java:comp/env/singleton/beanReferences/singleton-business-remote");
                 Assert.assertNotNull("The EJB BusinessRemote is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -174,7 +175,7 @@ public class EncSingletonBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/singleton/beanReferences/stateful-business-local"), BasicStatefulBusinessLocal.class);
+                final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) ctx.lookup("java:comp/env/singleton/beanReferences/stateful-business-local");
                 Assert.assertNotNull("The EJB BusinessLocal is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -190,7 +191,7 @@ public class EncSingletonBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulPojoBean object = (BasicStatefulPojoBean) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/singleton/beanReferences/stateful-business-localbean"), BasicStatefulPojoBean.class);
+                final BasicStatefulPojoBean object = (BasicStatefulPojoBean) ctx.lookup("java:comp/env/singleton/beanReferences/stateful-business-localbean");
                 Assert.assertNotNull("The EJB BusinessLocalBean is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -206,7 +207,7 @@ public class EncSingletonBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/singleton/beanReferences/stateful-business-remote"), BasicStatefulBusinessRemote.class);
+                final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) ctx.lookup("java:comp/env/singleton/beanReferences/stateful-business-remote");
                 Assert.assertNotNull("The EJB BusinessRemote is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java
index d4ec565..5805ff4 100644
--- a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java
+++ b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/BeanTxStatefulBean.java
@@ -16,10 +16,8 @@
  */
 package org.apache.openejb.test.stateful;
 
-import java.rmi.RemoteException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
+import org.apache.openejb.test.object.Account;
+import org.apache.openejb.test.object.Transaction;
 
 import javax.ejb.CreateException;
 import javax.ejb.EJBException;
@@ -28,9 +26,10 @@ import javax.naming.InitialContext;
 import javax.sql.DataSource;
 import javax.transaction.RollbackException;
 import javax.transaction.UserTransaction;
-
-import org.apache.openejb.test.object.Account;
-import org.apache.openejb.test.object.Transaction;
+import java.rmi.RemoteException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 
 public class BeanTxStatefulBean implements javax.ejb.SessionBean {
 
@@ -103,7 +102,7 @@ public class BeanTxStatefulBean implements javax.ejb.SessionBean {
 
         try {
 
-            final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/datasource"), DataSource.class);
+            final DataSource ds = (DataSource) jndiContext.lookup("java:comp/env/datasource");
             final Connection con = ds.getConnection();
 
             try {
@@ -143,7 +142,7 @@ public class BeanTxStatefulBean implements javax.ejb.SessionBean {
     public Account retreiveAccount(final String ssn) throws RemoteException {
         final Account acct = new Account();
         try {
-            final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/datasource"), DataSource.class);
+            final DataSource ds = (DataSource) jndiContext.lookup("java:comp/env/datasource");
             final Connection con = ds.getConnection();
 
             try {

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java
index 5230398..0d34cf1 100644
--- a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java
+++ b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateful/EncStatefulBean.java
@@ -16,34 +16,35 @@
  */
 package org.apache.openejb.test.stateful;
 
-import java.rmi.RemoteException;
+import junit.framework.AssertionFailedError;
+import org.apache.openejb.test.TestFailureException;
+import org.apache.openejb.test.entity.bmp.BasicBmpHome;
+import org.apache.openejb.test.entity.bmp.BasicBmpObject;
+import org.apache.openejb.test.stateless.BasicStatelessBusinessLocal;
+import org.apache.openejb.test.stateless.BasicStatelessBusinessRemote;
+import org.apache.openejb.test.stateless.BasicStatelessHome;
+import org.apache.openejb.test.stateless.BasicStatelessObject;
+import org.apache.openejb.test.stateless.BasicStatelessPojoBean;
+import org.junit.Assert;
 
+import javax.ejb.CreateException;
 import javax.ejb.EJBContext;
 import javax.ejb.EJBException;
 import javax.ejb.SessionContext;
 import javax.ejb.SessionSynchronization;
-import javax.ejb.CreateException;
-import javax.naming.InitialContext;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityManager;
-import javax.sql.DataSource;
-import javax.transaction.UserTransaction;
-import javax.jms.ConnectionFactory;
 import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.QueueConnectionFactory;
 import javax.jms.Session;
 import javax.jms.Topic;
-import javax.jms.MessageProducer;
 import javax.jms.TopicConnectionFactory;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.JMSException;
-
-import org.junit.Assert;
-import junit.framework.AssertionFailedError;
-
-import org.apache.openejb.test.TestFailureException;
-import org.apache.openejb.test.entity.bmp.BasicBmpHome;
-import org.apache.openejb.test.entity.bmp.BasicBmpObject;
-import org.apache.openejb.test.stateless.*;
+import javax.naming.InitialContext;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
+import java.rmi.RemoteException;
 
 public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchronization {
 
@@ -80,7 +81,7 @@ public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchroniz
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicBmpHome home = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateful/beanReferences/bmp_entity"), BasicBmpHome.class);
+                final BasicBmpHome home = (BasicBmpHome) ctx.lookup("java:comp/env/stateful/beanReferences/bmp_entity");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicBmpObject object = home.createObject("Enc Bean");
@@ -99,7 +100,7 @@ public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchroniz
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulHome home = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateful/beanReferences/stateful"), BasicStatefulHome.class);
+                final BasicStatefulHome home = (BasicStatefulHome) ctx.lookup("java:comp/env/stateful/beanReferences/stateful");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicStatefulObject object = home.createObject("Enc Bean");
@@ -118,7 +119,7 @@ public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchroniz
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatelessHome home = (BasicStatelessHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateful/beanReferences/stateless"), BasicStatelessHome.class);
+                final BasicStatelessHome home = (BasicStatelessHome) ctx.lookup("java:comp/env/stateful/beanReferences/stateless");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicStatelessObject object = home.createObject();
@@ -173,7 +174,7 @@ public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchroniz
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateful/beanReferences/stateless-business-remote"), BasicStatelessBusinessRemote.class);
+                final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ctx.lookup("java:comp/env/stateful/beanReferences/stateless-business-remote");
                 Assert.assertNotNull("The EJB BusinessRemote is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -189,7 +190,7 @@ public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchroniz
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateful/beanReferences/stateful-business-local"), BasicStatefulBusinessLocal.class);
+                final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) ctx.lookup("java:comp/env/stateful/beanReferences/stateful-business-local");
                 Assert.assertNotNull("The EJB BusinessLocal is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -205,7 +206,7 @@ public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchroniz
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulPojoBean object = (BasicStatefulPojoBean) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateful/beanReferences/stateful-business-localbean"), BasicStatefulPojoBean.class);
+                final BasicStatefulPojoBean object = (BasicStatefulPojoBean) ctx.lookup("java:comp/env/stateful/beanReferences/stateful-business-localbean");
                 Assert.assertNotNull("The EJB BusinessLocalBean is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -221,7 +222,7 @@ public class EncStatefulBean implements javax.ejb.SessionBean, SessionSynchroniz
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateful/beanReferences/stateful-business-remote"), BasicStatefulBusinessRemote.class);
+                final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) ctx.lookup("java:comp/env/stateful/beanReferences/stateful-business-remote");
                 Assert.assertNotNull("The EJB BusinessRemote is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/BeanTxStatelessBean.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/BeanTxStatelessBean.java b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/BeanTxStatelessBean.java
index 7159e8d..1696562 100644
--- a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/BeanTxStatelessBean.java
+++ b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/BeanTxStatelessBean.java
@@ -16,10 +16,8 @@
  */
 package org.apache.openejb.test.stateless;
 
-import java.rmi.RemoteException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
+import org.apache.openejb.test.object.Account;
+import org.apache.openejb.test.object.Transaction;
 
 import javax.ejb.CreateException;
 import javax.ejb.EJBException;
@@ -28,9 +26,10 @@ import javax.naming.InitialContext;
 import javax.sql.DataSource;
 import javax.transaction.RollbackException;
 import javax.transaction.UserTransaction;
-
-import org.apache.openejb.test.object.Account;
-import org.apache.openejb.test.object.Transaction;
+import java.rmi.RemoteException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 
 public class BeanTxStatelessBean implements javax.ejb.SessionBean {
 
@@ -80,7 +79,7 @@ public class BeanTxStatelessBean implements javax.ejb.SessionBean {
     public void openAccount(final Account acct, final Boolean rollback) throws RemoteException, RollbackException {
 
         try {
-            final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/database"), DataSource.class);
+            final DataSource ds = (DataSource) jndiContext.lookup("java:comp/env/database");
             final Connection con = ds.getConnection();
 
             try {
@@ -119,7 +118,7 @@ public class BeanTxStatelessBean implements javax.ejb.SessionBean {
     public Account retreiveAccount(final String ssn) throws RemoteException {
         final Account acct = new Account();
         try {
-            final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/database"), DataSource.class);
+            final DataSource ds = (DataSource) jndiContext.lookup("java:comp/env/database");
             final Connection con = ds.getConnection();
 
             try {

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/EncStatelessBean.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/EncStatelessBean.java b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/EncStatelessBean.java
index 6d16cde..1003fef 100644
--- a/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/EncStatelessBean.java
+++ b/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/stateless/EncStatelessBean.java
@@ -16,32 +16,32 @@
  */
 package org.apache.openejb.test.stateless;
 
-import java.rmi.RemoteException;
-import java.sql.Connection;
+import junit.framework.AssertionFailedError;
+import org.apache.openejb.test.TestFailureException;
+import org.apache.openejb.test.entity.bmp.BasicBmpHome;
+import org.apache.openejb.test.entity.bmp.BasicBmpObject;
+import org.apache.openejb.test.stateful.BasicStatefulBusinessLocal;
+import org.apache.openejb.test.stateful.BasicStatefulBusinessRemote;
+import org.apache.openejb.test.stateful.BasicStatefulHome;
+import org.apache.openejb.test.stateful.BasicStatefulObject;
+import org.apache.openejb.test.stateful.BasicStatefulPojoBean;
+import org.junit.Assert;
 
 import javax.ejb.EJBContext;
 import javax.ejb.EJBException;
 import javax.ejb.SessionContext;
-import javax.naming.InitialContext;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityManager;
-import javax.sql.DataSource;
 import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.QueueConnectionFactory;
 import javax.jms.Session;
 import javax.jms.Topic;
-import javax.jms.MessageProducer;
 import javax.jms.TopicConnectionFactory;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.JMSException;
-import javax.rmi.PortableRemoteObject;
-
-import org.junit.Assert;
-import junit.framework.AssertionFailedError;
-
-import org.apache.openejb.test.TestFailureException;
-import org.apache.openejb.test.entity.bmp.BasicBmpHome;
-import org.apache.openejb.test.entity.bmp.BasicBmpObject;
-import org.apache.openejb.test.stateful.*;
+import javax.naming.InitialContext;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
+import java.rmi.RemoteException;
 
 public class EncStatelessBean implements javax.ejb.SessionBean {
 
@@ -66,7 +66,7 @@ public class EncStatelessBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicBmpHome home = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateless/beanReferences/bmp_entity"), BasicBmpHome.class);
+                final BasicBmpHome home = (BasicBmpHome) ctx.lookup("java:comp/env/stateless/beanReferences/bmp_entity");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicBmpObject object = home.createObject("Enc Bean");
@@ -85,7 +85,7 @@ public class EncStatelessBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulHome home = (BasicStatefulHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateless/beanReferences/stateful"), BasicStatefulHome.class);
+                final BasicStatefulHome home = (BasicStatefulHome) ctx.lookup("java:comp/env/stateless/beanReferences/stateful");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicStatefulObject object = home.createObject("Enc Bean");
@@ -104,7 +104,7 @@ public class EncStatelessBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatelessHome home = (BasicStatelessHome) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateless/beanReferences/stateless"), BasicStatelessHome.class);
+                final BasicStatelessHome home = (BasicStatelessHome) ctx.lookup("java:comp/env/stateless/beanReferences/stateless");
                 Assert.assertNotNull("The EJBHome looked up is null", home);
 
                 final BasicStatelessObject object = home.createObject();
@@ -159,7 +159,7 @@ public class EncStatelessBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateless/beanReferences/stateless-business-remote"), BasicStatelessBusinessRemote.class);
+                final BasicStatelessBusinessRemote object = (BasicStatelessBusinessRemote) ctx.lookup("java:comp/env/stateless/beanReferences/stateless-business-remote");
                 Assert.assertNotNull("The EJB BusinessRemote is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -175,7 +175,7 @@ public class EncStatelessBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateless/beanReferences/stateful-business-local"), BasicStatefulBusinessLocal.class);
+                final BasicStatefulBusinessLocal object = (BasicStatefulBusinessLocal) ctx.lookup("java:comp/env/stateless/beanReferences/stateful-business-local");
                 Assert.assertNotNull("The EJB BusinessLocal is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -207,7 +207,7 @@ public class EncStatelessBean implements javax.ejb.SessionBean {
                 final InitialContext ctx = new InitialContext();
                 Assert.assertNotNull("The InitialContext is null", ctx);
 
-                final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/stateless/beanReferences/stateful-business-remote"), BasicStatefulBusinessRemote.class);
+                final BasicStatefulBusinessRemote object = (BasicStatefulBusinessRemote) ctx.lookup("java:comp/env/stateless/beanReferences/stateful-business-remote");
                 Assert.assertNotNull("The EJB BusinessRemote is null", object);
             } catch (final Exception e) {
                 Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ClientTestSuite.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ClientTestSuite.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ClientTestSuite.java
index d11280a..252637b 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ClientTestSuite.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ClientTestSuite.java
@@ -17,15 +17,14 @@
 package org.apache.openejb.test;
 
 import junit.framework.TestSuite;
-
 import org.apache.openejb.test.entity.bmp.BmpTestSuite;
 import org.apache.openejb.test.entity.cmp.CmpTestSuite;
 import org.apache.openejb.test.entity.cmp2.Cmp2TestSuite;
-import org.apache.openejb.test.stateful.StatefulTestSuite;
-import org.apache.openejb.test.stateless.StatelessTestSuite;
 import org.apache.openejb.test.mdb.MdbTestSuite;
 import org.apache.openejb.test.servlet.ServletTestSuite;
 import org.apache.openejb.test.singleton.SingletonTestSuite;
+import org.apache.openejb.test.stateful.StatefulTestSuite;
+import org.apache.openejb.test.stateless.StatelessTestSuite;
 
 public class ClientTestSuite extends junit.framework.TestCase {
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/DerbyTestDatabase.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/DerbyTestDatabase.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/DerbyTestDatabase.java
index 1f1f618..a7c2840 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/DerbyTestDatabase.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/DerbyTestDatabase.java
@@ -116,7 +116,7 @@ public class DerbyTestDatabase implements TestDatabase {
         try {
             /* Create database */
             obj = initialContext.lookup("client/tools/DatabaseHome");
-            databaseHome = (DatabaseHome) javax.rmi.PortableRemoteObject.narrow(obj, DatabaseHome.class);
+            databaseHome = (DatabaseHome) obj;
         } catch (final Exception e) {
             throw new IllegalStateException("Cannot find 'client/tools/DatabaseHome': " + e.getClass().getName() + " " + e.getMessage());
         }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/FilteredTestSuite.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/FilteredTestSuite.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/FilteredTestSuite.java
index ccd39e0..a92c36e 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/FilteredTestSuite.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/FilteredTestSuite.java
@@ -18,8 +18,8 @@ package org.apache.openejb.test;
 
 import junit.framework.Test;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @version $Rev$ $Date$

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/HsqldbTestDatabase.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/HsqldbTestDatabase.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/HsqldbTestDatabase.java
index ca80c5c..2878b81 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/HsqldbTestDatabase.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/HsqldbTestDatabase.java
@@ -184,7 +184,7 @@ public class HsqldbTestDatabase implements TestDatabase {
         try {
             /* Create database */
             obj = initialContext.lookup(databaseHomeJndiName);
-            databaseHome = (DatabaseHome) javax.rmi.PortableRemoteObject.narrow(obj, DatabaseHome.class);
+            databaseHome = DatabaseHome.class.cast(obj);
         } catch (final Exception e) {
             throw new IllegalStateException("Cannot find " + databaseHomeJndiName + ": " + e.getClass().getName() + " " + e.getMessage());
         }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java
index b7b15e0..5a6441c 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java
@@ -16,14 +16,13 @@
  */
 package org.apache.openejb.test;
 
-import java.rmi.RemoteException;
-import java.util.Properties;
-
-import javax.naming.InitialContext;
-
 import org.apache.openejb.test.beans.Database;
 import org.apache.openejb.test.beans.DatabaseHome;
 
+import javax.naming.InitialContext;
+import java.rmi.RemoteException;
+import java.util.Properties;
+
 public class InstantDbTestDatabase implements TestDatabase {
 
     protected Database database;
@@ -128,7 +127,7 @@ public class InstantDbTestDatabase implements TestDatabase {
         try {
             /* Create database */
             obj = initialContext.lookup("client/tools/DatabaseHome");
-            databaseHome = (DatabaseHome) javax.rmi.PortableRemoteObject.narrow(obj, DatabaseHome.class);
+            databaseHome = (DatabaseHome) obj;
         } catch (final Exception e) {
             throw new IllegalStateException("Cannot find 'client/tools/DatabaseHome': " + e.getClass().getName() + " " + e.getMessage());
         }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/IvmTestServer.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/IvmTestServer.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/IvmTestServer.java
index d73d0e5..ea780d5 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/IvmTestServer.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/IvmTestServer.java
@@ -16,11 +16,10 @@
  */
 package org.apache.openejb.test;
 
-import java.util.Properties;
-import java.util.Random;
-
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import java.util.Properties;
+import java.util.Random;
 
 /**
  * @version $Rev$ $Date$

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/NumberedTestCase.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/NumberedTestCase.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/NumberedTestCase.java
index 41f7e1b..05b8275 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/NumberedTestCase.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/NumberedTestCase.java
@@ -16,14 +16,14 @@
  */
 package org.apache.openejb.test;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
-import org.junit.Assert;
 import junit.framework.Protectable;
 import junit.framework.Test;
 import junit.framework.TestResult;
+import org.junit.Assert;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Iterator;
 
 public class NumberedTestCase extends Assert implements Test {
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/PostgreSqlTestDatabase.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/PostgreSqlTestDatabase.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/PostgreSqlTestDatabase.java
index 6fb0d19..2ac7eaa 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/PostgreSqlTestDatabase.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/PostgreSqlTestDatabase.java
@@ -137,7 +137,7 @@ public class PostgreSqlTestDatabase implements TestDatabase {
 
             /* Create database */
             final Object obj = initialContext.lookup("client/tools/DatabaseHome");
-            final DatabaseHome databaseHome = (DatabaseHome) javax.rmi.PortableRemoteObject.narrow(obj, DatabaseHome.class);
+            final DatabaseHome databaseHome = (DatabaseHome) obj;
             database = databaseHome.create();
         } catch (final Exception e) {
             throw new IllegalStateException("Cannot start database: " + e.getClass().getName() + " " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ResultPrinter.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ResultPrinter.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ResultPrinter.java
index c2a18cb..2662a26 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ResultPrinter.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/ResultPrinter.java
@@ -16,12 +16,12 @@
  */
 package org.apache.openejb.test;
 
-import java.io.PrintStream;
-import java.util.Enumeration;
-
 import junit.framework.TestFailure;
 import junit.framework.TestResult;
 
+import java.io.PrintStream;
+import java.util.Enumeration;
+
 public class ResultPrinter extends junit.textui.ResultPrinter {
 
     public ResultPrinter(final PrintStream writer) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/RiTestServer.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/RiTestServer.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/RiTestServer.java
index b302097..718a274 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/RiTestServer.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/RiTestServer.java
@@ -16,13 +16,12 @@
  */
 package org.apache.openejb.test;
 
+import javax.naming.Context;
 import java.io.DataInputStream;
 import java.io.File;
 import java.net.URL;
 import java.util.Properties;
 
-import javax.naming.Context;
-
 /**
  * The Client test suite needs the following environment variables
  * to be set before it can be run.

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestClient.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestClient.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestClient.java
index ed94b72..7017338 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestClient.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestClient.java
@@ -16,20 +16,18 @@
  */
 package org.apache.openejb.test;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import org.apache.xbean.finder.ClassFinder;
 
 import javax.ejb.EJB;
 import javax.ejb.EJBMetaData;
 import javax.ejb.Handle;
 import javax.ejb.HomeHandle;
 import javax.naming.InitialContext;
-import javax.rmi.PortableRemoteObject;
-
-import org.apache.xbean.finder.ClassFinder;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 public abstract class TestClient extends NamedTestCase {
 
@@ -50,7 +48,7 @@ public abstract class TestClient extends NamedTestCase {
     protected abstract void setUp() throws Exception;
 
     protected Object cast(final Object object, final Class type) {
-        return PortableRemoteObject.narrow(object, type);
+        return object;
     }
 
     protected final void processFieldInjections() {
@@ -66,7 +64,7 @@ public abstract class TestClient extends NamedTestCase {
             if ((ejbAnnotation.name() != null) && (ejbAnnotation.name() != "") && (ejbAnnotation.beanInterface() != null)) {
                 try {
                     home = initialContext.lookup(ejbAnnotation.name());
-                    // home = ejbAnnotation.beanInterface().cast(PortableRemoteObject.narrow(home, ejbAnnotation.beanInterface()));
+                    // home = ejbAnnotation.beanInterface().cast(home;
                     home = cast(home, ejbAnnotation.beanInterface());
                     field.setAccessible(true);
                     field.set(this, home);
@@ -91,7 +89,7 @@ public abstract class TestClient extends NamedTestCase {
             if ((ejbAnnotation.name() != null) && (ejbAnnotation.name() != "") && (ejbAnnotation.beanInterface() != null)) {
                 try {
                     home = initialContext.lookup(ejbAnnotation.name());
-                    // home = ejbAnnotation.beanInterface().cast(PortableRemoteObject.narrow(home, ejbAnnotation.beanInterface()));
+                    // home = ejbAnnotation.beanInterface().cast(home;
                     home = cast(home, ejbAnnotation.beanInterface());
                     method.setAccessible(true);
                     method.invoke(this, new Object[]{home});

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestManager.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestManager.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestManager.java
index 77999d3..e804fb7 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestManager.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/TestManager.java
@@ -18,9 +18,9 @@ package org.apache.openejb.test;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.util.Properties;
-import java.security.PrivilegedAction;
 import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
 
 /**
  * @version $Rev$ $Date$

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpAllowedOperationsTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpAllowedOperationsTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpAllowedOperationsTests.java
index 4e377b2..63673f3 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpAllowedOperationsTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpAllowedOperationsTests.java
@@ -18,8 +18,6 @@ package org.apache.openejb.test.entity.bmp;
 
 import org.apache.openejb.test.object.OperationsPolicy;
 
-import javax.rmi.PortableRemoteObject;
-
 /**
  * [9] Should be run as the nineth test suite of the BasicBmpTestClients
  * <p/>
@@ -143,7 +141,7 @@ public class BmpAllowedOperationsTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/allowed_operations/EntityHome");
-        ejbHome = (BasicBmpHome) PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
         ejbObject = ejbHome.createObject("Fourth Bean");
         ejbHandle = ejbObject.getHandle();
         /* These tests will only work if the specified
@@ -177,7 +175,7 @@ public class BmpAllowedOperationsTests extends BasicBmpTestClient {
 
         ejbHome.sum(1, 2);
 
-        ejbObject = (BasicBmpObject) PortableRemoteObject.narrow(ejbHandle.getEJBObject(), BasicBmpObject.class);
+        ejbObject = (BasicBmpObject) ejbHandle.getEJBObject();
 
         ejbHome.findByPrimaryKey((Integer) ejbObject.getPrimaryKey());
         ejbHome.remove(ejbObject.getPrimaryKey());

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpContextLookupTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpContextLookupTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpContextLookupTests.java
index 070c05d..a9583f1 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpContextLookupTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpContextLookupTests.java
@@ -33,7 +33,7 @@ public class BmpContextLookupTests extends BmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/ContextLookupBmpBean");
-        ejbHome = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+        ejbHome = (EncBmpHome) obj;
         ejbObject = ejbHome.create("Enc Bean");
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbHomeTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbHomeTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbHomeTests.java
index 3dba3a0..978b535 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbHomeTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbHomeTests.java
@@ -31,7 +31,7 @@ public class BmpEjbHomeTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-        ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
         ejbObject = ejbHome.createObject("Second Bean");
         ejbPrimaryKey = ejbObject.getPrimaryKey();
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbMetaDataTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbMetaDataTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbMetaDataTests.java
index f807b08..a676ee4 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbMetaDataTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbMetaDataTests.java
@@ -30,7 +30,7 @@ public class BmpEjbMetaDataTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-        ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
         ejbMetaData = ejbHome.getEJBMetaData();
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbObjectTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbObjectTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbObjectTests.java
index a710989..4d0b2a8 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbObjectTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpEjbObjectTests.java
@@ -31,7 +31,7 @@ public class BmpEjbObjectTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-        ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
         ejbObject = ejbHome.createObject("Third Bean");
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHandleTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHandleTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHandleTests.java
index 33058b3..70c4dea 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHandleTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHandleTests.java
@@ -30,7 +30,7 @@ public class BmpHandleTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-        ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
         ejbObject = ejbHome.createObject("Fifth Bean");
         ejbHandle = ejbObject.getHandle();
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeHandleTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeHandleTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeHandleTests.java
index 7b25229..233551a 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeHandleTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeHandleTests.java
@@ -30,7 +30,7 @@ public class BmpHomeHandleTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-        ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
         ejbHomeHandle = ejbHome.getHomeHandle();
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeIntfcTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeIntfcTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeIntfcTests.java
index dce34fe..5b3622f 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeIntfcTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpHomeIntfcTests.java
@@ -28,7 +28,7 @@ public class BmpHomeIntfcTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-        ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
     }
 
     //===============================
@@ -74,7 +74,7 @@ public class BmpHomeIntfcTests extends BasicBmpTestClient {
             assertEquals("The Collection is not the right size.", keys.length, objects.size());
             final Object[] objs = objects.toArray();
             for (int i = 0; i < objs.length; i++) {
-                ejbObject = (BasicBmpObject) javax.rmi.PortableRemoteObject.narrow(objs[i], BasicBmpObject.class);
+                ejbObject = (BasicBmpObject) objs[i];
                 // This could be problematic, it assumes the order of the collection.
                 assertEquals("The primary keys are not equal.", keys[i], ejbObject.getPrimaryKey());
             }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiEncTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiEncTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiEncTests.java
index 86d14e4..c86578a 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiEncTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiEncTests.java
@@ -33,7 +33,7 @@ public class BmpJndiEncTests extends BmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-        ejbHome = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+        ejbHome = (EncBmpHome) obj;
         ejbObject = ejbHome.create("Enc Bean");
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiTests.java
index 7102284..36dbf81 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpJndiTests.java
@@ -29,7 +29,7 @@ public class BmpJndiTests extends BasicBmpTestClient {
     public void test01_Jndi_lookupHome() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-            ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+            ejbHome = (BasicBmpHome) obj;
             assertNotNull("The EJBHome is null", ejbHome);
         } catch (final Exception e) {
             fail("Received Exception " + e.getClass() + " : " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRemoteIntfcTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRemoteIntfcTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRemoteIntfcTests.java
index 0f25b58..d752cbc 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRemoteIntfcTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRemoteIntfcTests.java
@@ -29,7 +29,7 @@ public class BmpRemoteIntfcTests extends BasicBmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/BasicBmpHome");
-        ejbHome = (BasicBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicBmpHome.class);
+        ejbHome = (BasicBmpHome) obj;
         ejbObject = ejbHome.createObject("Forth Bean");
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRmiIiopTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRmiIiopTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRmiIiopTests.java
index c8474c9..c2f107c 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRmiIiopTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpRmiIiopTests.java
@@ -16,13 +16,12 @@
  */
 package org.apache.openejb.test.entity.bmp;
 
+import org.apache.openejb.test.object.ObjectGraph;
+
 import javax.ejb.EJBHome;
 import javax.ejb.EJBMetaData;
 import javax.ejb.EJBObject;
 import javax.ejb.Handle;
-
-import org.apache.openejb.test.object.ObjectGraph;
-
 import java.rmi.RemoteException;
 
 public class BmpRmiIiopTests extends BmpTestClient {
@@ -37,7 +36,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/bmp/RMI-over-IIOP/EJBHome");
-        ejbHome = (RmiIiopBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, RmiIiopBmpHome.class);
+        ejbHome = (RmiIiopBmpHome) obj;
         ejbObject = ejbHome.create("RMI-IIOP TestBean");
     }
 
@@ -518,10 +517,10 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test35_returnEJBHome() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome expected = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome expected = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", expected);
 
-            final EncBmpHome actual = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(ejbObject.returnEJBHome(expected), EncBmpHome.class);
+            final EncBmpHome actual = (EncBmpHome) ejbObject.returnEJBHome(expected);
             assertNotNull("The EJBHome returned is null", actual);
 
         } catch (final Exception e) {
@@ -531,7 +530,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
 
     public void test36_returnEJBHome2() {
         try {
-            final EncBmpHome actual = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(ejbObject.returnEJBHome(), EncBmpHome.class);
+            final EncBmpHome actual = (EncBmpHome) ejbObject.returnEJBHome();
             assertNotNull("The EJBHome returned is null", actual);
 
         } catch (final Exception e) {
@@ -542,13 +541,13 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test37_returnNestedEJBHome() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome expected = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome expected = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", expected);
 
             final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
             assertNotNull("The ObjectGraph is null", graph);
 
-            final EncBmpHome actual = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(graph.getObject(), EncBmpHome.class);
+            final EncBmpHome actual = (EncBmpHome) graph.getObject();
             assertNotNull("The EJBHome returned is null", actual);
         } catch (final Exception e) {
             fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -560,7 +559,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
             final ObjectGraph graph = ejbObject.returnNestedEJBHome();
             assertNotNull("The ObjectGraph is null", graph);
 
-            final EncBmpHome actual = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(graph.getObject(), EncBmpHome.class);
+            final EncBmpHome actual = (EncBmpHome) graph.getObject();
             assertNotNull("The EJBHome returned is null", actual);
         } catch (final Exception e) {
             fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -573,7 +572,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
             final EncBmpHome[] expected = new EncBmpHome[3];
             for (int i = 0; i < expected.length; i++) {
                 final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-                expected[i] = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+                expected[i] = (EncBmpHome) obj;
                 assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
             }
 
@@ -594,13 +593,13 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test40_returnEJBObject() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EncBmpObject expected = home.create("test_40 BmpBean");
             assertNotNull("The EJBObject created is null", expected);
 
-            final EncBmpObject actual = (EncBmpObject) javax.rmi.PortableRemoteObject.narrow(ejbObject.returnEJBObject(expected), EncBmpObject.class);
+            final EncBmpObject actual = (EncBmpObject) ejbObject.returnEJBObject(expected);
             assertNotNull("The EJBObject returned is null", actual);
 
             assertTrue("The EJBObejcts are not identical", expected.isIdentical(actual));
@@ -611,7 +610,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
 
     public void test41_returnEJBObject2() {
         try {
-            final EncBmpObject actual = (EncBmpObject) javax.rmi.PortableRemoteObject.narrow(ejbObject.returnEJBObject(), EncBmpObject.class);
+            final EncBmpObject actual = (EncBmpObject) ejbObject.returnEJBObject();
             assertNotNull("The EJBObject returned is null", actual);
 
         } catch (final Exception e) {
@@ -622,7 +621,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test42_returnNestedEJBObject() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EncBmpObject expected = home.create("test_42 BmpBean");
@@ -631,7 +630,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
             final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
             assertNotNull("The ObjectGraph is null", graph);
 
-            final EncBmpObject actual = (EncBmpObject) (EncBmpObject) javax.rmi.PortableRemoteObject.narrow(graph.getObject(), EncBmpObject.class);
+            final EncBmpObject actual = (EncBmpObject) (EncBmpObject) graph.getObject();
             assertNotNull("The EJBObject returned is null", actual);
 
             assertTrue("The EJBObejcts are not identical", expected.isIdentical(actual));
@@ -645,7 +644,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
             final ObjectGraph graph = ejbObject.returnNestedEJBObject();
             assertNotNull("The ObjectGraph is null", graph);
 
-            final EncBmpObject actual = (EncBmpObject) (EncBmpObject) javax.rmi.PortableRemoteObject.narrow(graph.getObject(), EncBmpObject.class);
+            final EncBmpObject actual = (EncBmpObject) (EncBmpObject) graph.getObject();
             assertNotNull("The EJBHome returned is null", actual);
         } catch (final Exception e) {
             fail("Received Exception " + e.getClass() + " : " + e.getMessage());
@@ -655,7 +654,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test44_returnEJBObjectArray() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EncBmpObject[] expected = new EncBmpObject[3];
@@ -684,7 +683,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test45_returnEJBMetaData() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EJBMetaData expected = home.getEJBMetaData();
@@ -713,7 +712,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test47_returnNestedEJBMetaData() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EJBMetaData expected = home.getEJBMetaData();
@@ -749,7 +748,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
         try {
 
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EJBMetaData[] expected = new EJBMetaData[3];
@@ -780,7 +779,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test50_returnHandle() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EncBmpObject object = home.create("test_50 BmpBean");
@@ -817,7 +816,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test52_returnNestedHandle() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EncBmpObject object = home.create("test_52 BmpBean");
@@ -860,7 +859,7 @@ public class BmpRmiIiopTests extends BmpTestClient {
     public void test54_returnHandleArray() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
-            final EncBmpHome home = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncBmpHome.class);
+            final EncBmpHome home = (EncBmpHome) obj;
             assertNotNull("The EJBHome returned from JNDI is null", home);
 
             final EncBmpObject object = home.create("test_54 BmpBean");

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpTestClient.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpTestClient.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpTestClient.java
index b187cd3..c3361ed 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpTestClient.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/bmp/BmpTestClient.java
@@ -16,15 +16,13 @@
  */
 package org.apache.openejb.test.entity.bmp;
 
-import java.util.Properties;
+import org.apache.openejb.test.TestManager;
 
 import javax.ejb.EJBMetaData;
 import javax.ejb.Handle;
 import javax.ejb.HomeHandle;
-import javax.naming.Context;
 import javax.naming.InitialContext;
-
-import org.apache.openejb.test.TestManager;
+import java.util.Properties;
 
 public abstract class BmpTestClient extends org.apache.openejb.test.NamedTestCase {
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpAllowedOperationsTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpAllowedOperationsTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpAllowedOperationsTests.java
index f20c77a..7731c1b 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpAllowedOperationsTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpAllowedOperationsTests.java
@@ -18,8 +18,6 @@ package org.apache.openejb.test.entity.cmp;
 
 import org.apache.openejb.test.object.OperationsPolicy;
 
-import javax.rmi.PortableRemoteObject;
-
 /**
  * [9] Should be run as the nineth test suite of the BasicCmpTestClients
  * <p/>
@@ -143,7 +141,7 @@ public class CmpAllowedOperationsTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/allowed_operations/EntityHome");
-        ejbHome = (BasicCmpHome) PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
         ejbObject = ejbHome.createObject("Fourth Bean");
         ejbHandle = ejbObject.getHandle();
         /* These tests will only work if the specified

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpContextLookupTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpContextLookupTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpContextLookupTests.java
index 74ef4d7..40134c4 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpContextLookupTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpContextLookupTests.java
@@ -33,7 +33,7 @@ public class CmpContextLookupTests extends CmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/ContextLookupCmpBean");
-        ejbHome = (EncCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncCmpHome.class);
+        ejbHome = (EncCmpHome) obj;
         ejbObject = ejbHome.create("Enc Bean");
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbHomeTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbHomeTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbHomeTests.java
index 36d432e..a4baa8e 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbHomeTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbHomeTests.java
@@ -31,7 +31,7 @@ public class CmpEjbHomeTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-        ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
         ejbObject = ejbHome.createObject("Second Bean");
         ejbPrimaryKey = ejbObject.getPrimaryKey();
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbMetaDataTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbMetaDataTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbMetaDataTests.java
index 5edb27c..c7b69fe 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbMetaDataTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbMetaDataTests.java
@@ -30,7 +30,7 @@ public class CmpEjbMetaDataTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-        ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
         ejbMetaData = ejbHome.getEJBMetaData();
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbObjectTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbObjectTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbObjectTests.java
index 9f462c4..e1d4432 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbObjectTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpEjbObjectTests.java
@@ -31,7 +31,7 @@ public class CmpEjbObjectTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-        ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
         ejbObject = ejbHome.createObject("Third Bean");
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHandleTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHandleTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHandleTests.java
index 8dbf64e..f4ccf18 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHandleTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHandleTests.java
@@ -30,7 +30,7 @@ public class CmpHandleTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-        ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
         ejbObject = ejbHome.createObject("Fifth Bean");
         ejbHandle = ejbObject.getHandle();
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeHandleTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeHandleTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeHandleTests.java
index 6a7eebf..d23cf31 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeHandleTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeHandleTests.java
@@ -30,7 +30,7 @@ public class CmpHomeHandleTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-        ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
         ejbHomeHandle = ejbHome.getHomeHandle();
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeIntfcTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeIntfcTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeIntfcTests.java
index 7ae1074..a410527 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeIntfcTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpHomeIntfcTests.java
@@ -29,7 +29,7 @@ public class CmpHomeIntfcTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-        ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
     }
 
     //===============================
@@ -76,7 +76,7 @@ public class CmpHomeIntfcTests extends BasicCmpTestClient {
             assertEquals("The Collection is not the right size.", keys.length, objects.size());
             final Object[] objs = objects.toArray();
             for (int i = 0; i < objs.length; i++) {
-                ejbObject = (BasicCmpObject) javax.rmi.PortableRemoteObject.narrow(objs[i], BasicCmpObject.class);
+                ejbObject = (BasicCmpObject) objs[i];
                 // This could be problematic, it assumes the order of the collection.
                 assertEquals("The primary keys are not equal.", keys[i], ejbObject.getPrimaryKey());
             }

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiEncTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiEncTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiEncTests.java
index 4698439..66950a3 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiEncTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiEncTests.java
@@ -33,7 +33,7 @@ public class CmpJndiEncTests extends CmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
-        ejbHome = (EncCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, EncCmpHome.class);
+        ejbHome = (EncCmpHome) obj;
         ejbObject = ejbHome.create("Enc Bean");
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiTests.java
index 92aa59f..7c0e985 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpJndiTests.java
@@ -29,7 +29,7 @@ public class CmpJndiTests extends BasicCmpTestClient {
     public void test01_Jndi_lookupHome() {
         try {
             final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-            ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+            ejbHome = (BasicCmpHome) obj;
             assertNotNull("The EJBHome is null", ejbHome);
         } catch (final Exception e) {
             fail("Received Exception " + e.getClass() + " : " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/tomee/blob/09ace086/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpRemoteIntfcTests.java
----------------------------------------------------------------------
diff --git a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpRemoteIntfcTests.java b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpRemoteIntfcTests.java
index 0822867..f2dc3d6 100644
--- a/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpRemoteIntfcTests.java
+++ b/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp/CmpRemoteIntfcTests.java
@@ -29,7 +29,7 @@ public class CmpRemoteIntfcTests extends BasicCmpTestClient {
     protected void setUp() throws Exception {
         super.setUp();
         final Object obj = initialContext.lookup("client/tests/entity/cmp/BasicCmpHome");
-        ejbHome = (BasicCmpHome) javax.rmi.PortableRemoteObject.narrow(obj, BasicCmpHome.class);
+        ejbHome = (BasicCmpHome) obj;
         ejbObject = ejbHome.createObject("Forth Bean");
     }
 


Mime
View raw message