com.canoo.webtest.engine
Class CSVTracingWebConnection

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.util.WebConnectionWrapper
      extended by com.canoo.webtest.engine.CSVTracingWebConnection
All Implemented Interfaces:
com.gargoylesoftware.htmlunit.WebConnection

public class CSVTracingWebConnection
extends com.gargoylesoftware.htmlunit.util.WebConnectionWrapper

Wrapper around a "real" WebConnection that will use the wrapped web connection to do the real job and save information about all performed requests and received responses.

Version:
$Revision: 90396 $
Author:
Marc Guillemot

Constructor Summary
CSVTracingWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection, File resultFile)
          Wraps a web connection to have a report generated of the received responses.
 
Method Summary
protected  void appendToResultFile(String str)
           
protected  void finalize()
           
protected  Iterable<String> getHeaders()
           
protected  Iterable<String> getInformation(com.gargoylesoftware.htmlunit.WebResponse response, com.gargoylesoftware.htmlunit.WebRequest request)
          Saves the response content in the temp dir and adds it to the summary page.
 com.gargoylesoftware.htmlunit.WebResponse getResponse(com.gargoylesoftware.htmlunit.WebRequest request)
          Calls the wrapped WebConnection and save information about the request/response.
protected  String toCSV(Iterable<String> values)
           
protected  void traceRequest(com.gargoylesoftware.htmlunit.WebRequest request, com.gargoylesoftware.htmlunit.WebResponse response)
           
protected  void writeHeaders()
           
 
Methods inherited from class com.gargoylesoftware.htmlunit.util.WebConnectionWrapper
getWrappedWebConnection
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVTracingWebConnection

public CSVTracingWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection,
                               File resultFile)
                        throws IOException
Wraps a web connection to have a report generated of the received responses.

Parameters:
webConnection - the webConnection that do the real work
dirName - the name of the directory to create in the tmp folder to save received responses. If this folder already exists, it will be deleted first.
Throws:
IOException - in case of problems writing the files
Method Detail

writeHeaders

protected void writeHeaders()
                     throws IOException
Throws:
IOException

getResponse

public com.gargoylesoftware.htmlunit.WebResponse getResponse(com.gargoylesoftware.htmlunit.WebRequest request)
                                                      throws IOException
Calls the wrapped WebConnection and save information about the request/response.

Specified by:
getResponse in interface com.gargoylesoftware.htmlunit.WebConnection
Overrides:
getResponse in class com.gargoylesoftware.htmlunit.util.WebConnectionWrapper
Throws:
IOException

traceRequest

protected void traceRequest(com.gargoylesoftware.htmlunit.WebRequest request,
                            com.gargoylesoftware.htmlunit.WebResponse response)
                     throws IOException
Parameters:
request -
response -
Throws:
IOException

getInformation

protected Iterable<String> getInformation(com.gargoylesoftware.htmlunit.WebResponse response,
                                          com.gargoylesoftware.htmlunit.WebRequest request)
Saves the response content in the temp dir and adds it to the summary page.

Parameters:
response - the response to save
request - the request used to get the response
Throws:
IOException - if a problem occurs writing the file

getHeaders

protected Iterable<String> getHeaders()

toCSV

protected String toCSV(Iterable<String> values)

appendToResultFile

protected void appendToResultFile(String str)
                           throws IOException
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved.