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 "Siddharth Srivastava (JIRA)" <ji...@apache.org> on 2012/07/11 03:10:33 UTC

[jira] [Created] (DERBY-5853) Test for uncovered methods of BrokeredPreparedStatement

Siddharth Srivastava created DERBY-5853:
-------------------------------------------

             Summary: Test for uncovered methods of BrokeredPreparedStatement
                 Key: DERBY-5853
                 URL: https://issues.apache.org/jira/browse/DERBY-5853
             Project: Derby
          Issue Type: Sub-task
            Reporter: Siddharth Srivastava
            Priority: Minor


According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava commented on DERBY-5853:
---------------------------------------------

I have started a related thread on Jacoco mailing list: https://sourceforge.net/projects/eclemma/forums/forum/614869/topic/5425816
                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava commented on DERBY-5853:
---------------------------------------------

Hi Knut

Actually connectionXADecorator is already used in PreparedStatementTest. I tried by putting in debug messages and was able to reproduce the same behaviour i.e. methods in BrokeredPreparedStatement40 are called but are shown as uncovered in emma code coverage report.
                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

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

That might explain it. However, if it is so, I find it a bit odd that it considers EmbedPreparedStatement40.setNString() covered, as that method also throws an exception each time it's invoked. http://people.apache.org/~kristwaa/jacoco/org.apache.derby.impl.jdbc/EmbedPreparedStatement40.html
                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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] [Comment Edited] (DERBY-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava edited comment on DERBY-5853 at 7/12/12 7:35 AM:
----------------------------------------------------------------------

I found that same functions in BrokeredPreparedStatement40 classes are being called for both jacoco and emma. But none of them reports them as covered.
I inserted debug messages in all the functions of BrokeredPreparedStatement40 class and emma and jacoco gave identical results i.e. the same functions are being called but the generated coverage reports do agree with this.
                
      was (Author: siddharthsrivastava):
    I found that same functions in BrokeredPreparedStatement40 classes are being called for both jacoco and emma. But none of them reports them as covered.
I inserted debug messages in all the functions of BrokeredPreparedStatement40 class and emma and jacoco gave identical results i.e. the functions are being called but the generated coverage reports do agree with this.
                  
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Bryan Pendleton commented on DERBY-5853:
----------------------------------------

Perhaps you could ask the JaCoCo community on their mailing list for some suggestions
about how to diagnose this problem. Is there additional logging/tracing in the JaCoCo
tool that we can enable that will help us identify where the coverage information is
being lost?

                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava updated DERBY-5853:
----------------------------------------

    Summary: Test for methods in BrokeredPreparedStatement  (was: Test for uncovered methods of BrokeredPreparedStatement)
    
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava updated DERBY-5853:
----------------------------------------

    Attachment: pstest.patch

Uploading the patch with System.out.println in case anyone would like to test again.
                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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] [Comment Edited] (DERBY-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava edited comment on DERBY-5853 at 7/12/12 2:02 PM:
----------------------------------------------------------------------

I found that same functions in BrokeredPreparedStatement40 classes are being called for both jacoco and emma. But none of them reports them as covered.
I inserted debug messages in all the functions of BrokeredPreparedStatement40 class and emma and jacoco gave identical results i.e. the same functions are being called but the generated coverage reports don't agree with this.
                
      was (Author: siddharthsrivastava):
    I found that same functions in BrokeredPreparedStatement40 classes are being called for both jacoco and emma. But none of them reports them as covered.
I inserted debug messages in all the functions of BrokeredPreparedStatement40 class and emma and jacoco gave identical results i.e. the same functions are being called but the generated coverage reports do agree with this.
                  
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Bryan Pendleton commented on DERBY-5853:
----------------------------------------

The Emma documentation discusses exceptions in sections 2.5, 2.6, and 2.7 of the FAQ:
http://emma.sourceforge.net/faq.html#q.blockcoverage

    "Thus, EMMA does not attempt to track the success or failure of every single 
    bytecode instruction: instead, it marks a basic block covered when the control 
    reaches its last instruction. A covered basic block is thus guaranteed to have 
    executed without failures at least once in a given coverage run session."

    "the motivation behind this has been that most legitimate code is written 
    so that methods return normally (without throwing an exception)."


                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava commented on DERBY-5853:
---------------------------------------------

The methods that are covered are those which do not throw exception while being tested. According to the discussion on the Jacoco forum it comes out that Jacoco doesn't consider methods that throw exception as being covered. Hence they are not considered in the coverage report. 
Our implementation of the test expects to throw an Exception and hence only those methods are considered by Jacoco which give normal return.

                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava updated DERBY-5853:
----------------------------------------

    Attachment: brokeredps.patch

This patch adds tests for methods specifically in BrokeredPreparedStatement class
                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for uncovered methods of BrokeredPreparedStatement

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

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

I think it would be good to use a similar approach as Nufail currently does with LogicalPreparedStatement and friends on the client side, and make use of existing tests that currently only test the PreparedStatement methods in the non-brokered classes, by wrapping them in decorators.

See for example derby-5851-CPdecorator.patch attached to DERBY-5851. By using connectionXADecorator() instead of connectionCPDecorator(), and not using clientServerDecorator(), I think it would make the test exercise BrokeredPreparedStatement (or, actually, that specific test will probably mostly exercise the methods in the subclass BrokeredPreparedStatement40). Unfortunately, there is a chance that you'll run into the same problems that Nufail saw in DERBY-5851, that the code coverage tools don't notice that the code is exercised.
                
> Test for uncovered methods of BrokeredPreparedStatement
> -------------------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

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

The methods may actually already be covered by other tests, but it looks like there's no way to tell using these tools.

In any case, time is probably better spent improving coverage for methods that do something useful. :)
                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch, pstest.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for methods in BrokeredPreparedStatement

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

Siddharth Srivastava commented on DERBY-5853:
---------------------------------------------

I found that same functions in BrokeredPreparedStatement40 classes are being called for both jacoco and emma. But none of them reports them as covered.
I inserted debug messages in all the functions of BrokeredPreparedStatement40 class and emma and jacoco gave identical results i.e. the functions are being called but the generated coverage reports do agree with this.
                
> Test for methods in BrokeredPreparedStatement
> ---------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>         Attachments: brokeredps.patch
>
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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-5853) Test for uncovered methods of BrokeredPreparedStatement

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

Siddharth Srivastava reassigned DERBY-5853:
-------------------------------------------

    Assignee: Siddharth Srivastava
    
> Test for uncovered methods of BrokeredPreparedStatement
> -------------------------------------------------------
>
>                 Key: DERBY-5853
>                 URL: https://issues.apache.org/jira/browse/DERBY-5853
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Siddharth Srivastava
>            Assignee: Siddharth Srivastava
>            Priority: Minor
>
> According to emma code coverage report, several methods of BrokeredPreparedStatement are uncovered. 
> This issue deals with adding tests for those methods.

--
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