Esempio n. 1
0
  /**
   * Set up the test by invoking {@link TestContainer#start() } on the test container obtained from
   * the test container factory.
   *
   * @throws Exception if an exception is thrown during setting up the test environment.
   */
  @Before
  public void setUp() throws Exception {
    if (isLogRecordingEnabled()) {
      loggedRuntimeRecords.clear();
      registerLogHandler();
    }

    tc.start();
    Client old = client.getAndSet(getClient(tc, application));
    close(old);
  }
Esempio n. 2
0
  /**
   * Tear down the test by invoking {@link TestContainer#stop() } on the test container obtained
   * from the test container factory.
   *
   * @throws Exception if an exception is thrown during tearing down the test environment.
   */
  @After
  public void tearDown() throws Exception {
    if (isLogRecordingEnabled()) {
      loggedRuntimeRecords.clear();
      unregisterLogHandler();
    }

    try {
      tc.stop();
    } finally {
      Client old = client.getAndSet(null);
      close(old);
    }
  }