[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch ...

Ron Sigal ron_sigal at yahoo.com
Sun Feb 4 03:05:54 EST 2007


  User: rsigal  
  Date: 07/02/04 03:05:54

  Added:       src/tests/org/jboss/test/remoting/callback/asynch                                    
                        SocketAsynchCallbackTestCase.java
                        SSLSocketAsynchCallbackTestClient.java
                        SSLMultiplexAsynchCallbackTestClient.java
                        HTTPSAsynchCallbackTestServer.java
                        RMIAsynchCallbackTestClient.java
                        AsynchCallbackTestServerRoot.java
                        SocketAsynchCallbackTestClient.java
                        SSLRMIAsynchCallbackTestCase.java keystore
                        HTTPAsynchCallbackTestClient.java
                        HTTPSAsynchCallbackTestClient.java
                        SSLSocketAsynchCallbackTestServer.java
                        BisocketAsynchCallbackTestServer.java
                        HTTPAsynchCallbackTestCase.java
                        SSLSocketAsynchCallbackTestCase.java
                        SSLRMIAsynchCallbackTestServer.java
                        SocketAsynchCallbackTestServer.java truststore
                        MultiplexAsynchCallbackTestClient.java
                        MultiplexAsynchCallbackTestServer.java
                        SSLBisocketAsynchCallbackTestCase.java
                        BisocketAsynchCallbackTestCase.java
                        SSLRMIAsynchCallbackTestClient.java
                        SSLBisocketAsynchCallbackTestServer.java
                        HTTPSAsynchCallbackTestCase.java
                        SSLAsynchCallbackTestServerRoot.java
                        MultiplexAsynchCallbackTestCase.java
                        RMIAsynchCallbackTestCase.java
                        HTTPAsynchCallbackTestServer.java
                        RMIAsynchCallbackTestServer.java
                        SSLBisocketAsynchCallbackTestClient.java
                        SSLMultiplexAsynchCallbackTestServer.java
                        SSLMultiplexAsynchCallbackTestCase.java
                        AsynchCallbackTestClientRoot.java
                        SSLAsynchCallbackTestClientRoot.java
                        BisocketAsynchCallbackTestClient.java
  Log:
  JBREM-640: Unit tests for asynchronous callback facility.
  
  Revision  Changes    Path
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SocketAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SocketAsynchCallbackTestCase.java
  ===================================================================
  RCS file: SocketAsynchCallbackTestCase.java
  diff -N SocketAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SocketAsynchCallbackTestCase.java	4 Feb 2007 08:05:49 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class SocketAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(SSLSocketAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     SSLSocketAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +38 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLSocketAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLSocketAsynchCallbackTestClient.java
  ===================================================================
  RCS file: SSLSocketAsynchCallbackTestClient.java
  diff -N SSLSocketAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLSocketAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,38 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLSocketAsynchCallbackTestClient extends SSLAsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "sslsocket";
  +   }
  +
  +}
  
  
  
  1.2       +38 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLMultiplexAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLMultiplexAsynchCallbackTestClient.java
  ===================================================================
  RCS file: SSLMultiplexAsynchCallbackTestClient.java
  diff -N SSLMultiplexAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLMultiplexAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,38 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLMultiplexAsynchCallbackTestClient extends SSLAsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "sslmultiplex";
  +   }
  +
  +}
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/HTTPSAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPSAsynchCallbackTestServer.java
  ===================================================================
  RCS file: HTTPSAsynchCallbackTestServer.java
  diff -N HTTPSAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ HTTPSAsynchCallbackTestServer.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class HTTPSAsynchCallbackTestServer extends SSLAsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new HTTPSAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "https";
  +   }
  +
  +}
  
  
  
  1.2       +37 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/RMIAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RMIAsynchCallbackTestClient.java
  ===================================================================
  RCS file: RMIAsynchCallbackTestClient.java
  diff -N RMIAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ RMIAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,37 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class RMIAsynchCallbackTestClient extends AsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "rmi";
  +   }
  +}
  
  
  
  1.2       +208 -0    JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestServerRoot.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsynchCallbackTestServerRoot.java
  ===================================================================
  RCS file: AsynchCallbackTestServerRoot.java
  diff -N AsynchCallbackTestServerRoot.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ AsynchCallbackTestServerRoot.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,208 @@
  +/*
  +* 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.callback.asynch;
  +
  +import java.lang.reflect.Field;
  +import java.net.InetAddress;
  +import java.util.HashMap;
  +import java.util.Map;
  +
  +import javax.management.MBeanServer;
  +
  +import org.jboss.jrunit.extensions.ServerTestCase;
  +import org.jboss.logging.Logger;
  +import org.jboss.remoting.Client;
  +import org.jboss.remoting.InvocationRequest;
  +import org.jboss.remoting.InvokerLocator;
  +import org.jboss.remoting.ServerInvocationHandler;
  +import org.jboss.remoting.ServerInvoker;
  +import org.jboss.remoting.callback.AsynchInvokerCallbackHandler;
  +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.transport.Connector;
  +import org.jboss.util.threadpool.BasicThreadPool;
  +
  +/** 
  + * AsynchCallbackTestClientRoot and AsynchCallbackTestServerRoot are the parent classes
  + * for a set of transport specific tests of the asynchronous callback facility.
  + * 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 25, 2006
  + * </p>
  + */
  +public abstract class AsynchCallbackTestServerRoot extends ServerTestCase
  +{
  +   public static int port = 5413;
  +   
  +   public static String SYNCHRONOUS_TEST = "synchronousTest";
  +   public static String ASYNCHRONOUS_SERVER_SIDE_TEST = "asynchronousServerSideTest";
  +   public static String ASYNCHRONOUS_CLIENT_SIDE_TEST = "asynchronousClientSideTest";
  +   public static String GET_STATUS = "getStatus";
  +   public static String RESET = "reset";
  +   public static String GET_THREAD_COUNT = "getThreadCount";
  +   public static String GET_QUEUE_SIZE = "getQueueSize";
  +   public static String THREAD_COUNT = "17";
  +   public static String QUEUE_SIZE = "19";
  +   
  +   private static Logger log = Logger.getLogger(AsynchCallbackTestServerRoot.class);
  +   
  +   // remoting server connector
  +   static private Connector connector;
  +   String serverLocatorURI;
  +
  +   
  +   /**
  +    * Sets up target remoting server.
  +    */
  +   public void setUp() throws Exception
  +   {
  +      log.info("entering setUp()");
  +      String locatorURI =  getTransport() + "://" + InetAddress.getLocalHost().getHostAddress() + ":" + port; 
  +      InvokerLocator serverLocator = new InvokerLocator(locatorURI);
  +      System.out.println("Starting remoting server with locator uri of: " + locatorURI);
  +      Map config = new HashMap();
  +      config.put(Client.MAX_NUM_ONEWAY_THREADS, THREAD_COUNT);
  +      config.put(Client.MAX_ONEWAY_THREAD_POOL_QUEUE_SIZE, QUEUE_SIZE);
  +      addTransportSpecificConfig(config);
  +      connector = new Connector(serverLocator, config);
  +      connector.create();
  +      SampleInvocationHandler invocationHandler = new SampleInvocationHandler();
  +      connector.addInvocationHandler("sample", invocationHandler);
  +      connector.start();
  +   }
  +
  +   
  +   /**
  +    * Shuts down the server
  +    */
  +   public void tearDown()
  +   {
  +      connector.stop();
  +      connector.destroy();
  +   }
  +   
  +   
  +   protected abstract String getTransport();
  +   
  +   
  +   protected void addTransportSpecificConfig(Map config)
  +   {
  +   }
  +
  +   /**
  +    * Simple invocation handler implementation.  When callback client's are registered, will
  +    * generate callbacks periodically.
  +    */
  +   static class SampleInvocationHandler implements ServerInvocationHandler
  +   {
  +      boolean done;
  +      AsynchInvokerCallbackHandler callbackHandler;
  +      
  +      public void addListener(InvokerCallbackHandler callbackHandler)
  +      {
  +         System.out.println("Adding callback listener.");
  +         assertTrue(callbackHandler instanceof AsynchInvokerCallbackHandler);
  +         this.callbackHandler = (AsynchInvokerCallbackHandler) callbackHandler;
  +      }
  +
  +      public Object invoke(InvocationRequest invocation) throws Throwable
  +      {
  +         try
  +         {
  +            String test = (String) invocation.getParameter();
  +            if (test.equals(SYNCHRONOUS_TEST))
  +            {
  +               log.info("making synchronous callback");
  +               callbackHandler.handleCallback(new Callback(test));
  +               log.info("made synchronous callback");
  +            }
  +            else if (test.equals(ASYNCHRONOUS_SERVER_SIDE_TEST))
  +            {
  +               log.info("making asynchronous callback - server side");
  +               callbackHandler.handleCallbackOneway(new Callback("callback"), true);
  +            }
  +            else if (test.equals(ASYNCHRONOUS_CLIENT_SIDE_TEST))
  +            {
  +               log.info("making asynchronous callback - client side");
  +               callbackHandler.handleCallbackOneway(new Callback("callback"));
  +            }
  +            else if (test.equals(GET_STATUS))
  +            {
  +               synchronized (this)
  +               {
  +                  log.info("returning status: " + done);
  +                  return new Boolean(done);
  +               }
  +            }
  +            else if (test.equals(RESET))
  +            {
  +               synchronized (this)
  +               {
  +                  done = false;
  +               } 
  +            }
  +            else if (test.equals(GET_THREAD_COUNT))
  +            {
  +               ServerInvokerCallbackHandler sich = (ServerInvokerCallbackHandler) callbackHandler;
  +               Client callbackClient = sich.getCallbackClient();
  +               Field field = Client.class.getDeclaredField("onewayThreadPool");
  +               field.setAccessible(true);
  +               BasicThreadPool threadPool = (BasicThreadPool) field.get(callbackClient);
  +               int size = threadPool.getMaximumPoolSize();
  +               return Integer.toString(size);
  +            }
  +            else if (test.equals(GET_QUEUE_SIZE))
  +            {
  +               ServerInvokerCallbackHandler sich = (ServerInvokerCallbackHandler) callbackHandler;
  +               Client callbackClient = sich.getCallbackClient();
  +               Field field = Client.class.getDeclaredField("onewayThreadPool");
  +               field.setAccessible(true);
  +               BasicThreadPool threadPool = (BasicThreadPool) field.get(callbackClient);
  +               int size = threadPool.getMaximumQueueSize();
  +               return Integer.toString(size);
  +            }
  +            else
  +            {
  +               log.error("unrecognized test: " + test);
  +            }
  +         }
  +         catch (HandleCallbackException e)
  +         {
  +            log.error("Unable to send callback");
  +         }
  +         synchronized (this)
  +         {
  +            done = true;
  +            log.info("done");
  +         }
  +         return null;
  +      }
  +      
  +      public void removeListener(InvokerCallbackHandler callbackHandler) {}
  +      public void setMBeanServer(MBeanServer server) {}
  +      public void setInvoker(ServerInvoker invoker) {}
  +   }
  +}
  
  
  
  1.2       +37 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SocketAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SocketAsynchCallbackTestClient.java
  ===================================================================
  RCS file: SocketAsynchCallbackTestClient.java
  diff -N SocketAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SocketAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,37 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SocketAsynchCallbackTestClient extends AsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "socket";
  +   }
  +}
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLRMIAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLRMIAsynchCallbackTestCase.java
  ===================================================================
  RCS file: SSLRMIAsynchCallbackTestCase.java
  diff -N SSLRMIAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLRMIAsynchCallbackTestCase.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class SSLRMIAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(SSLRMIAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     SSLRMIAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +57 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/keystore
  
  	<<Binary file>>
  
  
  1.2       +37 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/HTTPAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPAsynchCallbackTestClient.java
  ===================================================================
  RCS file: HTTPAsynchCallbackTestClient.java
  diff -N HTTPAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ HTTPAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,37 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class HTTPAsynchCallbackTestClient extends AsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "http";
  +   }
  +}
  
  
  
  1.2       +47 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/HTTPSAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPSAsynchCallbackTestClient.java
  ===================================================================
  RCS file: HTTPSAsynchCallbackTestClient.java
  diff -N HTTPSAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ HTTPSAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,47 @@
  +/*
  +* 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.callback.asynch;
  +
  +import java.util.Map;
  +
  +import org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class HTTPSAsynchCallbackTestClient extends SSLAsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "https";
  +   }
  +
  +   protected void addTransportSpecificConfig(Map config)
  +   {
  +      super.addTransportSpecificConfig(config);
  +      config.put(HTTPSClientInvoker.IGNORE_HTTPS_HOST, "true");
  +   }
  +}
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLSocketAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLSocketAsynchCallbackTestServer.java
  ===================================================================
  RCS file: SSLSocketAsynchCallbackTestServer.java
  diff -N SSLSocketAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLSocketAsynchCallbackTestServer.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLSocketAsynchCallbackTestServer extends SSLAsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new SSLSocketAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "sslsocket";
  +   }
  +
  +}
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/BisocketAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BisocketAsynchCallbackTestServer.java
  ===================================================================
  RCS file: BisocketAsynchCallbackTestServer.java
  diff -N BisocketAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ BisocketAsynchCallbackTestServer.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class BisocketAsynchCallbackTestServer extends AsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new BisocketAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "bisocket";
  +   }
  +
  +}
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/HTTPAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPAsynchCallbackTestCase.java
  ===================================================================
  RCS file: HTTPAsynchCallbackTestCase.java
  diff -N HTTPAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ HTTPAsynchCallbackTestCase.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class HTTPAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(HTTPAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     HTTPAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLSocketAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLSocketAsynchCallbackTestCase.java
  ===================================================================
  RCS file: SSLSocketAsynchCallbackTestCase.java
  diff -N SSLSocketAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLSocketAsynchCallbackTestCase.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class SSLSocketAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(SSLSocketAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     SSLSocketAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLRMIAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLRMIAsynchCallbackTestServer.java
  ===================================================================
  RCS file: SSLRMIAsynchCallbackTestServer.java
  diff -N SSLRMIAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLRMIAsynchCallbackTestServer.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLRMIAsynchCallbackTestServer extends SSLAsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new SSLRMIAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "sslrmi";
  +   }
  +
  +}
  
  
  
  1.2       +54 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SocketAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SocketAsynchCallbackTestServer.java
  ===================================================================
  RCS file: SocketAsynchCallbackTestServer.java
  diff -N SocketAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SocketAsynchCallbackTestServer.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,54 @@
  +/*
  +* 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.callback.asynch;
  +
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SocketAsynchCallbackTestServer extends AsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new SocketAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "socket";
  +   }
  +
  +}
  
  
  
  1.2       +34 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/truststore
  
  	<<Binary file>>
  
  
  1.2       +37 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/MultiplexAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultiplexAsynchCallbackTestClient.java
  ===================================================================
  RCS file: MultiplexAsynchCallbackTestClient.java
  diff -N MultiplexAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ MultiplexAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,37 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class MultiplexAsynchCallbackTestClient extends AsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "multiplex";
  +   }
  +}
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/MultiplexAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultiplexAsynchCallbackTestServer.java
  ===================================================================
  RCS file: MultiplexAsynchCallbackTestServer.java
  diff -N MultiplexAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ MultiplexAsynchCallbackTestServer.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class MultiplexAsynchCallbackTestServer extends AsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new MultiplexAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "multiplex";
  +   }
  +
  +}
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLBisocketAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLBisocketAsynchCallbackTestCase.java
  ===================================================================
  RCS file: SSLBisocketAsynchCallbackTestCase.java
  diff -N SSLBisocketAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLBisocketAsynchCallbackTestCase.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class SSLBisocketAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(SocketAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     SocketAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/BisocketAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BisocketAsynchCallbackTestCase.java
  ===================================================================
  RCS file: BisocketAsynchCallbackTestCase.java
  diff -N BisocketAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ BisocketAsynchCallbackTestCase.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class BisocketAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(BisocketAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     BisocketAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +38 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLRMIAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLRMIAsynchCallbackTestClient.java
  ===================================================================
  RCS file: SSLRMIAsynchCallbackTestClient.java
  diff -N SSLRMIAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLRMIAsynchCallbackTestClient.java	4 Feb 2007 08:05:52 -0000	1.2
  @@ -0,0 +1,38 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLRMIAsynchCallbackTestClient extends SSLAsynchCallbackTestClientRoot
  +{
  +   protected String getTransport()
  +   {
  +      return "sslrmi";
  +   }
  +
  +}
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLBisocketAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLBisocketAsynchCallbackTestServer.java
  ===================================================================
  RCS file: SSLBisocketAsynchCallbackTestServer.java
  diff -N SSLBisocketAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLBisocketAsynchCallbackTestServer.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLBisocketAsynchCallbackTestServer extends SSLAsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new SSLBisocketAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "sslbisocket";
  +   }
  +
  +}
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/HTTPSAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPSAsynchCallbackTestCase.java
  ===================================================================
  RCS file: HTTPSAsynchCallbackTestCase.java
  diff -N HTTPSAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ HTTPSAsynchCallbackTestCase.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class HTTPSAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(HTTPSAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     HTTPSAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +49 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLAsynchCallbackTestServerRoot.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLAsynchCallbackTestServerRoot.java
  ===================================================================
  RCS file: SSLAsynchCallbackTestServerRoot.java
  diff -N SSLAsynchCallbackTestServerRoot.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLAsynchCallbackTestServerRoot.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,49 @@
  +/*
  +* 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.callback.asynch;
  +
  +import java.util.Map;
  +
  +import org.jboss.remoting.security.SSLSocketBuilder;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public abstract class SSLAsynchCallbackTestServerRoot extends AsynchCallbackTestServerRoot
  +{
  +   protected void addTransportSpecificConfig(Map config)
  +   {
  +      config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
  +      String trustStoreFilePath = this.getClass().getResource("truststore").getFile();
  +      config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH, trustStoreFilePath);
  +      config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD, "unit-tests-client");
  +      
  +      config.put(SSLSocketBuilder.REMOTING_KEY_STORE_TYPE, "JKS");
  +      String keyStoreFilePath = this.getClass().getResource("keystore").getFile();
  +      config.put(SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH, keyStoreFilePath);
  +      config.put(SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD, "unit-tests-server"); 
  +   }
  +}
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/MultiplexAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultiplexAsynchCallbackTestCase.java
  ===================================================================
  RCS file: MultiplexAsynchCallbackTestCase.java
  diff -N MultiplexAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ MultiplexAsynchCallbackTestCase.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class MultiplexAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(MultiplexAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     MultiplexAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/RMIAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RMIAsynchCallbackTestCase.java
  ===================================================================
  RCS file: RMIAsynchCallbackTestCase.java
  diff -N RMIAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ RMIAsynchCallbackTestCase.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class RMIAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(RMIAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     RMIAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/HTTPAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HTTPAsynchCallbackTestServer.java
  ===================================================================
  RCS file: HTTPAsynchCallbackTestServer.java
  diff -N HTTPAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ HTTPAsynchCallbackTestServer.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class HTTPAsynchCallbackTestServer extends AsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new HTTPAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "http";
  +   }
  +
  +}
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/RMIAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RMIAsynchCallbackTestServer.java
  ===================================================================
  RCS file: RMIAsynchCallbackTestServer.java
  diff -N RMIAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ RMIAsynchCallbackTestServer.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class RMIAsynchCallbackTestServer extends AsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new RMIAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "rmi";
  +   }
  +
  +}
  
  
  
  1.2       +48 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLBisocketAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLBisocketAsynchCallbackTestClient.java
  ===================================================================
  RCS file: SSLBisocketAsynchCallbackTestClient.java
  diff -N SSLBisocketAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLBisocketAsynchCallbackTestClient.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,48 @@
  +/*
  +* 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.callback.asynch;
  +
  +import java.util.Map;
  +
  +import org.jboss.remoting.transport.bisocket.Bisocket;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLBisocketAsynchCallbackTestClient extends SSLAsynchCallbackTestClientRoot
  +{
  +   protected void addTransportSpecificConfig(Map config)
  +   {
  +      super.addTransportSpecificConfig(config);
  +      config.put(Bisocket.IS_CALLBACK_SERVER, "true");
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "sslbisocket";
  +   }
  +
  +}
  
  
  
  1.2       +53 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLMultiplexAsynchCallbackTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLMultiplexAsynchCallbackTestServer.java
  ===================================================================
  RCS file: SSLMultiplexAsynchCallbackTestServer.java
  diff -N SSLMultiplexAsynchCallbackTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLMultiplexAsynchCallbackTestServer.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,53 @@
  +/*
  +* 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.callback.asynch;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class SSLMultiplexAsynchCallbackTestServer extends SSLAsynchCallbackTestServerRoot
  +{
  +   public static void main(String[] args)
  +   {
  +      AsynchCallbackTestServerRoot testCase = new SSLMultiplexAsynchCallbackTestServer();
  +      try
  +      {
  +         testCase.setUp();
  +         Thread.sleep(60000);
  +         testCase.tearDown();
  +      }
  +      catch(Throwable e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "sslmultiplex";
  +   }
  +
  +}
  
  
  
  1.2       +79 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLMultiplexAsynchCallbackTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLMultiplexAsynchCallbackTestCase.java
  ===================================================================
  RCS file: SSLMultiplexAsynchCallbackTestCase.java
  diff -N SSLMultiplexAsynchCallbackTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLMultiplexAsynchCallbackTestCase.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,79 @@
  +/*
  +* 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.callback.asynch;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * Tests asynchronous callback handling.
  + *  
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 28, 2006
  + * </p>
  + */
  +public class SSLMultiplexAsynchCallbackTestCase extends TestDriver
  +{
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(SSLMultiplexAsynchCallbackTestClient.class.getName(),
  +                     1,
  +                     SSLMultiplexAsynchCallbackTestServer.class.getName());
  +   }
  +
  +   /**
  +    * How long to wait for test results to be returned from the client(s).  If goes longer than the
  +    * specified limit, will throw an exception and kill the running test cases.  Default value is
  +    * RESULTS_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getResultsTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long for the server test case to wait for tear down message.  If exceeds timeout,
  +    * will throw exception.  The default value is TEARDOWN_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getTearDownTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +   /**
  +    * How long to allow each of the test cases to run their tests.  If exceeds this timeout
  +    * will throw exception and kill tests.  The default value is RUN_TEST_TIMEOUT.
  +    *
  +    * @return
  +    */
  +   protected long getRunTestTimeout()
  +   {
  +      return 600000;
  +   }
  +
  +}
  \ No newline at end of file
  
  
  
  1.2       +171 -0    JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestClientRoot.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsynchCallbackTestClientRoot.java
  ===================================================================
  RCS file: AsynchCallbackTestClientRoot.java
  diff -N AsynchCallbackTestClientRoot.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ AsynchCallbackTestClientRoot.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,171 @@
  +/*
  +* 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.callback.asynch;
  +
  +import java.net.InetAddress;
  +import java.util.HashMap;
  +import java.util.Map;
  +
  +import junit.framework.TestCase;
  +
  +import org.jboss.logging.Logger;
  +import org.jboss.remoting.Client;
  +import org.jboss.remoting.InvokerLocator;
  +import org.jboss.remoting.callback.Callback;
  +import org.jboss.remoting.callback.HandleCallbackException;
  +import org.jboss.remoting.callback.InvokerCallbackHandler;
  +
  +/** 
  + * AsynchCallbackTestClientRoot and AsynchCallbackTestServerRoot are the parent classes
  + * for a set of transport specific tests of the asynchronous callback facility.
  + * 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Nov 25, 2006
  + * </p>
  + */
  +public abstract class AsynchCallbackTestClientRoot extends TestCase
  +{
  +   private static Logger log = Logger.getLogger(AsynchCallbackTestClientRoot.class);
  +
  +   
  +   public void testSynchronousCallback() throws Throwable
  +   {
  +      String transport = getTransport();
  +      String host = InetAddress.getLocalHost().getHostName();
  +      int port = AsynchCallbackTestServerRoot.port;
  +      String locatorURI = transport + "://" + host + ":" + port; 
  +      InvokerLocator serverLocator = new InvokerLocator(locatorURI);
  +      log.info("Connecting to: " + serverLocator);
  +      HashMap config = new HashMap();
  +      addTransportSpecificConfig(config);
  +      Client client = new Client(serverLocator, config);
  +      client.connect();
  +      log.info("client is connected");
  +      SampleCallbackHandler callbackHandler = new SampleCallbackHandler();
  +      client.addListener(callbackHandler, null, null, true);
  +      log.info("client added callback handler");
  +      client.invokeOneway(AsynchCallbackTestServerRoot.SYNCHRONOUS_TEST);
  +      Thread.sleep(1000);
  +      // Should still be waiting on client.
  +      Boolean done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
  +      log.info("done 1: " + done);
  +      assertFalse(done.booleanValue());
  +      Thread.sleep(2000);
  +      done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
  +      log.info("done 2: " + done);
  +      assertTrue(done.booleanValue());
  +      assertTrue(callbackHandler.receivedCallback);
  +      client.invoke(AsynchCallbackTestServerRoot.RESET);
  +      client.removeListener(callbackHandler);
  +      log.info("disconnecting");
  +      client.disconnect();
  +      log.info("disconnected");
  +   }
  +   
  +   
  +   public void testASynchronousCallbackClientSide() throws Throwable
  +   {
  +      String transport = getTransport();
  +      String host = InetAddress.getLocalHost().getHostName();
  +      int port = AsynchCallbackTestServerRoot.port;
  +      String locatorURI = transport + "://" + host + ":" + port; 
  +      InvokerLocator serverLocator = new InvokerLocator(locatorURI);
  +      log.info("Connecting to: " + serverLocator);
  +      HashMap config = new HashMap();
  +      addTransportSpecificConfig(config);
  +      Client client = new Client(serverLocator, config);
  +      client.connect();
  +      log.info("client is connected");
  +      SampleCallbackHandler callbackHandler = new SampleCallbackHandler();
  +      client.addListener(callbackHandler, null, null, true);
  +      log.info("client added callback handler");
  +      client.invokeOneway(AsynchCallbackTestServerRoot.ASYNCHRONOUS_CLIENT_SIDE_TEST);
  +      Thread.sleep(500);
  +      // Should have returned.
  +      Boolean done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
  +      assertTrue(done.booleanValue());
  +      assertTrue(callbackHandler.receivedCallback);
  +      client.invoke(AsynchCallbackTestServerRoot.RESET);
  +      client.removeListener(callbackHandler);
  +      client.disconnect();
  +   }
  +   
  +   
  +   public void testASynchronousCallbackServerSide() throws Throwable
  +   {
  +      String transport = getTransport();
  +      String host = InetAddress.getLocalHost().getHostName();
  +      int port = AsynchCallbackTestServerRoot.port;
  +      String locatorURI = transport + "://" + host + ":" + port; 
  +      InvokerLocator serverLocator = new InvokerLocator(locatorURI);
  +      log.info("Connecting to: " + serverLocator);
  +      HashMap config = new HashMap();
  +      addTransportSpecificConfig(config);
  +      Client client = new Client(serverLocator, config);
  +      client.connect();
  +      log.info("client is connected");
  +      SampleCallbackHandler callbackHandler = new SampleCallbackHandler();
  +      client.addListener(callbackHandler, null, null, true);
  +      log.info("client added callback handler");
  +      client.invokeOneway(AsynchCallbackTestServerRoot.ASYNCHRONOUS_SERVER_SIDE_TEST);
  +      Thread.sleep(500);
  +      // Should have returned.
  +      Boolean done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
  +      assertTrue(done.booleanValue());
  +      assertTrue(callbackHandler.receivedCallback);
  +      String threadCount = (String) client.invoke(AsynchCallbackTestServerRoot.GET_THREAD_COUNT);
  +      assertEquals(AsynchCallbackTestServerRoot.THREAD_COUNT, threadCount);
  +      String queueSize = (String) client.invoke(AsynchCallbackTestServerRoot.GET_QUEUE_SIZE);
  +      assertEquals(AsynchCallbackTestServerRoot.QUEUE_SIZE, queueSize);
  +      client.invoke(AsynchCallbackTestServerRoot.RESET);
  +      client.removeListener(callbackHandler);
  +      client.disconnect();
  +   }
  +   
  +   
  +   protected abstract String getTransport();
  +   
  +   
  +   protected void addTransportSpecificConfig(Map config)
  +   {
  +   }
  +   
  +   static class SampleCallbackHandler implements InvokerCallbackHandler
  +   {
  +      boolean receivedCallback;
  +      
  +      public void handleCallback(Callback callback) throws HandleCallbackException
  +      {
  +         log.info("received callback");
  +         receivedCallback = true;
  +         try
  +         {
  +            Thread.sleep(2000);
  +         }
  +         catch (InterruptedException e)
  +         {
  +         }
  +      }
  +   }
  +}
  
  
  
  1.2       +52 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/SSLAsynchCallbackTestClientRoot.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SSLAsynchCallbackTestClientRoot.java
  ===================================================================
  RCS file: SSLAsynchCallbackTestClientRoot.java
  diff -N SSLAsynchCallbackTestClientRoot.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SSLAsynchCallbackTestClientRoot.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,52 @@
  +/*
  +* 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.callback.asynch;
  +
  +import java.util.Map;
  +
  +import org.jboss.remoting.security.SSLSocketBuilder;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public abstract class SSLAsynchCallbackTestClientRoot extends AsynchCallbackTestClientRoot
  +{  
  +   protected void addTransportSpecificConfig(Map config)
  +   {
  +      config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
  +      String trustStoreFilePath = this.getClass().getResource("truststore").getFile();
  +      config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH, trustStoreFilePath);
  +      config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD, "unit-tests-client");  
  +      
  +      config.put(SSLSocketBuilder.REMOTING_KEY_STORE_TYPE, "JKS");
  +      String keyStoreFilePath = this.getClass().getResource("keystore").getFile();
  +      config.put(SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH, keyStoreFilePath);
  +      config.put(SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD, "unit-tests-server"); 
  +      
  +      config.put(SSLSocketBuilder.REMOTING_SERVER_SOCKET_USE_CLIENT_MODE, "true");
  +      config.put(SSLSocketBuilder.REMOTING_SOCKET_USE_CLIENT_MODE, "true");
  +   }
  +}
  
  
  
  1.2       +47 -0     JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/BisocketAsynchCallbackTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BisocketAsynchCallbackTestClient.java
  ===================================================================
  RCS file: BisocketAsynchCallbackTestClient.java
  diff -N BisocketAsynchCallbackTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ BisocketAsynchCallbackTestClient.java	4 Feb 2007 08:05:53 -0000	1.2
  @@ -0,0 +1,47 @@
  +/*
  +* 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.callback.asynch;
  +
  +import java.util.Map;
  +
  +import org.jboss.remoting.transport.bisocket.Bisocket;
  +
  +/** 
  + * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  + * @version $Revision: 1.2 $
  + * <p>
  + * Copyright Feb 3, 2007
  + * </p>
  + */
  +public class BisocketAsynchCallbackTestClient extends AsynchCallbackTestClientRoot
  +{
  +   protected void addTransportSpecificConfig(Map config)
  +   {
  +      super.addTransportSpecificConfig(config);
  +      config.put(Bisocket.IS_CALLBACK_SERVER, "true");
  +   }
  +   
  +   protected String getTransport()
  +   {
  +      return "bisocket";
  +   }
  +}
  
  
  



More information about the jboss-cvs-commits mailing list