public void testDialogFailover() throws Exception {

    balancer = new Balancer(IP_ADDRESS, BALANCER_PORT);

    balancer.start();

    shootist = new Shootist(true);

    shootme = new Shootme("shootme", 5070, true);

    shootmeRecoveryNode = new Shootme("shootme_recovery", 5080, true);

    shootme.init();
    shootmeRecoveryNode.init();

    Thread.sleep(5000);

    shootist.init();

    Thread.sleep(10000);

    shootist.stop();
    shootmeRecoveryNode.stop();
    //      shootme.stop();
    stopSipStack(balancer.sipStack, balancer);

    assertTrue(shootist.okToByeReceived);
  }
Пример #2
0
  public void tearDown() {
    try {
      Thread.sleep(12000);

      this.shootist.checkState();

      int ackCount = 0;

      for (Shootme shootme : this.shootme) {
        shootme.checkState();

        if (shootme.isAckSeen()) {
          ackCount++;
        }
      }

      assertEquals("ACK count must be exactly 2", 2, ackCount);

      this.shootist.stop();

      for (Shootme shootme : this.shootme) {

        shootme.stop();
      }

      this.proxy.stop();
    } catch (Exception ex) {
      ex.printStackTrace();
      logger.error("unexpected exception", ex);
      fail("unexpected exception ");
    }
  }