Hi,
I've just finished and committed a refactoring of the MockData and
GeoServerTestSupport that allow for better control of what ends up
being inside the data directory. Basically:
* GeoServerTestSupport provides two new methods, populateDataDirectory
and getServicesFile() that allow to create a custom data directory
and use a custom services.xml file.
* MockData sports addStyle, addPropertiesType and addCoverages methods
that can be called to configure a new style, a new property datastore
and a new coverage. Alternatively, one can call addWellKnownTypes
to configure the well know cite feature types (just like the old
MockData did). After that, the setUpCatalog method will write down
a catalog.xml file with all the feature types and coverages that
have been configured so far. (GeoserverTestSupport already does
this so no worries, it's useful only if you need to customize
your data dir).
* MockData now writes the mock data directorys to target/mockXXXXdata
instead of using the default temp directories. This helps windows
users like me to avoid having 10000 mock directories in the
temp, since under windows the mock directory is not cleared up
(and it's not cleared up on linux either if you're debugging
a test and stop it before it reaches the tearDown).
Now every time a mvn clean is run all old data directories will
be wiped out.
I think we should really setup a documentation page describing how
to use mock testing in geoserver... oh well... I'm too busy
to do it right now, but I've scheduled an issue to do so:
http://jira.codehaus.org/browse/GEOS-1520
Cheers
Andrea