[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/callback/pull/memory/callbackstore/jbossSerialization ...

Ron Sigal ron_sigal at yahoo.com
Wed Oct 11 22:55:51 EDT 2006


  User: rsigal  
  Date: 06/10/11 22:55:51

  Added:       src/tests/org/jboss/test/remoting/callback/pull/memory/callbackstore/jbossSerialization   
                        CallbackStoreCallbackTestCase.java
                        CallbackTestClient.java CallbackTestServer.java
  Log:
  JBREM-609:  Unit test for use of JBoss serialization by CallbackStore.
  
  Revision  Changes    Path
  1.1      date: 2006/10/12 02:55:51;  author: rsigal;  state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/callback/pull/memory/callbackstore/jbossSerialization/CallbackStoreCallbackTestCase.java
  
  Index: CallbackStoreCallbackTestCase.java
  ===================================================================
  /*
  * JBoss, Home of Professional Open Source
  * Copyright 2005, JBoss Inc., and individual contributors as indicated
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
  * This is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as
  * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
  
  package org.jboss.test.remoting.callback.pull.memory.callbackstore.jbossSerialization;
  
  import org.apache.log4j.Level;
  import org.jboss.jrunit.harness.TestDriver;
  
  /**
   * Tests use of JBoss serialization by CallbackStore.
   * 
   * @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
   * @author <a href="mailto:ron.sigal at jboss.com">Ron Sigal</a>
   */
  public class CallbackStoreCallbackTestCase extends TestDriver
  {
     public void declareTestClasses()
     {
        addTestClasses(CallbackTestClient.class.getName(),
                       1,
                       CallbackTestServer.class.getName());
     }
  
     protected Level getTestHarnessLogLevel()
     {
        return Level.DEBUG;
     }
  
     protected Level getTestLogLevel()
     {
        return Level.DEBUG;
     }
  
     /**
      * 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;
     }
  
  }
  
  
  1.1      date: 2006/10/12 02:55:51;  author: rsigal;  state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/callback/pull/memory/callbackstore/jbossSerialization/CallbackTestClient.java
  
  Index: CallbackTestClient.java
  ===================================================================
  /*
  * JBoss, Home of Professional Open Source
  * Copyright 2005, JBoss Inc., and individual contributors as indicated
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
  * This is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as
  * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
  
  package org.jboss.test.remoting.callback.pull.memory.callbackstore.jbossSerialization;
  
  import org.jboss.remoting.InvokerLocator;
  
  /**
   *
   * @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
   * @author <a href="mailto:ron.sigal at jboss.org">Ron Sigal</a>
   */
  public class CallbackTestClient extends org.jboss.test.remoting.callback.pull.memory.callbackstore.CallbackTestClient
  {
     protected String getInvokerLocatorURI()
     {
        String baseLocatorURI = super.getInvokerLocatorURI();
        if (baseLocatorURI.indexOf("/?") == -1)
           return baseLocatorURI + "/?" + InvokerLocator.SERIALIZATIONTYPE + "=jboss";
        else
           return baseLocatorURI + "&" + InvokerLocator.SERIALIZATIONTYPE + "=jboss";
     }
  
  }
  
  
  
  1.1      date: 2006/10/12 02:55:51;  author: rsigal;  state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/callback/pull/memory/callbackstore/jbossSerialization/CallbackTestServer.java
  
  Index: CallbackTestServer.java
  ===================================================================
  /*
  * JBoss, Home of Professional Open Source
  * Copyright 2005, JBoss Inc., and individual contributors as indicated
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
  * This is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as
  * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
  
  package org.jboss.test.remoting.callback.pull.memory.callbackstore.jbossSerialization;
  
  import org.jboss.remoting.InvokerLocator;
  
  /**
   * @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
   * @author <a href="mailto:ron.sigal at jboss.com">Ron Sigal</a>
   */
  public class CallbackTestServer
  extends org.jboss.test.remoting.callback.pull.memory.callbackstore.CallbackTestServer
  {
  
     protected String getInvokerLocatorURI()
     {
        String baseLocatorURI = super.getInvokerLocatorURI();
        if (baseLocatorURI.indexOf("/?") == -1)
           return baseLocatorURI + "/?" + InvokerLocator.SERIALIZATIONTYPE + "=jboss";
        else
           return baseLocatorURI + "&" + InvokerLocator.SERIALIZATIONTYPE + "=jboss";
     }
  
  
     public static void main(String[] args)
     {
        CallbackTestServer server = new CallbackTestServer();
        try
        {
           server.setUp();
           Thread.sleep(600000);
           server.tearDown();
        }
        catch(Exception e)
        {
           e.printStackTrace();
        }
     }
  }
  
  



More information about the jboss-cvs-commits mailing list