org.vfny.geoserver.requests
Class RequestTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.vfny.geoserver.requests.RequestTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
CapabilitiesSuite, DescribeSuite, FeatureSuite, LockSuite, TransactionSuite

public abstract class RequestTestCase
extends junit.framework.TestCase

Abstract test case to run request tests. Subclasses must implement getXmlReader and getKvpReader to be able to call the runXmlTest and runKvpTest. If one of the readers does not exist it is fine to just return null, as long as that test runner is not called by the client at all.


Field Summary
protected static org.geotools.filter.FilterFactory factory
          Holds mappings between HTTP and ASCII encodings
 
Constructor Summary
RequestTestCase(java.lang.String testName)
          Constructor with super.
 
Method Summary
protected abstract  KvpRequestReader getKvpReader(java.util.Map kvps)
          This should return the appropriate xml reader to be used in running the tests.
protected abstract  XmlRequestReader getXmlReader()
          This should return the appropriate xml reader to be used in running the tests.
protected  boolean runKvpTest(Request baseRequest, java.lang.String requestString, boolean match)
          Handles actual XML test running details.
protected  boolean runXmlTest(Request baseRequest, java.lang.String fileName, boolean match)
          Handles actual XML test running details.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, 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
 

Field Detail

factory

protected static org.geotools.filter.FilterFactory factory
Holds mappings between HTTP and ASCII encodings

Constructor Detail

RequestTestCase

public RequestTestCase(java.lang.String testName)
Constructor with super.

Parameters:
testName - The name of the test.
Method Detail

runXmlTest

protected boolean runXmlTest(Request baseRequest,
                             java.lang.String fileName,
                             boolean match)
                      throws java.lang.Exception
Handles actual XML test running details.

Parameters:
baseRequest - Base request, for comparison.
fileName - File name to parse.
match - Whether or not base request and parse request should match.
Returns:
true if the test passed.
Throws:
java.lang.Exception - If there is any problem running the test.

getXmlReader

protected abstract XmlRequestReader getXmlReader()
This should return the appropriate xml reader to be used in running the tests.

Returns:
DOCUMENT ME!

runKvpTest

protected boolean runKvpTest(Request baseRequest,
                             java.lang.String requestString,
                             boolean match)
                      throws java.lang.Exception
Handles actual XML test running details.

Parameters:
baseRequest - Base request, for comparison.
requestString - File name to parse.
match - Whether or not base request and parse request should match.
Returns:
true if the test passed.
Throws:
java.lang.Exception - If there is any problem running the test.

getKvpReader

protected abstract KvpRequestReader getKvpReader(java.util.Map kvps)
This should return the appropriate xml reader to be used in running the tests.

Returns:
DOCUMENT ME!