Ejemplo n.º 1
0
 public void testNonBlockingConnectSucceeds() throws Exception {
   RoutedConnection rc = routedConnectionFactory.createRoutedConnection("127.0.0.1", LISTEN_PORT);
   StubGnetConnectObserver observer = new StubGnetConnectObserver();
   rc.initialize(observer);
   observer.waitForResponse(3000);
   assertFalse(observer.isShutdown());
   assertFalse(observer.isBadHandshake());
   assertFalse(observer.isNoGOK());
   assertTrue(observer.isConnect());
 }
Ejemplo n.º 2
0
 public void testNonBlockingBadHandshake() throws Exception {
   ACCEPTOR.getObserver().setBadHandshake(true);
   RoutedConnection rc =
       routedConnectionFactory.createRoutedConnection("127.0.0.1", LISTEN_PORT, ConnectType.PLAIN);
   StubGnetConnectObserver observer = new StubGnetConnectObserver();
   rc.initialize(observer);
   observer.waitForResponse(10000);
   assertFalse(observer.isShutdown());
   assertTrue(observer.isBadHandshake());
   assertFalse(observer.isConnect());
   assertFalse(observer.isNoGOK());
 }