org.apache.wink.client
Class MockHttpServer
java.lang.Object
java.lang.Thread
org.apache.wink.client.MockHttpServer
- All Implemented Interfaces:
- java.lang.Runnable
public class MockHttpServer
- extends java.lang.Thread
Nested classes/interfaces inherited from class java.lang.Thread |
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MockHttpServer
public MockHttpServer(int serverPort)
MockHttpServer
public MockHttpServer(int serverPort,
boolean ssl)
startServer
public void startServer()
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
- Overrides:
run
in class java.lang.Thread
stopServer
public void stopServer()
setMockResponseHeaders
public void setMockResponseHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
setMockResponseHeader
public void setMockResponseHeader(java.lang.String name,
java.lang.String value)
setMockResponseCode
public void setMockResponseCode(int responseCode)
setMockResponseContent
public void setMockResponseContent(java.lang.String content)
setMockResponseContent
public void setMockResponseContent(byte[] content)
setMockResponseContentType
public void setMockResponseContentType(java.lang.String type)
setMockResponseContentEchoRequest
public void setMockResponseContentEchoRequest(boolean echo)
setReadTimeout
public void setReadTimeout(int milliseconds)
setDelayResponse
public void setDelayResponse(int milliseconds)
getRequestContentAsString
public java.lang.String getRequestContentAsString()
getRequestContent
public byte[] getRequestContent()
getRequestHeaders
public java.util.Map<java.lang.String,java.lang.String> getRequestHeaders()
getRequestMethod
public java.lang.String getRequestMethod()
getRequestUrl
public java.lang.String getRequestUrl()
main
public static void main(java.lang.String[] args)
setServerPort
public void setServerPort(int serverPort)
getServerPort
public int getServerPort()
Copyright © 2009 The Apache Software Foundation. All Rights Reserved.