db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: [upgrade Tests] Reusing existing junit test in Uprgade test
Date Tue, 27 Mar 2007 21:42:18 GMT
V Narayanan wrote:
> Hi,
> I am writing tests to test the StoredProcedures used in locator 
> implementation of LOB related JDBC methods.
> The Stored procedures are created when the database version is 10.3 (or 
> upon hard(full) upgrade to 10.3).
> Tests for the Stored Procedure exist in the form of 
> jdbcapi/ClobStoredProcedureTest and jdbcapi/BlobStoredProcedureTest. I 
> wanted to reuse this code in the upgrade tests alone the way it is done 
> for DatabaseMetaDataTest.
> In the earlier solution I had thought of I had decided to replicate code 
> from jdbcapi/BlobStoredProcedureTest and jdbcapi/ClobStoredProcedureTest 
> into changes10_3 which upon retrospection did not seem the right 
> approach (because I was replicating code).
> I was able to draw a few ideas from the way DatabaseMetaDataTest is run 
> currently in the current tests. But the difference between the case of 
> the DatabaseMetaDataTest and the Stored Procedure test would be is that 
> the StoredProcedureTests are to be run only when the old database 
> version is < 10.3 and in the PH_HARD_UPGRADE and the HARD_UPGRADE phases.
> I did this by adding the following code to baseSuite of UprgadeRun
>           if(oldMajor == 10 && oldMinor < 3 &&
>                (phase == UpgradeChange.PH_HARD_UPGRADE || phase == 
> UpgradeChange.PH_HARD_UPGRADE)) {
>                suite.addTestSuite(BlobStoredProcedureTest.class);
>                suite.addTestSuite(ClobStoredProcedureTest.class);
>            }
> Can someone pls guide me on whether the method I have adopted above is 
> the right approach?

A cleaner approach would be to pass the phase into the 
Changes10_3.suite() method and then add the additional tests as required 
in that method. This would logically group the 10.3 upgrade tests in a 
single location.


View raw message