From: Jody G. <jga...@re...> - 2005-05-31 23:51:46
|
Bryce L Nordgren wrote: >Jody wrote on 05/28/2005 04:45:56 PM: > > > >>The answer is basically that geotools is not an application. As a >>toolkit we want application writers >>to be able to cobble together exactly what they need for their >>application (no more no less). >> >> At the factory finder level your GeoTiffFormatFactory reader should report "isAvailable" if it cannot locate an authority that works. This would take care of your runtime need. > >I've got kind of a philosophical but related question: Given the above, how >do you want me to lay out the Geotiff tests? The problem is, some tests >should never be run if the environment is not configured such that CRS & CS >& Datum AuthorityFactories are available. If I detect that they're not >available and just let the tests pass, then code is not actually being >tested. > We have the same problem with oracle and arcsde - not all the developers have an envirorment to test against (I know I don't). >If I make the tests fail, then people/cruisecontrol may wrongly >assume Geotiff is busted. Latly, if Martin's epsg-hsql or epsg-derby code >provides a complete set of authority factories with no configuration >needed, then this problem will go away. > > For Geotiff you need to depend on one of the crs plugins (I assume you do this already?). This is how WMS, and WFS are able to function they depend on epsg-wk. Is epsg-wkt sufficient for your needs? If so you are kind of set. If not we have a choice: - wait for an hsql (or derby) or some other database based authority to come to the rescue? - make the tests conditional on the construction of a "test fixture" (as is done for the postgis tests) - out right cheating I would recommend cheating: 1 make a CRSAuthorty as part of your test case that answer only those exact questions that you need for your exact tests. 2 As part of your TestCase setup() method you can add your custom authority to referencing.FactoryFinder (there is a method "addAuthorityFactory" that is exactly for this need (even says so in the javadocs)) 3 If you do this a lot you can make a GeoTiffTestCase and extend that to save yourself typing >Until then, should the tests _force_ the user to configure a complete >testing environment, or should they transparently allow part of the tests >to be skipped? How is cruisecontrol configured? Should I expect that >AuthorityFactories are available there? > > So to be clear - the tests are not for users. They are for developers, you can do any amount of cheating and mock objects to get the job done for your test cases. As far as I know cruise control should be treated as a normal developer, if it happens to have an crs, or an oracle, or whever we don't really need to know about it. Jody |