My suggestion on the pull request was just that the static calls to the
GeoServerExtensions singleton might be a problem developing more unitary
unit tests (I'd run into the same issue the day before) and it might be
worth handling it in a way that made it easier to mock while we were
changing things as long as it didn't add to much work. I was thinking
along the lines of just giving the classes protected/package
getResourceLoader methods that could be overridden for the objects to be
tested. A better way of doing this, or if there already is a way that
hidden somewhere would be nice, but it's not worth holding up the pull
request for and I've no problem accepting it with the static calls in place.
On 22 April 2014 07:17, Jody Garnett <[email protected]> wrote:
>
>>> You're not being clear about the motivation here, or at least i can't
>> infer it from this conversation. Can you just point me at a specific test
>> case that Kevin has written.
>>
>
> In the current codebase look for any/all examples of
> GeoserverDataDirectory.setResourceLoader.
>
> * MockCreator.createCatalog - this is the key gotcha that effects many
> test cases
> * DefaultGeoServerLoaderTest
> * FileExistsValidatorTest
> * PyCatalogModTest
>
> Here is an example use from PyCatalogModTest.java:
>
> Previously:
>
>
> *GeoserverDataDirectory.setResourceLoader(scriptMgr.getDataDirectory().getResourceLoader());*
>
> The replacement would be:
>
> *GeoServerExtensions.init("resourceLoader",
> scriptMgr.getDataDirectory().getResourceLoader() );*
>
> This is due to code now using GeoServerExtensions (rather than
> GeoserverDataDirectory) to look things up.
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
--
Kevin Smith
Junior Software Engineer | Boundless
[email protected]
+1-778-785-7459
@boundlessgeo <https://twitter.com/boundlessgeo>
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel