Esempio n. 1
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));
    }
  }