mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java
@Deprecated
    public boolean isRunning(int attempts, long timeout, TimeUnit timeUnit) {
        try {
            HttpResponse httpResponse = sendRequest(request().withMethod("PUT").withPath(calculatePath("status")));
            if (httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {
                return true;
            } else if (attempts <= 0) {
                return false;
            } else {
                try {
                    timeUnit.sleep(timeout);
                } catch (InterruptedException e) {
                    // ignore interrupted exception
                }
                return isRunning(attempts - 1, timeout, timeUnit);
            }
        } catch (SocketConnectionException | IllegalStateException sce) {
            MOCK_SERVER_LOGGER.logEvent(
                new LogEntry()
                    .setLogLevel(TRACE)
                    .setMessageFormat("exception while checking if MockServer is running - " + sce.getMessage() + " if MockServer was stopped this exception is expected")
                    .setThrowable(sce)
            );
            return false;
        }
    }
/**
     * Returns whether server MockServer is running, by polling the MockServer a configurable
     * amount of times.  If called too quickly after starting MockServer this may return false
     * because MockServer has not yet started, to ensure MockServer has started use hasStarted()
     *
     * @deprecated use hasStopped() or hasStarted() instead
     */
Returns whether server MockServer is running, by polling the MockServer a configurable
amount of times.  If called too quickly after starting MockServer this may return false
because MockServer has not yet started, to ensure MockServer has started use hasStarted()

@deprecated use hasStopped() or hasStarted() instead
Returns whether server MockServer is running by polling the MockServer a configurable amount of times . If called too quickly after starting MockServer this may return false because MockServer has not yet started to ensure MockServer has started use hasStarted () @deprecated use hasStopped () or hasStarted () instead
@Deprecated
    public boolean isRunning(int attempts, long timeout, TimeUnit timeUnit) {
        try {
            HttpResponse httpResponse = sendRequest(request().withMethod("PUT").withPath(calculatePath("status")));
            if (httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {
                return true;
            } else if (attempts <= 0) {
                return false;
            } else {
                try {
                    timeUnit.sleep(timeout);
                } catch (InterruptedException e) {
                }
                return isRunning(attempts - 1, timeout, timeUnit);
            }
        } catch (SocketConnectionException | IllegalStateException sce) {
            MOCK_SERVER_LOGGER.logEvent(
                new LogEntry()
                    .setLogLevel(TRACE)
                    .setMessageFormat("exception while checking if MockServer is running - " + sce.getMessage() + " if MockServer was stopped this exception is expected")
                    .setThrowable(sce)
            );
            return false;
        }
    }
@ Deprecated public boolean isRunning ( int attempts , long timeout , TimeUnit timeUnit ) { try { HttpResponse httpResponse = sendRequest ( request ( ) . withMethod ( "PUT" ) . withPath ( calculatePath ( "status" ) ) ) ; if ( httpResponse . getStatusCode ( ) == HttpStatusCode . OK_200 . code ( ) ) { return true ; } else if ( attempts <= 0 ) { return false ; } else { try { timeUnit . sleep ( timeout ) ; } catch ( InterruptedException e ) { } return isRunning ( attempts - 1 , timeout , timeUnit ) ; } } catch ( SocketConnectionException | IllegalStateException sce ) { MOCK_SERVER_LOGGER . logEvent ( new LogEntry ( ) . setLogLevel ( TRACE ) . setMessageFormat ( "exception while checking if MockServer is running - " + sce . getMessage ( ) + " if MockServer was stopped this exception is expected" ) . setThrowable ( sce ) ) ; return false ; } }
Returns whether server MockServer is running, by polling the MockServer a configurable
 amount of times.
Returns whether server MockServer is running by polling the MockServer a configurable amount of times .
// ignore interrupted exception