org.apache.wink.client
Class MockHttpServer

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

public class MockHttpServer
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.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
 byte[] getRequestContent()
           
 java.lang.String getRequestContentAsString()
           
 java.util.Map<java.lang.String,java.lang.String> getRequestHeaders()
           
 java.lang.String getRequestMethod()
           
 java.lang.String getRequestUrl()
           
 int getServerPort()
           
static void main(java.lang.String[] args)
           
 void run()
           
 void setDelayResponse(int milliseconds)
           
 void setMockResponseCode(int responseCode)
           
 void setMockResponseContent(byte[] content)
           
 void setMockResponseContent(java.lang.String content)
           
 void setMockResponseContentEchoRequest(boolean echo)
           
 void setMockResponseContentType(java.lang.String type)
           
 void setMockResponseHeader(java.lang.String name, java.lang.String value)
           
 void setMockResponseHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
           
 void setReadTimeout(int milliseconds)
           
 void setServerPort(int serverPort)
           
 void startServer()
           
 void stopServer()
           
 
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
 

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 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.