[Geoserver-devel] [jira] Created: (GEOS-1546) Catalog is loaded twice for each unit test

Catalog is loaded twice for each unit test
------------------------------------------

                 Key: GEOS-1546
                 URL: http://jira.codehaus.org/browse/GEOS-1546
             Project: GeoServer
          Issue Type: Bug
          Components: Global
    Affects Versions: 1.6.0-RC1
            Reporter: Andrea Aime
            Assignee: Andrea Aime
             Fix For: 1.6.0-RC2, 1.7.0-beta1
         Attachments: geos1546.patch

Data is loaded twice for every unit test. Things go as follows:
* data is loaded during context startup
* context goes down, data is freed
* geoserver is destroyed, and grabs a data reference from the context, which then reloads it
* geoserver is freed, data is freed again

This happens because Data has a sick dependency on GeoServer, for no special good reason, so GeoServer cannot depend on Data (that would trigger a circular dependency).
The solution is simple, have GeoServer depend on data, not the opposite. The patch changes the two constructors, removes Data.getGeoserver(), adjusts the spring context files as a consequence.
It's pretty extensive (touches 14 files) but since the thing its totally statically checked by the compiler and the spring context startup I believe it to be safe too.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira