Hello all,
Re: How to break external dependencies (such as those that use http) when
writing GeoTools tests?
I'm trying to write some new tests for GeoTools and am having some trouble
understanding the best way to fake a dependency on SimpleHttpProtocol.
More specifically, what I want to do is add a test for WFSDataStoreFactory's
createDataStore method that *doesn't* initiate a http request. I just want to
be able to manually specify what the http requests should return so that I can
test the logic in the createDataStore method in isolation.
The problem I have is that this method is tightly-coupled with
SimpleHttpProtocol and there's no easy way for me to inject a fake or different
implementation of this class.
Could someone please point me in the right overcome this? Would there be any
problems with acceptance of this code if I were to refactor it in such a way as
to make dependency injection possible?
Thanks in advance,
Adam Brown
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel