nl.surfnet.coin.mock
Class MockHtppServer

java.lang.Object
  extended by nl.surfnet.coin.mock.MockHtppServer

public class MockHtppServer
extends Object

Very simple Server to mock http traffic


Constructor Summary
MockHtppServer(int port)
          Construct MockHtppServer
 
Method Summary
protected  MockHandler createHandler(org.eclipse.jetty.server.Server server)
          Create a handler for the server
 void doStartServer(boolean async)
          Start the server in a non-blocking mode.
 MockHandler getHandler()
           
 org.eclipse.jetty.server.Server getServer()
           
 void startServer()
          Start the server in a non-blocking mode.
 void startServerSync()
          Start the server in a blocking mode.
 void stopServer()
          Stop the server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockHtppServer

public MockHtppServer(int port)
Construct MockHtppServer

Parameters:
port - number it listens to
Method Detail

createHandler

protected MockHandler createHandler(org.eclipse.jetty.server.Server server)
Create a handler for the server

Parameters:
server - Server
Returns:
the MockHandler

startServer

public void startServer()
Start the server in a non-blocking mode. The separate thread will be killed when the test class finishes


startServerSync

public void startServerSync()
Start the server in a blocking mode. The method does not return untill the thread is killed


doStartServer

public void doStartServer(boolean async)
Start the server in a non-blocking mode. The separate thread will be killed when the test class finishes

Parameters:
async - if true it will start with a short delay

stopServer

public void stopServer()
Stop the server


getHandler

public MockHandler getHandler()
Returns:
the handler

getServer

public org.eclipse.jetty.server.Server getServer()
Returns:
the server


Copyright © 2012. All Rights Reserved.