Examples of MicroSocketClientInvoker


Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
      client.connect();
      log.info("client is connected");
     
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) client.getInvoker();
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
     
      for (int i = 0; i < 50; i++)
      {
         assertEquals(Integer.toString(i), (String) client.invoke(Integer.toString(i)));
      }
     
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
    
      disableServer(connector);
      shutdownServer();
      setupServer(port);
     
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
     
      for (int i = 0; i < 50; i++)
      {
         assertEquals(Integer.toString(i), (String) client.invoke(Integer.toString(i)));
      }
     
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
     
      client.disconnect();
      shutdownServer();
      log.info(getName() + " PASSES");
   }
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
      client.connect();
      log.info("client is connected");
     
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) client.getInvoker();
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
     
      try
      {
         log.info(client.invoke("abc"));
         fail("expected exception");
      }
      catch (Exception e)
      {
         log.info("got expected exception");
      }
     
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
     
      client.disconnect();
      shutdownServer();
      log.info(getName() + " PASSES");
   }
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
      client.connect();
      log.info("client is connected");
     
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) client.getInvoker();
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
     
      try
      {
         log.info(client.invoke("abc"));
         fail("expected exception");
      }
      catch (Exception e)
      {
         log.info("got expected exception: " + e, e);
      }
     
      assertEquals(10, clientInvoker.getNumberOfAvailableConnections());
     
      client.disconnect();
      shutdownServer();
      log.info(getName() + " PASSES");
   }
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

     
      // Verify there are two connection pools.
      Field field = MicroSocketClientInvoker.class.getDeclaredField("connectionPools");
      field.setAccessible(true);
      Map connectionPools = (Map) field.get(null);
      MicroSocketClientInvoker invoker = (MicroSocketClientInvoker) client1.getInvoker();
      assertEquals(2, connectionPools.size());
     
      // Verify client invoker 2's pool has one connection.
      field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

     
      Iterator it = invocationHandler.callbackHandlers.iterator();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient = serverInvokerCallbackHandler.getCallbackClient();
      assertTrue(callbackClient.getInvoker() instanceof BisocketClientInvoker);
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) callbackClient.getInvoker();
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
      List pool = (List) field.get(clientInvoker);
      field = MicroSocketClientInvoker.class.getDeclaredField("usedPooled");
      field.setAccessible(true);
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

     
      Iterator it = invocationHandler.callbackHandlers.iterator();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient = serverInvokerCallbackHandler.getCallbackClient();
      assertTrue(callbackClient.getInvoker() instanceof BisocketClientInvoker);
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) callbackClient.getInvoker();
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
      List pool = (List) field.get(clientInvoker);
      field = MicroSocketClientInvoker.class.getDeclaredField("usedPooled");
      field.setAccessible(true);
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

      ServerInvokerCallbackHandler serverInvokerCallbackHandler2 = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient1 = serverInvokerCallbackHandler1.getCallbackClient();
      Client callbackClient2 = serverInvokerCallbackHandler2.getCallbackClient();
      assertNotSame(callbackClient1, callbackClient2);
      assertTrue(callbackClient1.getInvoker() instanceof BisocketClientInvoker);
      MicroSocketClientInvoker clientInvoker1 = (MicroSocketClientInvoker) callbackClient1.getInvoker();
      assertTrue(callbackClient2.getInvoker() instanceof BisocketClientInvoker);
      MicroSocketClientInvoker clientInvoker2 = (MicroSocketClientInvoker) callbackClient2.getInvoker();
    
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
      List pool1 = (List) field.get(clientInvoker1);
      List pool2 = (List) field.get(clientInvoker2);
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

      assertEquals(1, callbackHandlers.size());
      ServerInvokerCallbackHandler serverInvokerCallbackHandler;
      serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) callbackHandlers.values().toArray()[0];
      Client callbackClient = serverInvokerCallbackHandler.getCallbackClient();
      assertTrue(callbackClient.getInvoker() instanceof BisocketClientInvoker);
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) callbackClient.getInvoker();
      field = BisocketClientInvoker.class.getDeclaredField("controlSocket");
      field.setAccessible(true);
      Socket controlSocket = (Socket) field.get(clientInvoker);
      controlSocket.close();
      log.info("CLOSED CONTROL SOCKET");
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

     
      Iterator it = invocationHandler.callbackHandlers.iterator();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient = serverInvokerCallbackHandler.getCallbackClient();
      assertTrue(callbackClient.getInvoker() instanceof BisocketClientInvoker);
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) callbackClient.getInvoker();
      Field field = BisocketClientInvoker.class.getDeclaredField("controlSocket");
      field.setAccessible(true);
      Socket controlSocketBefore = (Socket) field.get(clientInvoker);

      Thread.sleep(4 * TEST_PING_FREQUENCY);
 
View Full Code Here

Examples of org.jboss.remoting.transport.socket.MicroSocketClientInvoker

     
      Iterator it = invocationHandler.callbackHandlers.iterator();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient = serverInvokerCallbackHandler.getCallbackClient();
      assertTrue(callbackClient.getInvoker() instanceof BisocketClientInvoker);
      MicroSocketClientInvoker clientInvoker = (MicroSocketClientInvoker) callbackClient.getInvoker();
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
      List pool = (List) field.get(clientInvoker);
      field = MicroSocketClientInvoker.class.getDeclaredField("usedPooled");
      field.setAccessible(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.