Subject | JUnit tests for jaybird using different GDS types. |
---|---|
Author | Ryan Baldwin |
Post date | 2003-09-19T12:07:32Z |
Hi,
I have been thinking about the firebird test cases and what might be the
best way to make it easy to run them on type4 GDS, type2 GDS and type2
emebedded GDS. I have tried a few different methods to do this and following
is what I currently beleive to be the easiest/best method.
First we catorgarize the test packages as follows:
GDS Specific - eg. org.firebirdsql.jgds and org.firebirdsql.ngds.
Non GDS Specific - eg. All but the above packages.
The GDS Specific packages should be given a diffent base class to the non
GDS specific tests.
We modify BaseFBTest and BaseTestFBField to behave differently depending on
a property perhaps called 'gds_type_to_test'. So for example 'getdbpath'
would return a URL appropriate for the GSD type being tested, so on and so
forth.
We then introduce a new all-tests, one-test, and test-reports-html target
specific to each GDS type - these tagets will set the property described
above before executing the tests. The GDS specfifc tests are are run only
when the appropriate target is run. EG when all-tests-type4 is run the jgds
tests are run but not ngds, when all-tests-type2 is run the ngds tests are
run but not the jgds tests.
These tests would produce output to a subdirectory of where they do
currently which would be named according to the gds type.
The existing all-tests, one-test, and test-reports-html targets would be
modified to run their equivilant for each gds type in turn.
I believe the advantages to this would be:
No extra work involved when writing most new test cases to make it run with
the different GDS types.
Its easy to run the tests for a particular GDS type or too run them for all
gds types.
I belive maybe not all the tests extend BaseFBTest and BaseTestFBField - if
this is the case a common base class may need to be introduced for them to
make them behave correctly for the different GDS types.
Does any one have any ideas or objections to this?
Thanks
Ryan
I have been thinking about the firebird test cases and what might be the
best way to make it easy to run them on type4 GDS, type2 GDS and type2
emebedded GDS. I have tried a few different methods to do this and following
is what I currently beleive to be the easiest/best method.
First we catorgarize the test packages as follows:
GDS Specific - eg. org.firebirdsql.jgds and org.firebirdsql.ngds.
Non GDS Specific - eg. All but the above packages.
The GDS Specific packages should be given a diffent base class to the non
GDS specific tests.
We modify BaseFBTest and BaseTestFBField to behave differently depending on
a property perhaps called 'gds_type_to_test'. So for example 'getdbpath'
would return a URL appropriate for the GSD type being tested, so on and so
forth.
We then introduce a new all-tests, one-test, and test-reports-html target
specific to each GDS type - these tagets will set the property described
above before executing the tests. The GDS specfifc tests are are run only
when the appropriate target is run. EG when all-tests-type4 is run the jgds
tests are run but not ngds, when all-tests-type2 is run the ngds tests are
run but not the jgds tests.
These tests would produce output to a subdirectory of where they do
currently which would be named according to the gds type.
The existing all-tests, one-test, and test-reports-html targets would be
modified to run their equivilant for each gds type in turn.
I believe the advantages to this would be:
No extra work involved when writing most new test cases to make it run with
the different GDS types.
Its easy to run the tests for a particular GDS type or too run them for all
gds types.
I belive maybe not all the tests extend BaseFBTest and BaseTestFBField - if
this is the case a common base class may need to be introduced for them to
make them behave correctly for the different GDS types.
Does any one have any ideas or objections to this?
Thanks
Ryan