// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static void closeJadler() {
//     final StubHttpServerManager serverManager = jadlerMockerContainer.get();
//     if (serverManager != null && serverManager.isStarted()) {
//         serverManager.close();
//     }
// 
//     jadlerMockerContainer.set(null);
// }
// 
// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static RequestStubbing onRequest() {
//     checkInitialized();
//     return jadlerMockerContainer.get().onRequest();
// }
// 
// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static void resetJadler() {
//     final JadlerMocker mocker = jadlerMockerContainer.get();
//     if (mocker != null) {
//         mocker.reset();
//     }
// }
// 
// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static Verifying verifyThatRequest() {
//     checkInitialized();
//     return jadlerMockerContainer.get().verifyThatRequest();
// }
// 
// Path: jadler-all/src/test/java/net/jadler/utils/TestUtils.java
// public static final StatusRetriever STATUS_RETRIEVER = new StatusRetriever();
// 
// Path: jadler-all/src/test/java/net/jadler/utils/TestUtils.java
// public static String jadlerUri() {
//     return "http://localhost:" + port();
// }


import org.apache.http.client.fluent.Executor;
import org.apache.http.client.fluent.Request;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Test;
import java.io.IOException;
import static net.jadler.Jadler.closeJadler;
import static net.jadler.Jadler.onRequest;
import static net.jadler.Jadler.resetJadler;
import static net.jadler.Jadler.verifyThatRequest;
import static net.jadler.utils.TestUtils.STATUS_RETRIEVER;
import static net.jadler.utils.TestUtils.jadlerUri;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
/*
 * Copyright (c) 2012 - 2016 Jadler contributors
 * This program is made available under the terms of the MIT License.
 */
package net.jadler;





/**
 * <p>Tests the alternative reset scenario. The stub server is started and stopped only once (before and after the
 * whole suite) and reset after every test.</p>
 *
 * <p>Please note this test class is abstract. The particular extensions must provide their own {@code BeforeClass}
 * method which initializes Jadler using the desired stub server and instructing it to use {@link #DEFAULT_STATUS} as
 * a default response status.</p>
 *
 * @see JdkResetIntegrationTest
 * @see JettyResetIntegrationTest
 */
public abstract class AbstractResetIntegrationTest {

    protected static final int DEFAULT_STATUS = 409;

    /**
     * Shutdown Jadler after the whole test suite
     */
    @AfterClass
    public static void close() {
        closeJadler();
        Executor.closeIdleConnections();
    }


    /**
     * Reset Jadler after each test
     *
     * @see Jadler#resetJadler()
     */
    @After
    public void reset() {
// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static void closeJadler() {
//     final StubHttpServerManager serverManager = jadlerMockerContainer.get();
//     if (serverManager != null && serverManager.isStarted()) {
//         serverManager.close();
//     }
// 
//     jadlerMockerContainer.set(null);
// }
// 
// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static RequestStubbing onRequest() {
//     checkInitialized();
//     return jadlerMockerContainer.get().onRequest();
// }
// 
// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static void resetJadler() {
//     final JadlerMocker mocker = jadlerMockerContainer.get();
//     if (mocker != null) {
//         mocker.reset();
//     }
// }
// 
// Path: jadler-core/src/main/java/net/jadler/Jadler.java
// public static Verifying verifyThatRequest() {
//     checkInitialized();
//     return jadlerMockerContainer.get().verifyThatRequest();
// }
// 
// Path: jadler-all/src/test/java/net/jadler/utils/TestUtils.java
// public static final StatusRetriever STATUS_RETRIEVER = new StatusRetriever();
// 
// Path: jadler-all/src/test/java/net/jadler/utils/TestUtils.java
// public static String jadlerUri() {
//     return "http://localhost:" + port();
// }


// Path: jadler-all/src/test/java/net/jadler/AbstractResetIntegrationTest.java
import org.apache.http.client.fluent.Executor;
import org.apache.http.client.fluent.Request;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Test;
import java.io.IOException;
import static net.jadler.Jadler.closeJadler;
import static net.jadler.Jadler.onRequest;
import static net.jadler.Jadler.resetJadler;
import static net.jadler.Jadler.verifyThatRequest;
import static net.jadler.utils.TestUtils.STATUS_RETRIEVER;
import static net.jadler.utils.TestUtils.jadlerUri;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

/*
 * Copyright (c) 2012 - 2016 Jadler contributors
 * This program is made available under the terms of the MIT License.
 */
package net.jadler;





/**
 * <p>Tests the alternative reset scenario. The stub server is started and stopped only once (before and after the
 * whole suite) and reset after every test.</p>
 *
 * <p>Please note this test class is abstract. The particular extensions must provide their own {@code BeforeClass}
 * method which initializes Jadler using the desired stub server and instructing it to use {@link #DEFAULT_STATUS} as
 * a default response status.</p>
 *
 * @see JdkResetIntegrationTest
 * @see JettyResetIntegrationTest
 */
public abstract class AbstractResetIntegrationTest {

    protected static final int DEFAULT_STATUS = 409;

    /**
     * Shutdown Jadler after the whole test suite
     */
    @AfterClass
    public static void close() {
        closeJadler();
        Executor.closeIdleConnections();
    }


    /**
     * Reset Jadler after each test
     *
     * @see Jadler#resetJadler()
     */
    @After
    public void reset() {
        resetJadler();