Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE3461075A for ; Thu, 4 Jul 2013 15:49:51 +0000 (UTC) Received: (qmail 68426 invoked by uid 500); 4 Jul 2013 15:49:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 68196 invoked by uid 500); 4 Jul 2013 15:49:50 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 68121 invoked by uid 99); 4 Jul 2013 15:49:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jul 2013 15:49:49 +0000 Date: Thu, 4 Jul 2013 15:49:49 +0000 (UTC) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6284) Improve test coverage of org.apache.derby.iapi.db.ConnectionInfo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13700160#comment-13700160 ] Bryan Pendleton commented on DERBY-6284: ---------------------------------------- I've been studying this issue and thinking about the proposal to remove ConnectionInfo.lastAutoincrementValue. If we do this, I think we should update the JavaDoc comments in LanguageConnectionContext.java and in GenericLanguageConnectionContext.java ./engine/org/apache/derby/iapi/db/ConnectionInfo.java * @see org.apache.derby.iapi.db.ConnectionInfo#lastAutoincrementValue ./engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java * Implements ConnectionInfo.lastAutoincrementValue. * @see org.apache.derby.iapi.db.ConnectionInfo#lastAutoincrementValue * @see org.apache.derby.iapi.db.ConnectionInfo#lastAutoincrementValue ./engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java As I was studying this, I was confused by the comment in GenericLanguageConnectionContext.lastAutoincrementValue that says: * Implements ConnectionInfo.lastAutoincrementValue. At first I thought this meant "implements" as in normal Java interface-implementation usage; in that use of the word, GenericLanguageConnectionContext.lastAutoincrementValue "implements" LanguageConnectionContext.lastAutoincrementValue and GenericLanguageConnectionContext.autoincrementFlushCache "implements" LanguageConnectionContext.autoincrementFlushCache. But, what this comment actually means is: "ConnectionInfo.lastAutoincrementValue is a wrapper routine, which calls GenericLanguageConnectionContext.lastAutoincrementValue to do all the work." Which is a different sense of the word "implements". Still valid, but different. As I was looking at the code in GenericLanguageConnectionContext, I noticed that, according to the Emma report in http://dbtg.foundry.sun.com/derby/test/coverage/_files/b5.html, neither lastAutoincrementValue() nor autoincrementFlushCache() is called at all by our regression suite. However, when I look at http://dbtg.foundry.sun.com/derby/test/coverage/_files/3cf.html, I see that the Emma report for InsertResultSet says that lines 1118-1124 ARE executed: Long initialValue = lcc.lastAutoincrementValue( (s = constants.getSchemaName()), (t = constants.getTableName()), (c = constants.getColumnName(i))); and the report also says that line 1384 IS executed: lcc.autoincrementFlushCache(constants.targetUUID); So now I'm confused: if these lines are executed, how is it that the corresponding implementation code in GenericLanguageConnectionContext is NOT executed? Is this a flaw in the Emma analysis? To summarize: - if we decide to remove ConnectionInfo.lastAutoincrementValue, we should update the JavaDoc comments in LanguageConnectionContext.java and GenericLanguageConnectionContext.java - something is strange about the Emma coverage report for GenericLanguageConnectionContext, because it claims that the lastAutoincrementValue and autoincrementFlushCache methods are not executed, even though the Emma report for InsertResultSet shows that those methods ARE executed. Before proceeding with this patch, I'd like to better understand both the above. > Improve test coverage of org.apache.derby.iapi.db.ConnectionInfo > ---------------------------------------------------------------- > > Key: DERBY-6284 > URL: https://issues.apache.org/jira/browse/DERBY-6284 > Project: Derby > Issue Type: Sub-task > Components: JDBC > Reporter: Bryan Pendleton > Assignee: ahsan shamsudeen > Priority: Minor > Attachments: DERBY-6284.patch > > > According to code coverage analysis, org.apache.derby.iapi.db.ConnectionInfo is > not currently being exercised by any of our regression tests. > 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