com.canoo.webtest.engine
Class ContextHelper

java.lang.Object
  extended by com.canoo.webtest.engine.ContextHelper

public final class ContextHelper
extends Object

Utility class for Context.


Constructor Summary
ContextHelper()
           
 
Method Summary
static void defineAsCurrentResponse(Context context, byte[] responseBytes, String contentType, String urlStr)
           
static void defineAsCurrentResponse(Context context, String responseText, String contentType, Class clazz)
           
static void defineAsCurrentResponse(Context context, String responseText, String contentType, String urlStr)
           
static File writeResponseFile(com.gargoylesoftware.htmlunit.WebResponse response, File file)
          Writes the response to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextHelper

public ContextHelper()
Method Detail

writeResponseFile

public static File writeResponseFile(com.gargoylesoftware.htmlunit.WebResponse response,
                                     File file)
Writes the response to the file. If an error occurs, just logs it and returns null.

Parameters:
response - the response to write
file - the file to write in
Returns:
file if everything works fine, null if an error occured.

defineAsCurrentResponse

public static void defineAsCurrentResponse(Context context,
                                           byte[] responseBytes,
                                           String contentType,
                                           String urlStr)
Parameters:
context -
responseBytes -
contentType -
urlStr -

defineAsCurrentResponse

public static void defineAsCurrentResponse(Context context,
                                           String responseText,
                                           String contentType,
                                           String urlStr)
Parameters:
context -
responseText -
contentType -
urlStr -

defineAsCurrentResponse

public static void defineAsCurrentResponse(Context context,
                                           String responseText,
                                           String contentType,
                                           Class clazz)
Parameters:
context -
responseText -
contentType -
urlStr -

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