Ejemplo n.º 1
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);
    }
  }
Ejemplo n.º 2
0
  /**
   * Tear down the test by {@link TestContainer#stop() stopping} the test container obtained from
   * the {@link #getTestContainerFactory() test container factory} and by {@link
   * javax.ws.rs.client.Client#close() closing} and discarding the {@link
   * #configureClient(org.glassfish.jersey.client.ClientConfig) pre-configured} test client that was
   * {@link #setUp() set up} for the test.
   *
   * @throws Exception if an exception is thrown during tearing down the test environment.
   */
  @After
  public void tearDown() throws Exception {
    if (isLogRecordingEnabled()) {
      unregisterLogHandler();
    }

    try {
      TestContainer oldContainer = setTestContainer(null);
      if (oldContainer != null) {
        oldContainer.stop();
      }
    } finally {
      closeIfNotNull(setClient(null));
    }
  }