CommandProcess { public void stop() { if ( status == CommandStatus.RUNNING ) { status = CommandStatus.TIMEOUT; } semaphore.release(); executor.shutdown(); } CommandProcess( final CommandProcessor commandProcessor, final CommandCallback callback, final Request request,
                    final String rhId, final Session userSession ); void stop();  }
@Test public void testStop() throws Exception { commandProcess.stop(); verify( semaphore ).release(); verify( executor ).shutdown(); commandProcess.status = CommandStatus.RUNNING; commandProcess.stop(); assertEquals( CommandStatus.TIMEOUT, commandProcess.status ); }