Search in sources :

Example 1 with ShutdownTask

use of com.github.dreamhead.moco.bootstrap.tasks.ShutdownTask in project moco by dreamhead.

the class ShutdownMonitorRunnerTest method should_stop_runner_via_shutdown_task.

@Test(expected = HttpHostConnectException.class)
public void should_stop_runner_via_shutdown_task() throws IOException {
    runner.run();
    try {
        assertThat(helper.get(root()), is("foo"));
    } catch (HttpHostConnectException e) {
        fail(e.getMessage());
    }
    ShutdownTask task = new ShutdownTask(SHUTDOWN_MOCO_KEY);
    task.run(new String[] { "-s", Integer.toString(SHUTDOWN_PORT) });
    waitChangeHappens();
    helper.get(root());
}
Also used : HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) ShutdownTask(com.github.dreamhead.moco.bootstrap.tasks.ShutdownTask) Test(org.junit.Test)

Aggregations

ShutdownTask (com.github.dreamhead.moco.bootstrap.tasks.ShutdownTask)1 HttpHostConnectException (org.apache.http.conn.HttpHostConnectException)1 Test (org.junit.Test)1