You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Mohamed Nufail (JIRA)" <ji...@apache.org> on 2012/07/08 19:30:38 UTC

[jira] [Created] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Mohamed Nufail created DERBY-5851:
-------------------------------------

             Summary: Inconsistent code coverage shown for LogicalPreparedStatement40
                 Key: DERBY-5851
                 URL: https://issues.apache.org/jira/browse/DERBY-5851
             Project: Derby
          Issue Type: Bug
            Reporter: Mohamed Nufail
            Priority: Minor


I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 

But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416815#comment-13416815 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

Committed derby-5851-CPdecorator.patch to the trunk as revision 1362745.

Not marking this issue resolved yet, since we are continuing to discuss whether
we wish to have additional patches for other similar test suites.



                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414578#comment-13414578 ] 

Mohamed Nufail commented on DERBY-5851:
---------------------------------------

Yes, it does work. The code coverage report shows the method as covered in both PreparedStatement40 and LogicalPreparedStatement40 when an exception is not thrown. So it looks like the problem is related to throwing exceptions. But even when an exception was thrown, method was shown as covered in PreparedStatement40.
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411187#comment-13411187 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

I tried running 'ant -verbose' to see if I could better understand how the emma-single
target works. I've pasted the output of the instrumented JUnit invocation below.

It's interesting, to me, that we appear to have *both* sets of Derby classes in the
classpath: the instrumented derbyrun.jar comes first, and then my normal sane jars
come afterward (although derbyTesting.jar comes before the instrumented derbyrun.jar)

Is this how it is supposed to look? Or should I *only* have the instrumented derbyrun.jar
in my path?

Execute:Java13CommandLauncher: Executing 'java' with arguments:
'-Dderby.dummy.prop=X'
'-Xmx512m'
'-Dderby.tests.jacoco.agent=-Dderby.dummy.prop=X'
'-Demma.verbosity.level=silent'
'-classpath'
'/home/bpendleton/src/derby/trunk/tools/java/emma.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyTesting.jar:/home/bpendleton/src/derby/trunk/jars/emma/lib/derbyrun.jar:/home/bpendleton/src/derby/trunk/tools/java/junit.jar:/home/bpendleton/src/derby/trunk/tools/java/jakarta-oro-2.0.8.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyrun.jar:/home/bpendleton/src/derby/trunk/jars/sane/derby.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbytools.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbynet.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyclient.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_de_DE.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_es.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_fr.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_it.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_ja_JP.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_ko_KR.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_pt_BR.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_zh_CN.jar:/home/bpendleton/src/derby/trunk/jars/sane/derbyLocale_zh_TW.jar:/home/bpendleton/tools/apache-ant-1.7.1/lib/ant-launcher.jar:/home/bpendleton/tools/apache-ant-1.7.1/lib/ant.jar:/home/bpendleton/tools/apache-ant-1.7.1/lib/ant-junit.jar'
'org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner'
'org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest'

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415147#comment-13415147 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

Good. Then I propose to move forward with this patch.

Nufail, do you think it would be helpful to annotate our wiki pages
http://wiki.apache.org/db-derby/CodeCoverage and
http://wiki.apache.org/db-derby/CodeCoverageWithEMMA
to record our new understanding about the limitation of these coverage tools?

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton resolved DERBY-5851.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.10.0.0

We've completed all the work that is planned for this issue.
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>             Fix For: 10.10.0.0
>
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414724#comment-13414724 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

Given what we've learned about the code coverage tools, do we think that this patch
in fact increases the overall code coverage of our test suites? Or do we now think that
we were already testing LogicalPreparedStatement40 adequately, and it is just that
the code coverage tool was not showing us the actual coverage clearly?

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13410339#comment-13410339 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

You could try increasing the Emma logging level: http://emma.sourceforge.net/faq.html#q.verbose
to see if there is a warning from the Emma libraries that perhaps we are overlooking?

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13413521#comment-13413521 ] 

Mohamed Nufail commented on DERBY-5851:
---------------------------------------

I tried out the suggestions.

1) Methods which are not correctly instrumented are those which are implemented in PreparedStatement40. What LogicalPreparedStatement40 does is forward all calls to the underlying physical prepared statement. So those which are implemented in PreparedStatement40 are causing this problem while those in PreparedStatement and Statement classes work fine. Also all those methods in PreparedStatement40 throw exceptions as they are not supported. 

2) Emma and JaCoCo reports are the same. They miss same set of methods.

3) Siddharth has started a thread on JaCoCo mailing list at https://sourceforge.net/projects/eclemma/forums/forum/614869/topic/5425816

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13410383#comment-13410383 ] 

Knut Anders Hatlen commented on DERBY-5851:
-------------------------------------------

org.apache.derbyTesting.junit.JDBCDataSource does some class loader magic in its getDataSourceObject() method, which is where the ConnectionPoolDataSource instance is created by the test framework. Not sure if that could cause any confusion. (I'm not even sure why the class loader magic is needed. Perhaps it's there to support the upgrade tests, where we need to load a different version of the data source class than the one found on the system class path?)
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414427#comment-13414427 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

As one more way to confirm that the problem is directly related to methods which exit by
throwing exceptions, why don't you try this:

1) Change one of those PreparedStatement40 methods so that instead of throwing an
exception, it just prints a message to the screen and returns normally. Also put a print
message in the LogicalPreparedStatement40 method that calls it
2) Run the PreparedstatementTest. It should fail, because it expects the method to throw
an exception. But it should show that both print statements are printed to the screen.
3) Check the code coverage report. Now it should show that the method is fully covered,
in BOTH PreparedStatement40 and LogicalPreparedStatement40

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411305#comment-13411305 ] 

Knut Anders Hatlen commented on DERBY-5851:
-------------------------------------------

If Bryan's experiment was run with the CLASSPATH environment variable set, the results might be explained by the following comment in the junit-init target:

---
         The preferences:
           1) User-specified derby.junit.classpath
           2) Jars (insane preferred over sane)
           3) classes-directory

         Note also that the user's CLASSPATH environment variable is appended
         to the JUnit classpath, but in most cases Derby classes here will be
         shadowed by one of the above entries. It is recommended to not have
         any Derby classes in the CLASSPATH environment variable.
---

As long as the instrumented derbyrun.jar appears before the other jars, I don't think it should cause any problems, though.
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409554#comment-13409554 ] 

Knut Anders Hatlen commented on DERBY-5851:
-------------------------------------------

That's very odd...

I applied your patch and added
    System.out.println("I AM CALLED!");
at the beginning of LogicalPreparedStatement40.setNString() before I ran the emma-single target. I saw that "I AM CALLED!" got printed to the console, but the EMMA coverage report claimed that setNString() hadn't been called.

So it would look like an EMMA bug. However, I ran the same experiment with JaCoCo (ran the jacoco-junit-single target instead of emma-single) and got the exact same results: "I AM CALLED!" was printed, but the coverage report said the code wasn't exercised.

It must be something our tests do that confuses the code coverage tools, but I don't know what it could be.
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409994#comment-13409994 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

Are these classes dynamically loaded? Is it possible that dynamically loaded classes aren't measured correctly by the code coverage tools?

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mohamed Nufail updated DERBY-5851:
----------------------------------

    Attachment: derby-5851-CPdecorator.patch

derby-5851-CPdecorator.patch modifies PreparedStatementTest to run with a connectionCPDecorator. 
Run "ant -Dderby.junit.testclass=org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest emma-single" with this patch and compare the emma reports for PreparedStatement40 and LogicalPreparedStatement40
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton reassigned DERBY-5851:
--------------------------------------

    Assignee: Mohamed Nufail
    
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415916#comment-13415916 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

Prior to applying the patch:

junit-single:
    [junit] Running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest
    [junit] Tests run: 178, Failures: 0, Errors: 0, Time elapsed: 50.984 sec

After applying the patch:

junit-single:
    [junit] Running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest
    [junit] Tests run: 222, Failures: 0, Errors: 0, Time elapsed: 65.597 sec

It looks as though the patch is running successfully in my environment. I intend to commit
this patch, as the increased coverage seems worth the additional testing time.

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416732#comment-13416732 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

That additional coverage sounds great! Are you intending to attach an additional
patch to this issue for those other three tests? Or do you think it would be
clearer to deal with them in separate JIRA issues?

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414879#comment-13414879 ] 

Mohamed Nufail commented on DERBY-5851:
---------------------------------------

I think it does increase. I see increases in code coverage in both LogicalPreparedStatement and LogicalPreparedStatement40 with this patch. Although it does not show all, at least for some methods the coverage has increased.
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416275#comment-13416275 ] 

Mohamed Nufail commented on DERBY-5851:
---------------------------------------

Bryan, I think the wiki pages can be updated with this info. I will look into it.

Also, I added a connectionCPDecorator to the following tests and they also showed an improvement in code coverage. And it might help to make sure that different statement implementations do not behave differently.
- org.apache.derbyTesting.functionTests.tests.derbynet.PrepareStatementTest
- org.apache.derbyTesting.functionTests.tests.jdbc4.CallableStatementTest
- org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411489#comment-13411489 ] 

Bryan Pendleton commented on DERBY-5851:
----------------------------------------

Indeed, I had CLASSPATH set. Good catch!

Nufail, here's a few other suggestions that might be worth trying:

1) Can you identify any pattern in which LogicalPreparedStatement40 methods are
correctly instrumented, and which are not? Try putting a 'System.out.println' at the
front of every single method in LogicalPreparedStatement40, so that you can manually
determine which methods are being executed by PreparedStatementTest, and which are
not, and then compare your findings with the Emma report to see which methods it's missing.

2) Once you've done that, try the same thing with JaCoCo. Do both tools miss the same
set of methods? Or is one tool missing a different set than the other?

3) We could try asking on either the Emma or JaCoCo lists for suggestions on how to
diagnose a problem such as this. Perhaps those tools have additional internal debugging
we can enable, to gather more information about the instrumentation and reporting phases
to see if we can figure out where the methods are being dropped.

                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411200#comment-13411200 ] 

Mohamed Nufail commented on DERBY-5851:
---------------------------------------

I also tried the same thing. But I seem to have only the instrumented derbyrun.jar in my path. My output is below.

    [junit] Executing 'java' with arguments:
    [junit] '-Dderby.dummy.prop=X'
    [junit] '-Xmx512m'
    [junit] '-Dderby.tests.jacoco.agent=-Dderby.dummy.prop=X'
    [junit] '-Demma.verbosity.level=silent'
    [junit] '-classpath'
    [junit] '/home/nufail/dev/src/derby/tools/java/emma.jar:/home/nufail/dev/src/derby/jars/sane/derbyTesting.jar:/home/nufail/dev/src/derby/jars/emma/lib/derbyrun.jar:/home/nufail/dev/src/derby/tools/java/junit.jar:/usr/local/lib/apache-ant-1.8.3/lib/ant-launcher.jar:/usr/local/lib/apache-ant-1.8.3/lib/ant.jar:/usr/local/lib/apache-ant-1.8.3/lib/ant-junit.jar:/usr/local/lib/apache-ant-1.8.3/lib/ant-junit4.jar'
    [junit] 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner'
    [junit] 'org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest'
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409561#comment-13409561 ] 

Mohamed Nufail commented on DERBY-5851:
---------------------------------------

Indeed that is very strange.

Actually I saw similar kind of behaviour in LogicalCallableStatement and LogicalCallableStatement40 also, where no coverage is shown for some methods although the methods seem to be called by the tests.
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5851) Inconsistent code coverage shown for LogicalPreparedStatement40

Posted by "Mohamed Nufail (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13417309#comment-13417309 ] 

Mohamed Nufail commented on DERBY-5851:
---------------------------------------

I think it would be better to have them in a separate JIRA issue. The title of this one could be misleading.
                
> Inconsistent code coverage shown for LogicalPreparedStatement40
> ---------------------------------------------------------------
>
>                 Key: DERBY-5851
>                 URL: https://issues.apache.org/jira/browse/DERBY-5851
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Mohamed Nufail
>            Assignee: Mohamed Nufail
>            Priority: Minor
>         Attachments: derby-5851-CPdecorator.patch
>
>
> I tried running org.apache.derbyTesting.functionTests.tests.jdbc4.PreparedStatementTest with a connectionCPDecorator in a JDBC4 environment. So this should actually run the test with LogicalPreparedStatement40 statements. 
> But in code coverage report methods such as setNClob show no coverage in LogicalPreparedStatement40 class. But in PreparedStatement40 class all these methods are shown as covered. Actually those method calls should go to PreparedStatement40 through LogicalPreparedStatement40. But it is not shown in emma code coverage report.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira