db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From V Narayanan <V.Naraya...@Sun.COM>
Subject [upgrade Tests] Reusing existing junit test in Uprgade test
Date Tue, 27 Mar 2007 14:20:20 GMT
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?

thanx,
Narayanan

Mime
View raw message