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 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)