db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6291) Improve code coverage of org.apache.derby.iapi.jdbc.BrokeredCallableStatement
Date Fri, 12 Jul 2013 02:40:46 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13706591#comment-13706591
] 

Bryan Pendleton commented on DERBY-6291:
----------------------------------------

I agree, this makes it challenging to use the coverage tools 
to determine if the code is covered by our test suites.

Many of the un-covered BrokeredCallableStatement methods
have to do with "named parameters", which is an optional
part of the JDBC standard that I believe Derby does not support.

However, it is not obvious to me whether we have tests which
verify that, or not.

For example, consider the method:

    public final void setInt(String parameterName, int value)

in BrokeredCallableStatement. Although we have a number of
tests of the similar method

    public final void setInt(int parameterIndex, int x)

in BrokeredPreparedStatement, it's not obvious to me that we
have a set of the "named parameter" variant in CallableStatement.

So, it seems like it might actually be an overall increase in
coverage (and small improvement to our test suites) to add a
test like

+    public void testTwoInOneOutProcNamedParameters() throws SQLException
+    {
+        CallableStatement cs = prepareCall
+            ("call TWO_IN_ONE_OUT_PROC (?, ?, ?)");
+       try {
+               cs.setInt("P1", 6);
+               cs.setInt("P2", 9);
+               cs.registerOutParameter (3, java.sql.Types.INTEGER);
+               cs.execute();
+               fail("should have thrown exception");
+       }
+       catch (SQLException e)
+       {
+                assertSQLState("0A000", e);
+       }
+    }

What would be a good way to determine whether adding tests like
these for the "named parameters" API would be valuable, since we
can't use the coverage tool to make that assessment?

                
> Improve code coverage of  org.apache.derby.iapi.jdbc.BrokeredCallableStatement
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-6291
>                 URL: https://issues.apache.org/jira/browse/DERBY-6291
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>            Reporter: ahsan shamsudeen
>            Assignee: ahsan shamsudeen
>            Priority: Minor
>
> According to code coverage analysis, org.apache.derby.iapi.jdbc.BrokeredCallableStatement
is 
> exercised poorly by of our regression tests. The current coverage report for this class
can be found at http://dbtg.foundry.sun.com/derby/test/coverage/_files/a9.html
> This task is to investigate this class, and either remove the unused code, or add
> regression test that exercise the code, as appropriate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message