[jboss-cvs] JBossAS SVN: r63963 - in branches/JBPAPP_4_2_0_GA_CP/ejb3: src/main/org/jboss/ejb3/stateful and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 11 02:35:26 EDT 2007


Author: wolfc
Date: 2007-07-11 02:35:26 -0400 (Wed, 11 Jul 2007)
New Revision: 63963

Added:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java
Removed:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java
Modified:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
Log:
JBPAPP-299: merged EJBTHREE-994 from Branch_4_2

Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml	2007-07-11 06:10:14 UTC (rev 63962)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml	2007-07-11 06:35:26 UTC (rev 63963)
@@ -1823,6 +1823,19 @@
       <build-simple-jar name="ejbthree963"/>
    </target>
    
+   <target name="ejbthree994"
+      description="Builds a simple jar files."
+      depends="compile-classes">
+      
+      <build-simple-jar name="ejbthree994"/>
+
+      <copy todir="${build.lib}">
+         <fileset dir="${resources}/test/ejbthree994">
+            <include name="ejbthree994-connectors-service.xml"/>
+         </fileset>
+      </copy>
+   </target>
+   
    <target name="jbas4489"
       description="Builds a simple jar files."
       depends="compile-classes">
@@ -3224,7 +3237,7 @@
    <target name="jars" depends="entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
       circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440, 
       ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree832, ejbthree921,
-      ejbthree959, ejbthree963,
+      ejbthree959, ejbthree963, ejbthree994,
       jbas4489,
       aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, jaxws,
       pkg, securitydomain, enventry, 
@@ -3756,6 +3769,9 @@
          <param name="test" value="ejbthree963"/>
       </antcall>
       <antcall target="test" inheritRefs="true">
+         <param name="test" value="ejbthree994"/>
+      </antcall>
+      <antcall target="test" inheritRefs="true">
          <param name="test" value="jbas4489"/>
       </antcall>
    </target>

Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java	2007-07-11 06:10:14 UTC (rev 63962)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -63,7 +63,7 @@
 {
    private static final Logger log = Logger.getLogger(StatefulClusterProxyFactory.class);
    
-   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory,partition=";
+//   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory,partition=";
    
    private RemoteBinding binding;
    private InvokerLocator locator;
@@ -131,6 +131,7 @@
          namingException.setRootCause(e);
          throw namingException;
       }
+      assert !Dispatcher.singleton.isRegistered(targetId) : targetId + " is already registered";
       Dispatcher.singleton.registerTarget(targetId, this);
 
    }
@@ -195,10 +196,14 @@
       return handle;
    }
    
+   /**
+    * @return unique name for this proxy factory
+    */
    protected String getTargetId()
-   {  
+   {
+      assert jndiName != null : "jndiName is null";      
       String partition = ((StatefulContainer) container).getPartitionName();
-      return container.getObjectName().getCanonicalName() + FACTORY_ATTRIBUTE + partition;
+      return jndiName + PROXY_FACTORY_NAME + "@" + partition;
    }
    
    public synchronized void replicantsChanged (String key, 

Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-07-11 06:10:14 UTC (rev 63962)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -55,7 +55,7 @@
 {
    private static final Logger log = Logger.getLogger(StatefulRemoteProxyFactory.class);
    
-   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory";
+//   public static final String FACTORY_ATTRIBUTE = ",element=ProxyFactory";
    
    private RemoteBinding binding;
    private InvokerLocator locator;
@@ -127,6 +127,7 @@
          namingException.setRootCause(e);
          throw namingException;
       }
+      assert !Dispatcher.singleton.isRegistered(targetId) : targetId + " is already registered";
       Dispatcher.singleton.registerTarget(targetId, this);
 
       StatefulContainer statefulContainer = (StatefulContainer) container;
@@ -258,9 +259,13 @@
       }
    }
    
+   /**
+    * @return unique name for this proxy factory
+    */
    protected String getTargetId()
    {  
-      return container.getObjectName().getCanonicalName() + FACTORY_ATTRIBUTE;
+      assert jndiName != null : "jndiName is null"; 
+      return jndiName + PROXY_FACTORY_NAME;
    }
    
    protected Object createPojiProxy(Object oid, Class[] interfaces, String uri) throws Exception

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994 (from rev 63663, branches/Branch_4_2/ejb3/src/resources/test/ejbthree994)

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml	2007-06-27 08:18:55 UTC (rev 63663)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml	2007-07-11 06:35:26 UTC (rev 63963)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-   JBoss EJB3Deployer
-   
-   $Id$
--->
-<server>
-
-   <mbean code="org.jboss.remoting.transport.Connector"
-          name="jboss.remoting:type=Connector,name=Ejbthree994Ejb3Connector,handler=ejb3">
-      <attribute name="InvokerLocator">socket://${jboss.bind.address}:3874</attribute>
-      <attribute name="Configuration">
-         <handlers>
-            <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
-         </handlers>
-      </attribute>
-   </mbean>
-
-</server>

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml (from rev 63663, branches/Branch_4_2/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml	2007-07-11 06:35:26 UTC (rev 63963)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   JBoss EJB3Deployer
+   
+   $Id$
+-->
+<server>
+
+   <mbean code="org.jboss.remoting.transport.Connector"
+          name="jboss.remoting:type=Connector,name=Ejbthree994Ejb3Connector,handler=ejb3">
+      <attribute name="InvokerLocator">socket://${jboss.bind.address}:3874</attribute>
+      <attribute name="Configuration">
+         <handlers>
+            <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+         </handlers>
+      </attribute>
+   </mbean>
+
+</server>


Property changes on: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree994/ejbthree994-connectors-service.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994 (from rev 63663, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994)

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java	2007-06-27 08:18:55 UTC (rev 63663)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree994;
-
-/**
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public interface BusinessInterface
-{
-   String echo(String s);
-}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java (from rev 63663, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree994;
+
+/**
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface BusinessInterface
+{
+   String echo(String s);
+}


Property changes on: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java	2007-06-27 08:18:55 UTC (rev 63663)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree994;
-
-import javax.ejb.Remote;
-import javax.ejb.Stateful;
-import org.jboss.annotation.ejb.RemoteBinding;
-import org.jboss.annotation.ejb.RemoteBindings;
-
-/**
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Stateful
- at RemoteBindings({
-   @RemoteBinding(clientBindUrl="socket://0.0.0.0:3873", jndiBinding="Stateful3873"),
-   @RemoteBinding(clientBindUrl="socket://0.0.0.0:3874", jndiBinding="Stateful3874")
-})
- at Remote(BusinessInterface.class)
-public class StatefulBean implements BusinessInterface
-{
-   public String echo(String s)
-   {
-      return "*** " + s + " ***";
-   }
-}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java (from rev 63663, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree994;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateful;
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.ejb.RemoteBindings;
+
+/**
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at RemoteBindings({
+   @RemoteBinding(clientBindUrl="socket://0.0.0.0:3873", jndiBinding="Stateful3873"),
+   @RemoteBinding(clientBindUrl="socket://0.0.0.0:3874", jndiBinding="Stateful3874")
+})
+ at Remote(BusinessInterface.class)
+public class StatefulBean implements BusinessInterface
+{
+   public String echo(String s)
+   {
+      return "*** " + s + " ***";
+   }
+}


Property changes on: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit (from rev 63663, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit)

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java	2007-06-27 08:18:55 UTC (rev 63663)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree994.unit;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.ejbthree994.BusinessInterface;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.test.JBossTestCase;
-
-
-/**
- * Test if multiple remote bindings work correctly.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public class MultiBindingsTestCase extends JBossTestCase
-{
-
-   public MultiBindingsTestCase(String name)
-   {
-      super(name);
-   }
-
-   private static String getProxyUri(Object proxy) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException
-   {
-      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
-      Field f = handler.getClass().getDeclaredField("uri");
-      f.setAccessible(true);
-      InvokerLocator locator = (InvokerLocator) f.get(handler);
-      return locator.getOriginalURI();
-   }
-   
-   public void test1() throws Exception
-   {
-      {
-         BusinessInterface bean = (BusinessInterface) getInitialContext().lookup("Stateful3873");
-         String actual = bean.echo("123");
-         assertEquals(actual, "*** 123 ***");
-         
-         String proxyUri = getProxyUri(bean);
-         assertEquals(proxyUri, "socket://0.0.0.0:3873");
-      }
-
-      {
-         BusinessInterface bean = (BusinessInterface) getInitialContext().lookup("Stateful3874");
-         String actual = bean.echo("456");
-         assertEquals(actual, "*** 456 ***");
-         
-         String proxyUri = getProxyUri(bean);
-         assertEquals(proxyUri, "socket://0.0.0.0:3874");
-      }
-   }
-   
-   public static Test suite() throws Exception
-   {
-      return getDeploySetup(MultiBindingsTestCase.class, "ejbthree994-connectors-service.xml,ejbthree994.jar");
-   }
-
-}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java (from rev 63663, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java	2007-07-11 06:35:26 UTC (rev 63963)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree994.unit;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree994.BusinessInterface;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.test.JBossTestCase;
+
+
+/**
+ * Test if multiple remote bindings work correctly.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class MultiBindingsTestCase extends JBossTestCase
+{
+
+   public MultiBindingsTestCase(String name)
+   {
+      super(name);
+   }
+
+   private static String getProxyUri(Object proxy) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException
+   {
+      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
+      Field f = handler.getClass().getDeclaredField("uri");
+      f.setAccessible(true);
+      InvokerLocator locator = (InvokerLocator) f.get(handler);
+      return locator.getOriginalURI();
+   }
+   
+   public void test1() throws Exception
+   {
+      {
+         BusinessInterface bean = (BusinessInterface) getInitialContext().lookup("Stateful3873");
+         String actual = bean.echo("123");
+         assertEquals(actual, "*** 123 ***");
+         
+         String proxyUri = getProxyUri(bean);
+         assertEquals(proxyUri, "socket://0.0.0.0:3873");
+      }
+
+      {
+         BusinessInterface bean = (BusinessInterface) getInitialContext().lookup("Stateful3874");
+         String actual = bean.echo("456");
+         assertEquals(actual, "*** 456 ***");
+         
+         String proxyUri = getProxyUri(bean);
+         assertEquals(proxyUri, "socket://0.0.0.0:3874");
+      }
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(MultiBindingsTestCase.class, "ejbthree994-connectors-service.xml,ejbthree994.jar");
+   }
+
+}


Property changes on: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list