On Friday 21 December 2007 05:31:30 pm Andrea Aime wrote:
Gabriel Roldán ha scritto:
> Hi Andrea,
> I like the first approach, though what about the following inline
> comments:
>
> On Friday 21 December 2007 10:48:55 am Andrea Aime wrote:
>> ...With that one in place, one could conceivably:
>> * have a property file with the connection params to a dbms
>
> It'd be nice if the property file with ds connection parameters is
> located at, and looked up like for the geotools online tests that use a
> "fixture".
>
>> * load it, see if it's possible to connect to the db. If not,
>> skip the test
>
> So instead, if the fixture exists try to connect, if can't connect fail,
> because the fixture existing means you expect the test to pass. If
> there're no fixture skip the test.
Hum, the whole fixture concept seems to be either badly implemented
or badly documented in GeoTools, or else I never found docs about it.
In postgis datastore for example the property files are looked up in the
test module itself, and I've always modifed them locally, and it's still
working. So the fixture is always there, but you may not be able to
connect using it.
Well I seem to recall making use of fixtures and having them working, though
the memory is vague and thing may have changed...
>> * if yes, execute enough sql calls to setup the db for the
>> test
>
> this one I'm not that sure, but what about using plain DataStore api to
> populate it? wouldn't using plain sql be too low level that you'll end up
> tied to a single db type? After all the DataStore working correctly is a
> pre-requisite for the test to run.
Because createSchema is badly implemented (when implemented at all)
in most datastores. So if I used it I would end up debugging feature
type creation code instead of doing what I'm supposed to do (test wfsv).
aha, fair enough, didn't think on it
>> * register the datastore and the feature types in the mock
>
> Just that this way the whole thing is no more a "mock"? I'd be happy if
> we call the test "functional" somehow. When the mock config has born, I
> used properties datastore just for convenience, but would have been the
> same using memory datastore. The point were to have a reliable DataStore
> to work over as to not worry about the datastore working well or not, and
> concentrate on testing geoserver functionality. So it seemed like a
> reasonable mock up of a geoserver config, except for a purist. Throwing
> in real stuff into the test config breaks its mock nature even more,
> which is fine since the test is functional.
Hem... we're splitting hairs here imho.
Yes you're right, MockData is not really a mock, it's a tool to create a
full data directory.
Yes you're right, one should use a minimal data store for testing,
but at the moment there is no such a thing for versioning (want to
write a versioning property datastore) so I need the real thing.
So in the end, in order to concentrate on testing GeoServer I need
the versioning postgis datastore anyways, or I'll end up doing no
tests whatsoever. Can you suggest alternate routes (with reasonable
development times related to them)?
yes, actually I was just trying to propose the simplest change possible, a
naming one. Just to not get things confused. I'd say go for it as you
proposed but change Mock by something else. MockData->FunctionalTestData?
Me neither want to spend a lot of time on it at least we have a mandate, aka
working hours to dedicate.
Cheers,
Gabriel
Cheers
Andrea
!DSPAM:4045,476bea67291158362916074!