[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/http/ssl/config ...

Tom Elrod tom.elrod at jboss.com
Wed Jul 12 00:49:52 EDT 2006


  User: telrod  
  Date: 06/07/12 00:49:52

  Modified:    src/tests/org/jboss/test/remoting/transport/http/ssl/config   
                        HostnameVerifierTestCase.java
  Added:       src/tests/org/jboss/test/remoting/transport/http/ssl/config   
                        TestClientInvokerFactory.java
                        TestServerInvokerFactory.java
  Log:
  JBREM-496 & JBREM-492 & JBREM-535 - changed invoker loading to use a client and server factory instead of loading classes directly.  This allows users ability to plugin custom transport implementation with zero config.  Also added config for forcing remote call when client and server within same jvm (which was able to do previously using BYVALUE config, but not any more).  Also changed way to get hint if transport supports ssl to be provided by the transport factory instead of the transport itself.
  
  Revision  Changes    Path
  1.4       +12 -22    JBossRemoting/src/tests/org/jboss/test/remoting/transport/http/ssl/config/HostnameVerifierTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HostnameVerifierTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/transport/http/ssl/config/HostnameVerifierTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- HostnameVerifierTestCase.java	21 Jun 2006 18:39:21 -0000	1.3
  +++ HostnameVerifierTestCase.java	12 Jul 2006 04:49:52 -0000	1.4
  @@ -21,36 +21,26 @@
    */
   package org.jboss.test.remoting.transport.http.ssl.config;
   
  -import java.lang.reflect.Field;
  -import java.util.ArrayList;
  -import java.util.HashMap;
  -import java.util.Map;
  -
  -import javax.management.MBeanServer;
  -import javax.net.ssl.HostnameVerifier;
  -import javax.net.ssl.SSLSession;
  -
   import junit.framework.TestCase;
  -
   import org.jboss.logging.Logger;
   import org.jboss.remoting.Client;
   import org.jboss.remoting.InvocationRequest;
   import org.jboss.remoting.InvokerLocator;
   import org.jboss.remoting.InvokerRegistry;
  -import org.jboss.remoting.Remoting;
   import org.jboss.remoting.ServerInvocationHandler;
   import org.jboss.remoting.ServerInvoker;
   import org.jboss.remoting.callback.Callback;
   import org.jboss.remoting.callback.HandleCallbackException;
   import org.jboss.remoting.callback.InvokerCallbackHandler;
  -import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
   import org.jboss.remoting.security.SSLSocketBuilder;
   import org.jboss.remoting.transport.ClientInvoker;
   import org.jboss.remoting.transport.Connector;
   import org.jboss.remoting.transport.PortUtil;
  -import org.jboss.remoting.transport.coyote.CoyoteInvoker;
   import org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker;
  -import org.jboss.remoting.transport.http.ssl.HTTPSServerInvoker;
  +
  +import javax.management.MBeanServer;
  +import java.util.ArrayList;
  +import java.util.HashMap;
   
   /**
    * 
  @@ -73,9 +63,9 @@
            if (connector == null)
            {
               // Register subclassed transport for test.
  -            InvokerRegistry.registerInvoker(getTransport(),
  -                                            TestClientInvoker.class.getName(),
  -                                            CoyoteInvoker.class.getName());
  +            InvokerRegistry.registerInvokerFactories(getTransport(),
  +                                            TestClientInvokerFactory.class,
  +                                            TestServerInvokerFactory.class);
               
               HashMap config = new HashMap();
               
  @@ -86,7 +76,7 @@
               config.put(SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD, "unit-tests-server");
               
               // Make callback Client use remote invoker.
  -            config.put(InvokerLocator.BYVALUE, "true");
  +            config.put(InvokerLocator.FORCE_REMOTE, "true");
               
               // Start Connector.
               int freeport = PortUtil.findFreePort(getHostName());
  @@ -127,7 +117,7 @@
            HashMap config = new HashMap();
            
            // Make Client use remote invoker.
  -         config.put(InvokerLocator.BYVALUE, "true");
  +         config.put(InvokerLocator.FORCE_REMOTE, "true");
            
            // Put SSL truststore parameters in config map.
            config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
  @@ -171,7 +161,7 @@
            HashMap config = new HashMap();
            
            // Make Client use remote invoker.
  -         config.put(InvokerLocator.BYVALUE, "true");
  +         config.put(InvokerLocator.FORCE_REMOTE, "true");
            
            // Put SSL truststore parameters in config map.
            config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
  @@ -214,7 +204,7 @@
            HashMap config = new HashMap();
            
            // Make Client use remote invoker.
  -         config.put(InvokerLocator.BYVALUE, "true");
  +         config.put(InvokerLocator.FORCE_REMOTE, "true");
            
            // Put SSL truststore parameters in config map.
            config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
  @@ -259,7 +249,7 @@
            HashMap config = new HashMap();
            
            // Make Client use remote invoker.
  -         config.put(InvokerLocator.BYVALUE, "true");
  +         config.put(InvokerLocator.FORCE_REMOTE, "true");
            
            // Put SSL truststore parameters in config map.
            config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
  
  
  
  1.1      date: 2006/07/12 04:49:52;  author: telrod;  state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/transport/http/ssl/config/TestClientInvokerFactory.java
  
  Index: TestClientInvokerFactory.java
  ===================================================================
  /*
  * JBoss, Home of Professional Open Source
  * Copyright 2005, JBoss Inc., 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.test.remoting.transport.http.ssl.config;
  
  import org.jboss.remoting.InvokerLocator;
  import org.jboss.remoting.transport.ClientFactory;
  import org.jboss.remoting.transport.ClientInvoker;
  
  import java.io.IOException;
  import java.util.Map;
  
  /**
   * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
   */
  public class TestClientInvokerFactory implements ClientFactory
  {
     public ClientInvoker createClientInvoker(InvokerLocator locator, Map config) throws IOException
     {
        return new TestClientInvoker(locator, config);
     }
  
     public boolean supportsSSL()
     {
        return true;
     }
  }
  
  
  1.1      date: 2006/07/12 04:49:52;  author: telrod;  state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/transport/http/ssl/config/TestServerInvokerFactory.java
  
  Index: TestServerInvokerFactory.java
  ===================================================================
  /*
  * JBoss, Home of Professional Open Source
  * Copyright 2005, JBoss Inc., 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.test.remoting.transport.http.ssl.config;
  
  import org.jboss.remoting.InvokerLocator;
  import org.jboss.remoting.ServerInvoker;
  import org.jboss.remoting.transport.ServerFactory;
  import org.jboss.remoting.transport.coyote.CoyoteInvoker;
  
  import java.io.IOException;
  import java.util.Map;
  
  /**
   * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
   */
  public class TestServerInvokerFactory implements ServerFactory
  {
     public ServerInvoker createServerInvoker(InvokerLocator locator, Map config) throws IOException
     {
        return new CoyoteInvoker(locator, config);
     }
  
     public boolean supportsSSL()
     {
        return true;
     }
  }
  
  



More information about the jboss-cvs-commits mailing list