コード例 #1
0
  @AfterMethod
  public void cleanUp(Method method) throws InterruptedException {
    // A previous test didn't call onComplete on the processor, manual clean up
    if (driverManager.getCounter() > 0) {

      Thread.sleep(1000);

      if (driverManager.getCounter() > 0) {
        System.err.println(
            "Possibly method " + method.getName() + " didn't call onComplete on processor");

        for (AeronProcessor processor : processors) {
          processor.shutdown();
          TestSubscriber.await(5L, "processor didn't terminate", processor::isTerminated);
        }

        TestSubscriber.await(
            5L,
            "Embedded Media driver wasn't shutdown properly",
            () -> driverManager.getCounter() == 0);
      }
    }

    processors.clear();
  }
コード例 #2
0
  @BeforeClass
  public void doSetup() {
    AeronTestUtils.setAeronEnvProps();

    driverManager = EmbeddedMediaDriverManager.getInstance();
    driverManager.setShouldShutdownWhenNotUsed(false);
  }
コード例 #3
0
 @AfterClass
 public void doTeardown() throws InterruptedException {
   driverManager.shutdown();
   AeronTestUtils.awaitMediaDriverIsTerminated(10);
 }