org.apache.wink.client
Class MockHttpServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.wink.client.MockHttpServer
All Implemented Interfaces:
Runnable

public class MockHttpServer
extends Thread


Nested Class Summary
static class MockHttpServer.MockHttpServerResponse
           
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MockHttpServer(int serverPort)
           
MockHttpServer(int serverPort, boolean ssl)
           
 
Method Summary
 List<MockHttpServer.MockHttpServerResponse> getMockHttpServerResponses()
           
 byte[] getRequestContent()
           
 String getRequestContentAsString()
           
 Map<String,List<String>> getRequestHeaders()
           
 String getRequestMethod()
           
 String getRequestUrl()
           
 int getServerPort()
           
static void main(String[] args)
           
 void run()
           
 void setDelayResponse(int milliseconds)
           
 void setMockHttpServerResponses(MockHttpServer.MockHttpServerResponse... responses)
           
 void setReadTimeout(int milliseconds)
           
 void setServerPort(int serverPort)
           
 void startServer()
           
 void stopServer()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockHttpServer

public MockHttpServer(int serverPort)

MockHttpServer

public MockHttpServer(int serverPort,
                      boolean ssl)
Method Detail

startServer

public void startServer()

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

stopServer

public void stopServer()

setReadTimeout

public void setReadTimeout(int milliseconds)

setDelayResponse

public void setDelayResponse(int milliseconds)

getRequestContentAsString

public String getRequestContentAsString()

getRequestContent

public byte[] getRequestContent()

getRequestHeaders

public Map<String,List<String>> getRequestHeaders()

getRequestMethod

public String getRequestMethod()

getRequestUrl

public String getRequestUrl()

main

public static void main(String[] args)

setMockHttpServerResponses

public void setMockHttpServerResponses(MockHttpServer.MockHttpServerResponse... responses)

getMockHttpServerResponses

public List<MockHttpServer.MockHttpServerResponse> getMockHttpServerResponses()

setServerPort

public void setServerPort(int serverPort)

getServerPort

public int getServerPort()


Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.