com.meterware.pseudoserver
Class HttpUserAgentTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.meterware.pseudoserver.HttpUserAgentTest
All Implemented Interfaces:
junit.framework.Test

public class HttpUserAgentTest
extends junit.framework.TestCase

A base class for test cases that use the pseudo server.

Author:
Russell Gold

Constructor Summary
HttpUserAgentTest(java.lang.String name)
           
 
Method Summary
protected  void addResourceHeader(java.lang.String resourceName, java.lang.String header)
           
protected  java.lang.String asBytes(java.lang.String s)
           
protected  void assertEqualQueries(java.lang.String query1, java.lang.String query2)
           
protected  void assertEquals(java.lang.String comment, byte[] expected, byte[] actual)
           
protected  void assertEquals(java.lang.String comment, java.lang.Object[] expected, java.lang.Object[] found)
           
protected  void assertImplement(java.lang.String comment, java.lang.Object[] objects, java.lang.Class expectedClass)
           
protected  void assertImplements(java.lang.String comment, java.lang.Object object, java.lang.Class expectedClass)
           
protected  void assertMatchingSet(java.lang.String comment, java.lang.Object[] expected, java.util.Enumeration found)
           
static void assertMatchingSet(java.lang.String comment, java.lang.Object[] expected, java.lang.Object[] found)
           
static java.lang.String asText(java.lang.Object[] args)
           
protected  void defineResource(java.lang.String resourceName, byte[] value, java.lang.String contentType)
           
protected  void defineResource(java.lang.String resourceName, PseudoServlet servlet)
           
protected  void defineResource(java.lang.String resourceName, java.lang.String value)
           
protected  void defineResource(java.lang.String resourceName, java.lang.String value, int statusCode)
           
protected  void defineResource(java.lang.String resourceName, java.lang.String value, java.lang.String contentType)
           
protected  void defineWebPage(java.lang.String pageName, java.lang.String body)
          define a Web Page with the given page name and boy adding the html and body tags with pageName as the title of the page
protected  void defineWebPage(java.lang.String xmlns, java.lang.String pageName, java.lang.String body)
          define a Web Page with the given page name and boy adding the html and body tags with pageName as the title of the page use the given xml names space if it is not null
protected  java.lang.String getHostPath()
           
protected  int getHostPort()
           
protected  PseudoServer getServer()
           
protected  void mapToClasspath(java.lang.String directory)
           
protected  void setResourceCharSet(java.lang.String resourceName, java.lang.String setName, boolean reportCharSet)
           
protected  void setServerDebug(boolean enabled)
           
 void setUp()
           
 void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpUserAgentTest

public HttpUserAgentTest(java.lang.String name)
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Throws:
java.lang.Exception

tearDown

public void tearDown()
              throws java.lang.Exception
Throws:
java.lang.Exception

defineResource

protected void defineResource(java.lang.String resourceName,
                              PseudoServlet servlet)

defineResource

protected void defineResource(java.lang.String resourceName,
                              java.lang.String value)

defineResource

protected void defineResource(java.lang.String resourceName,
                              byte[] value,
                              java.lang.String contentType)

defineResource

protected void defineResource(java.lang.String resourceName,
                              java.lang.String value,
                              int statusCode)

defineResource

protected void defineResource(java.lang.String resourceName,
                              java.lang.String value,
                              java.lang.String contentType)

addResourceHeader

protected void addResourceHeader(java.lang.String resourceName,
                                 java.lang.String header)

setResourceCharSet

protected void setResourceCharSet(java.lang.String resourceName,
                                  java.lang.String setName,
                                  boolean reportCharSet)

defineWebPage

protected void defineWebPage(java.lang.String xmlns,
                             java.lang.String pageName,
                             java.lang.String body)
define a Web Page with the given page name and boy adding the html and body tags with pageName as the title of the page use the given xml names space if it is not null

Parameters:
xmlns -
pageName -
body -

defineWebPage

protected void defineWebPage(java.lang.String pageName,
                             java.lang.String body)
define a Web Page with the given page name and boy adding the html and body tags with pageName as the title of the page

Parameters:
pageName -
body -

mapToClasspath

protected void mapToClasspath(java.lang.String directory)

getServer

protected PseudoServer getServer()

setServerDebug

protected void setServerDebug(boolean enabled)

getHostPath

protected java.lang.String getHostPath()

getHostPort

protected int getHostPort()
                   throws java.io.IOException
Throws:
java.io.IOException

assertEqualQueries

protected void assertEqualQueries(java.lang.String query1,
                                  java.lang.String query2)

assertEquals

protected void assertEquals(java.lang.String comment,
                            java.lang.Object[] expected,
                            java.lang.Object[] found)

assertImplement

protected void assertImplement(java.lang.String comment,
                               java.lang.Object[] objects,
                               java.lang.Class expectedClass)

assertImplements

protected void assertImplements(java.lang.String comment,
                                java.lang.Object object,
                                java.lang.Class expectedClass)

assertMatchingSet

protected void assertMatchingSet(java.lang.String comment,
                                 java.lang.Object[] expected,
                                 java.util.Enumeration found)

assertMatchingSet

public static void assertMatchingSet(java.lang.String comment,
                                     java.lang.Object[] expected,
                                     java.lang.Object[] found)

asText

public static java.lang.String asText(java.lang.Object[] args)

asBytes

protected java.lang.String asBytes(java.lang.String s)

assertEquals

protected void assertEquals(java.lang.String comment,
                            byte[] expected,
                            byte[] actual)

Copyright © 2000-2008 Russell Gold. See license agreement for rights granted.