commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r429752 - in /jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy: provider/TestRmiProvider.java util/rmi/RmiEchoImpl.java
Date Tue, 08 Aug 2006 17:47:29 GMT
Author: bayard
Date: Tue Aug  8 10:47:28 2006
New Revision: 429752

URL: http://svn.apache.org/viewvc?rev=429752&view=rev
Log:
Modified the RMI test to use 13099 as a port and not 1099. 1099 is the default, so there's
always a chance that it might be in use on the machine its running on. 

Modified:
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestRmiProvider.java
    jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/rmi/RmiEchoImpl.java

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestRmiProvider.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestRmiProvider.java?rev=429752&r1=429751&r2=429752&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestRmiProvider.java
(original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/provider/TestRmiProvider.java
Tue Aug  8 10:47:28 2006
@@ -35,6 +35,8 @@
 
     private RmiEchoImpl implObject;
     private Registry registry;
+    // A port that is unlikely to clash with another on the build machine
+    private int UNLIKELY_PORT = 13099;
 
 //----------------------------------------------------------------------------------------------------------------------
 // Other Methods
@@ -42,8 +44,8 @@
 
     public void setUpRegistry() throws Exception
     {
-        implObject = new RmiEchoImpl();
-        registry = LocateRegistry.createRegistry( Registry.REGISTRY_PORT );
+        implObject = new RmiEchoImpl( UNLIKELY_PORT );
+        registry = LocateRegistry.createRegistry( UNLIKELY_PORT );
         registry.bind( "echo", implObject );
     }
 
@@ -59,6 +61,7 @@
     {
         final RmiProvider provider = new RmiProvider();
         provider.setName( "echo" );
+        provider.setPort( UNLIKELY_PORT );
         try
         {
             provider.getObject();
@@ -82,6 +85,7 @@
     {
         setUpRegistry();
         final RmiProvider provider = new RmiProvider( "echo" );
+        provider.setPort( UNLIKELY_PORT );
         final RmiEcho echo = ( RmiEcho ) provider.getObject();
         assertEquals( "Hello, World!", echo.echoBack( "Hello, World!" ) );
     }
@@ -90,6 +94,7 @@
     {
         setUpRegistry();
         final RmiProvider provider = new RmiProvider( "localhost", "echo" );
+        provider.setPort( UNLIKELY_PORT );
         final RmiEcho echo = ( RmiEcho ) provider.getObject();
         assertEquals( "Hello, World!", echo.echoBack( "Hello, World!" ) );
     }
@@ -98,6 +103,7 @@
     {
         setUpRegistry();
         final RmiProvider provider = new RmiProvider( "bogus" );
+        provider.setPort( UNLIKELY_PORT );
         try
         {
             provider.getObject();
@@ -112,6 +118,7 @@
     {
         setUpRegistry();
         final RmiProvider provider = new RmiProvider( "localhost", Registry.REGISTRY_PORT,
"echo" );
+        provider.setPort( UNLIKELY_PORT );
         final RmiEcho echo = ( RmiEcho ) provider.getObject();
         assertEquals( "Hello, World!", echo.echoBack( "Hello, World!" ) );
     }
@@ -119,11 +126,11 @@
     public void testGetObjectWithPortAndHostAndFactory() throws Exception
     {
         setUpRegistry();
-        final RmiProvider provider = new RmiProvider( "localhost", Registry.REGISTRY_PORT,
+        final RmiProvider provider = new RmiProvider( "localhost", UNLIKELY_PORT,
                                                       RMISocketFactory.getDefaultSocketFactory(),
"echo" );
         final RmiEcho echo = ( RmiEcho ) provider.getObject();
         assertEquals( "Hello, World!", echo.echoBack( "Hello, World!" ) );
     }
 
 
-}
\ No newline at end of file
+}

Modified: jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/rmi/RmiEchoImpl.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/rmi/RmiEchoImpl.java?rev=429752&r1=429751&r2=429752&view=diff
==============================================================================
--- jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/rmi/RmiEchoImpl.java
(original)
+++ jakarta/commons/sandbox/proxy/trunk/src/test/org/apache/commons/proxy/util/rmi/RmiEchoImpl.java
Tue Aug  8 10:47:28 2006
@@ -24,8 +24,9 @@
  */
 public class RmiEchoImpl extends UnicastRemoteObject implements RmiEcho
 {
-    public RmiEchoImpl() throws RemoteException
+    public RmiEchoImpl(int port) throws RemoteException
     {
+        super(port);
     }
 
     public String echoBack( String message ) throws RemoteException



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message