Wednesday, July 17, 2013

SimpleWebServer for HTTP Header Testing

SimpleWebServer is socket server. It listens for incoming connections and echo the Content type back to the client with expected response code and some data. This server mainly facilitates HTTP header testing when message routes though WSO2 ESB.

Initializing the Server

You can start the new server instance by providing port and expected response code.  

SimpleWebServer simpleWebServer = new SimpleWebServer(9006, 200);
simpleWebServer.start();

Stop the server

simpleWebServer.terminate();

Sample Test Case

Following test case verifies HTTP header content types of ESB outbound and inbound messages. The client sends HTTP request with different content types. The server set the same contentType and expected response code to the HTTP response and send it back.


No comments: