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 D7D97112D0 for ; Mon, 30 Jun 2014 09:07:24 +0000 (UTC) Received: (qmail 56477 invoked by uid 500); 30 Jun 2014 09:07:24 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 56448 invoked by uid 500); 30 Jun 2014 09:07:24 -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 56437 invoked by uid 99); 30 Jun 2014 09:07:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2014 09:07:24 +0000 Date: Mon, 30 Jun 2014 09:07:24 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6634) Improve test coverage of SqlXmlUtil.java 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-6634?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-6634: -------------------------------------- Attachment: d6634-3a-impossible-paths.diff Attaching [^d6634-3a-impossible-paths.diff] which removes some code paths that seem to be impossible to reach: - serializeToString(): Remove check for the items argument being null. All callers pass in a non-null List object. By removing the check, we prevent potential bugs from going unnoticed (they'll be reported as NPE instead of being ignored). - serializeToString(): Remove code that serializes a list of atomic values. The only possible input to the method is a single atomic value or a list of document nodes. There's no need for the extra complexity to handle lists of atomic values, so remove it. - serializeToString(): Remove check for the xmlVal argument being null. If xmlVal is null where the check is, there is a bug, and reporting it as NPE is better than ignoring it. The regression tests ran cleanly with the patch. > Improve test coverage of SqlXmlUtil.java > ---------------------------------------- > > Key: DERBY-6634 > URL: https://issues.apache.org/jira/browse/DERBY-6634 > Project: Derby > Issue Type: Improvement > Components: Test > Affects Versions: 10.11.0.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Priority: Minor > Attachments: d6634-1a-dead-code.diff, d6634-2a-more-tests.diff, d6634-3a-impossible-paths.diff > > > The test coverage report for SqlXmlUtil indicates that we don't have tests for: > - recompilation of XML queries used in triggers (the code looks dead, and can probably be removed) > - serialization of sequences of atomic values returned by an XPath query (as far as I can see, we only support single atomic values and sequences of documents, so probably that's also code that can be removed, possibly replaced by an assert) > - XMLEXISTS operations where the XPath query returns a scalar (after DERBY-6624, it will take the same code path as a query that returns a non-empty sequence, so it won't show up in the report anymore, but it's still useful to have a test case for it) > - XMLQUERY operations where the XPath query returns a boolean (after DERBY-6624, the same code path will be taken for all data types, so it won't show up in the report anymore, but it's still useful to have a test case for it) -- This message was sent by Atlassian JIRA (v6.2#6252)