[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/configuration/client/remote ...

Ovidiu Feodorov ovidiu.feodorov at jboss.com
Sat Jan 20 20:24:52 EST 2007


  User: ovidiu  
  Date: 07/01/20 20:24:52

  Added:       src/tests/org/jboss/test/remoting/configuration/client/remote   
                        Tag: remoting_2_x ClientPingCountTestCase.java
                        ClientPingCountTestClient.java
                        ClientPingCountTestServer.java
  Log:
  http://jira.jboss.org/jira/browse/JBREM-679
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +43 -0     JBossRemoting/src/tests/org/jboss/test/remoting/configuration/client/remote/Attic/ClientPingCountTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ClientPingCountTestCase.java
  ===================================================================
  RCS file: ClientPingCountTestCase.java
  diff -N ClientPingCountTestCase.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ ClientPingCountTestCase.java	21 Jan 2007 01:24:52 -0000	1.1.2.1
  @@ -0,0 +1,43 @@
  +/**
  + * JBoss, Home of Professional Open Source
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
  +package org.jboss.test.remoting.configuration.client.remote;
  +
  +import org.jboss.jrunit.harness.TestDriver;
  +
  +/**
  + * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  + * @version <tt>$Revision: 1.1.2.1 $</tt>
  + * $Id: ClientPingCountTestCase.java,v 1.1.2.1 2007/01/21 01:24:52 ovidiu Exp $
  + */
  +public class ClientPingCountTestCase extends TestDriver
  +{
  +   // Constants ------------------------------------------------------------------------------------
  +
  +   // Static ---------------------------------------------------------------------------------------
  +
  +   // Attributes -----------------------------------------------------------------------------------
  +
  +   // Constructors ---------------------------------------------------------------------------------
  +
  +   // TestDriver overrides -------------------------------------------------------------------------
  +
  +   public void declareTestClasses()
  +   {
  +      addTestClasses(ClientPingCountTestClient.class.getName(), 1,
  +                     ClientPingCountTestServer.class.getName());
  +   }
  +
  +   // Public ---------------------------------------------------------------------------------------
  +
  +   // Package protected ----------------------------------------------------------------------------
  +
  +   // Protected ------------------------------------------------------------------------------------
  +
  +   // Private --------------------------------------------------------------------------------------
  +
  +   // Inner classes --------------------------------------------------------------------------------
  +}
  
  
  
  1.1.2.1   +84 -0     JBossRemoting/src/tests/org/jboss/test/remoting/configuration/client/remote/Attic/ClientPingCountTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ClientPingCountTestClient.java
  ===================================================================
  RCS file: ClientPingCountTestClient.java
  diff -N ClientPingCountTestClient.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ ClientPingCountTestClient.java	21 Jan 2007 01:24:52 -0000	1.1.2.1
  @@ -0,0 +1,84 @@
  +/**
  + * JBoss, Home of Professional Open Source
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
  +package org.jboss.test.remoting.configuration.client.remote;
  +
  +import junit.framework.TestCase;
  +import org.jboss.remoting.Client;
  +import org.jboss.remoting.InvokerLocator;
  +import org.jboss.remoting.ConnectionListener;
  +import org.jboss.remoting.ConnectionValidator;
  +
  +/**
  + * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  + * @version <tt>$Revision: 1.1.2.1 $</tt>
  + * $Id: ClientPingCountTestClient.java,v 1.1.2.1 2007/01/21 01:24:52 ovidiu Exp $
  + */
  +public class ClientPingCountTestClient extends TestCase
  +{
  +   // Constants ------------------------------------------------------------------------------------
  +
  +   // Static ---------------------------------------------------------------------------------------
  +
  +   // Attributes -----------------------------------------------------------------------------------
  +
  +   // Constructors ---------------------------------------------------------------------------------
  +
  +   // Public ---------------------------------------------------------------------------------------
  +
  +   public void testGetPingPeriodOnDisconnectedClient() throws Throwable
  +   {
  +      Client client = new Client(new InvokerLocator(ClientPingCountTestServer.locatorURI));
  +
  +      assertEquals(-1, client.getPingPeriod());
  +   }
  +
  +   public void testGetPingPeriodOnConnectedClient() throws Throwable
  +   {
  +      Client client = new Client(new InvokerLocator(ClientPingCountTestServer.locatorURI));
  +
  +      client.connect();
  +
  +      assertEquals(-1, client.getPingPeriod());
  +   }
  +
  +   public void testGetPingPeriodOnClientWithListener() throws Throwable
  +   {
  +      Client client = new Client(new InvokerLocator(ClientPingCountTestServer.locatorURI));
  +
  +      client.connect();
  +
  +      client.addConnectionListener(new ConnectionListener()
  +      {
  +         public void handleConnectionException(Throwable throwable, Client client) {}
  +      });
  +
  +      assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, client.getPingPeriod());
  +   }
  +
  +   public void testGetPingPeriodOnClientWithListener2() throws Throwable
  +   {
  +      Client client = new Client(new InvokerLocator(ClientPingCountTestServer.locatorURI));
  +
  +      client.connect();
  +
  +      client.addConnectionListener(new ConnectionListener()
  +      {
  +         public void handleConnectionException(Throwable throwable, Client client) {}
  +      }, 7865);
  +
  +      assertEquals(7865, client.getPingPeriod());
  +   }
  +
  +
  +   // Package protected ----------------------------------------------------------------------------
  +
  +   // Protected ------------------------------------------------------------------------------------
  +
  +   // Private --------------------------------------------------------------------------------------
  +
  +   // Inner classes --------------------------------------------------------------------------------
  +}
  
  
  
  1.1.2.1   +60 -0     JBossRemoting/src/tests/org/jboss/test/remoting/configuration/client/remote/Attic/ClientPingCountTestServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ClientPingCountTestServer.java
  ===================================================================
  RCS file: ClientPingCountTestServer.java
  diff -N ClientPingCountTestServer.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ ClientPingCountTestServer.java	21 Jan 2007 01:24:52 -0000	1.1.2.1
  @@ -0,0 +1,60 @@
  +/**
  + * JBoss, Home of Professional Open Source
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
  +package org.jboss.test.remoting.configuration.client.remote;
  +
  +import org.jboss.jrunit.extensions.ServerTestCase;
  +import org.jboss.remoting.transport.Connector;
  +
  +/**
  + * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  + * @version <tt>$Revision: 1.1.2.1 $</tt>
  + * $Id: ClientPingCountTestServer.java,v 1.1.2.1 2007/01/21 01:24:52 ovidiu Exp $
  + */
  +public class ClientPingCountTestServer extends ServerTestCase
  +{
  +   // Constants ------------------------------------------------------------------------------------
  +
  +   public static String locatorURI = "socket://localhost:9999";
  +
  +   // Static ---------------------------------------------------------------------------------------
  +
  +   // Attributes -----------------------------------------------------------------------------------
  +
  +   private Connector connector;
  +
  +   // Constructors ---------------------------------------------------------------------------------
  +
  +   // Public ---------------------------------------------------------------------------------------
  +
  +   // Package protected ----------------------------------------------------------------------------
  +
  +   // Protected ------------------------------------------------------------------------------------
  +
  +   protected void setUp() throws Exception
  +   {
  +      connector = new Connector(locatorURI);
  +      connector.create();
  +      connector.start();
  +
  +      super.setUp();
  +   }
  +
  +   protected void tearDown() throws Exception
  +   {
  +      if(connector != null)
  +      {
  +         connector.stop();
  +         connector.destroy();
  +      }
  +
  +      super.tearDown();
  +   }
  +
  +   // Private --------------------------------------------------------------------------------------
  +
  +   // Inner classes --------------------------------------------------------------------------------
  +}
  
  
  



More information about the jboss-cvs-commits mailing list