Package com.meterware.pseudoserver

# Class HttpUserAgentTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.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

Constructors
Constructor
Description
`HttpUserAgentTest(String name)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addResourceHeader(String resourceName, String header)`
`protected String`
`asBytes(String s)`
`protected void`
`assertEqualQueries(String query1, String query2)`
`protected void`
`assertEquals(String comment, byte[] expected, byte[] actual)`
`protected void`
`assertEquals(String comment, Object[] expected, Object[] found)`
`protected void`
`assertImplement(String comment, Object[] objects, Class expectedClass)`
`protected void`
`assertImplements(String comment, Object object, Class expectedClass)`
`static void`
`assertMatchingSet(String comment, Object[] expected, Object[] found)`
`protected void`
`assertMatchingSet(String comment, Object[] expected, Enumeration found)`
`static String`
`asText(Object[] args)`
`protected void`
`defineResource(String resourceName, byte[] value, String contentType)`
`protected void`
`defineResource(String resourceName, PseudoServlet servlet)`
`protected void`
`defineResource(String resourceName, String value)`
`protected void`
`defineResource(String resourceName, String value, int statusCode)`
`protected void`
`defineResource(String resourceName, String value, String contentType)`
`protected void`
`defineWebPage(String pageName, 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(String xmlns, String pageName, 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 String`
`getHostPath()`
`protected int`
`getHostPort()`
`protected PseudoServer`
`getServer()`
`protected void`
`mapToClasspath(String directory)`
`protected void`
`setResourceCharSet(String resourceName, 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, failNotEquals, failNotSame, failSame`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### HttpUserAgentTest

public HttpUserAgentTest(String name)

## Method Details

### setUp

public void setUp() throws Exception

Overrides:
  `setUp` in class `junit.framework.TestCase`
Throws:
  `Exception`

### tearDown

public void tearDown() throws Exception

Overrides:
  `tearDown` in class `junit.framework.TestCase`
Throws:
  `Exception`

### defineResource

protected void defineResource(String resourceName, PseudoServlet servlet)

### defineResource

protected void defineResource(String resourceName, String value)

### defineResource

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

### defineResource

protected void defineResource(String resourceName, String value, int statusCode)

### defineResource

protected void defineResource(String resourceName, String value, String contentType)

### addResourceHeader

protected void addResourceHeader(String resourceName, String header)

### setResourceCharSet

protected void setResourceCharSet(String resourceName, String setName, boolean reportCharSet)

### defineWebPage

protected void defineWebPage(String xmlns, String pageName, 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(String pageName, 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(String directory)

### getServer

protected PseudoServer getServer()

### setServerDebug

protected void setServerDebug(boolean enabled)

### getHostPath

protected String getHostPath()

### getHostPort

protected int getHostPort() throws IOException

Throws:
  `IOException`

### assertEqualQueries

protected void assertEqualQueries(String query1, String query2)

### assertEquals

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

### assertImplement

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

### assertImplements

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

### assertMatchingSet

protected void assertMatchingSet(String comment, Object[] expected, Enumeration found)

### assertMatchingSet

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

### asText

public static String asText(Object[] args)

### asBytes

protected String asBytes(String s)

### assertEquals

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