db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2658) Convert jdbcapi/parameterMetaDataJdbc30.java to JUnit
Date Wed, 30 May 2007 20:52:15 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500234

Kathey Marsden commented on DERBY-2658:

Thanks Ramin for looking at this test conversion.  The main thing I think is that we really
need to make sure that we are testing everything the old test tested.  Below are some specific
comments, but it would be good to do a close review comparing the old and new test to make
sure that we have assertions for all of the cases that were tested by canon comparison before.
 Anyway, here are some comments ....

Typically the test class name for the junit tests starts with a capital letter. e.g. ParameterMetaDataJdbc30Test

parameterMetaDataJdbc30_app.properties and master/parameterMetaDataJdbc30.out  should be deleted.

Attach the output of svn stat to your next patch.

When I run the test all the tests fail with
parameterMetaDataJdbc30Test)java.sql.SQLException: Schema 'SAMPLE' does not exist
This is I think because setUp attempts to drop the table that is not there.
I think you would be better off using  CleanDatabaseSetup and the decorateSQL method to create
your table and function, rather than creating it with each fixture.  There are lots of examples
of CleanDatabaseSetup usage in other tests.

The dumpExpectedSQLExceptions method only checks an SQLException's sqlstate against itself,
so would always pass.  Instead of calls to dumpExpectedSQLExceptions 
you should have assertSQLState("XXXXX",e) where XXXX is the hardcoded expected SQLState. You
can see the expected states by looking at the canon in functionTests/master/parameterMetaDataJdbc30.out
or just temporarily printing  SQLState to see what it is.

Calls like 	assertTrue ("Jira 44 failed.", "22019".equals(e.getSQLState()) can be replaced
by assertSQLState 

The System.out's in the old test need to be translated into assertions. e.g.
//System.out.println("parameters count for callable statement is: " + paramMetaData.getParameterCount());
should be replaced with an assertEquals call.

dumpParameterMetaDataNegative doesn't look quite right to me. It seems like it would always
fail. Instead of 

try {
                        fail("parameter isNullable " + paramMetaData.isNullable(-1));
                } catch (SQLException e) {

I would expect something like.
try {
	fail("parameterMetaData.isNullable(-1) should have failed);
    } catch (SQLException se)

For the code where we have if(!usingDerbyNetClient()) there should be an explanation of why
we don't run with client with a Jira reference.  If there is a bug and it is not filed, file

The fixtures testParameterMetadataWithXXXParameters () doesn't actually seem to test the parameterMetaData.
 I don't know if that is an artifact of the old test but we should add in some testing.

> Convert jdbcapi/parameterMetaDataJdbc30.java to JUnit
> -----------------------------------------------------
>                 Key: DERBY-2658
>                 URL: https://issues.apache.org/jira/browse/DERBY-2658
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>    Affects Versions:
>            Reporter: Ramin Moazeni
>            Assignee: Ramin Moazeni
>             Fix For:
>         Attachments: DERBY-2658.diff
> Convert jdbcapi/parameterMetaDataJdbc30.java to JUnit.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message