Package org.jboss.remoting

Examples of org.jboss.remoting.ConnectionValidator$ConnectionCheckThread


      client.addConnectionListener(listener, metadata);
     
      // Test pingPeriod.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator validator = (ConnectionValidator) field.get(client);
      field = ConnectionValidator.class.getDeclaredField("pingPeriod");
      field.setAccessible(true);
      long pingPeriod = ((Long) field.get(validator)).longValue();
      assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, pingPeriod);
     
View Full Code Here


      client.addConnectionListener(listener, metadata);
     
      // Test pingPeriod.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator validator = (ConnectionValidator) field.get(client);
      field = ConnectionValidator.class.getDeclaredField("pingPeriod");
      field.setAccessible(true);
      long pingPeriod = ((Long) field.get(validator)).longValue();
      assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, pingPeriod);
     
View Full Code Here

      client.addConnectionListener(listener, metadata);
     
      // Test pingPeriod.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator validator = (ConnectionValidator) field.get(client);
      field = ConnectionValidator.class.getDeclaredField("pingPeriod");
      field.setAccessible(true);
      long pingPeriod = ((Long) field.get(validator)).longValue();
      assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, pingPeriod);
     
View Full Code Here

      client.addConnectionListener(listener, metadata);
     
      // Test pingPeriod.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator validator = (ConnectionValidator) field.get(client);
      field = ConnectionValidator.class.getDeclaredField("pingPeriod");
      field.setAccessible(true);
      long pingPeriod = ((Long) field.get(validator)).longValue();
      assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, pingPeriod);
     
View Full Code Here

      client.addConnectionListener(listener, metadata);
     
      // Test pingPeriod.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator validator = (ConnectionValidator) field.get(client);
      field = ConnectionValidator.class.getDeclaredField("pingPeriod");
      field.setAccessible(true);
      long pingPeriod = ((Long) field.get(validator)).longValue();
      assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, pingPeriod);
     
View Full Code Here

      log.info("connections are good");
     
      // Verify Clients share ConnectionValidator.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator connectionValidator1 = (ConnectionValidator) field.get(client1);
      ConnectionValidator connectionValidator2 = (ConnectionValidator) field.get(client2);
      assertSame(connectionValidator1, connectionValidator2);
     
      // Test client side connection failure notifications.
      int wait = (PING_PERIODS_TO_WAIT + 1) * VALIDATOR_PING_PERIOD + VALIDATOR_PING_TIMEOUT + 2000;
      log.info(getName() + " going to sleep for " + wait + " ms");
View Full Code Here

      log.info("connections are good");
     
      // Verify Clients have distinct ConnectionValidators.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator connectionValidator1 = (ConnectionValidator) field.get(client1);
      ConnectionValidator connectionValidator2 = (ConnectionValidator) field.get(client2);
      assertNotSame(connectionValidator1, connectionValidator2);
     
      // Test client side connection failure notifications.
      int wait = (PING_PERIODS_TO_WAIT + 1) * VALIDATOR_PING_PERIOD + VALIDATOR_PING_TIMEOUT + 2000;
      log.info(getName() + " going to sleep for " + wait + " ms");
View Full Code Here

      log.info("connections are good");
     
      // Verify Clients have distinct ConnectionValidators.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator connectionValidator1 = (ConnectionValidator) field.get(client1);
      ConnectionValidator connectionValidator2 = (ConnectionValidator) field.get(client2);
      assertNotSame(connectionValidator1, connectionValidator2);
     
      // Test client side connection failure notifications.
      int wait = (PING_PERIODS_TO_WAIT + 1) * VALIDATOR_PING_PERIOD + VALIDATOR_PING_TIMEOUT + 2000;
      log.info(getName() + " going to sleep for " + wait + " ms");
View Full Code Here

public class ConnectionValidatorTestCase extends TestCase
{

   public void testShouldDisallowDirectRun()
   {
      ConnectionValidator cv = new ConnectionValidator(new Client() {
         public Map getConfiguration()
         {
            return new HashMap();
         }

         public ClientInvoker getInvoker()
         {
            try
            {
               return new MicroRemoteClientInvoker(
                     new InvokerLocator("http://dummy:65535/dummy/")) {

                  public String getSessionId()
                  {
                     return "dummyId";
                  }

                  protected String getDefaultDataType()
                  {
                     throw new UnsupportedOperationException();
                  }

                  protected void handleConnect() throws ConnectionFailedException
                  {
                     throw new UnsupportedOperationException();
                  }

                  protected void handleDisconnect()
                  {
                     throw new UnsupportedOperationException();
                  }

                  protected Object transport(String sessionId, Object invocation, Map metadata, Marshaller marshaller,
                        UnMarshaller unmarshaller) throws IOException, ConnectionFailedException, ClassNotFoundException
                  {
                     throw new UnsupportedOperationException();
                  }
               };
            }
            catch (MalformedURLException e)
            {
               throw new RuntimeException(e);
            }
         }
      });

      try
      {
         cv.run();
         fail("Should throw IllegalStateException");
      } catch (IllegalStateException e) {
         // Expected
      }
   }
View Full Code Here

      client.addConnectionListener(listener);
     
      // Test pingPeriod.
      Field field = Client.class.getDeclaredField("connectionValidator");
      field.setAccessible(true);
      ConnectionValidator validator = (ConnectionValidator) field.get(client);
      field = ConnectionValidator.class.getDeclaredField("pingPeriod");
      field.setAccessible(true);
      long pingPeriod = ((Long) field.get(validator)).longValue();
      assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, pingPeriod);
     
View Full Code Here

TOP

Related Classes of org.jboss.remoting.ConnectionValidator$ConnectionCheckThread

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.