| java.lang.Object org.vfny.geoserver.testdata.MockUtils
MockUtils | public class MockUtils (Code) | | Provides utility methods for the creation of mock objects to help in unit
testing specific geoserver classes.
Of interest is the
method which
provides a fully functional mocked up GeoServer instance configured with a
PropertyDataStore holding CITE FeatureTypes and convenient styles, etc.
The PropertyDataStore is created against a temporary directory so it is safe
to make transactions on each test. A further improvement would be to create
just a MemoryDataStore, but it was easier to reuse the code in
AbstractCiteDataTest in the while.
author: Gabriel Roldan |
Method Summary | |
public static DataStore | createCiteDataStore(File tempDir) Returns a DataStore containing CITE feature types. | public static Data | createTestCiteData(GeoServer geoserver) | public static MockHttpServletRequest | newHttpRequest(boolean includeMockGeoserver) | public static MockHttpServletRequest | newHttpRequest(Map initialParams, boolean includeMockGeoServer) Creates a mock HttpServletRequest with the provided set of request
parameters, and possibly a fully configured GeoServer with cite test data
on the request's HttpServletContext. | public static WFSDTO | newWfsDto() Creates a new mock WMS config object.
The creates WMS config object has no data (i.e. | public static WMSDTO | newWmsDto() Creates a new mock WMS config object.
The creates WMS config object has no data (i.e. |
createCiteDataStore | public static DataStore createCiteDataStore(File tempDir) throws IOException(Code) | | Returns a DataStore containing CITE feature types.
a property files backed DataStore which forces all theFeatureTypes it serves to be in WGS84 CRS. throws: IOException - DOCUMENT ME! |
newHttpRequest | public static MockHttpServletRequest newHttpRequest(boolean includeMockGeoserver) throws ConfigurationException, IOException(Code) | | Parameters: includeMockGeoserver - if true , the generated HttpServletRequestincludes a mock geoserver configuration for the cite testdata, so you can use it, for example, for unit testing requestreaders. |
newHttpRequest | public static MockHttpServletRequest newHttpRequest(Map initialParams, boolean includeMockGeoServer) throws ConfigurationException, IOException(Code) | | Creates a mock HttpServletRequest with the provided set of request
parameters, and possibly a fully configured GeoServer with cite test data
on the request's HttpServletContext.
Parameters: initialParams - a map of request parameters to construct the mock http requestwith, where keys are parameter names, and values may be asingle String or a String[] if there are multiple values forthe same request parameter. Parameters: includeMockGeoserver - if true , the generated HttpServletRequestincludes a mock geoserver configuration for the cite testdata, so you can use it, for example, for unit testing requestreaders. |
newWfsDto | public static WFSDTO newWfsDto()(Code) | | Creates a new mock WMS config object.
The creates WMS config object has no data (i.e. getData() returns null)
|
newWmsDto | public static WMSDTO newWmsDto()(Code) | | Creates a new mock WMS config object.
The creates WMS config object has no data (i.e. getData() returns null)
|
|
|