Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 9033 invoked from network); 2 Mar 2007 14:15:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2007 14:15:41 -0000 Received: (qmail 32781 invoked by uid 500); 2 Mar 2007 14:15:49 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 32601 invoked by uid 500); 2 Mar 2007 14:15:48 -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 32592 invoked by uid 99); 2 Mar 2007 14:15:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2007 06:15:48 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.1.36] (HELO gmp-ea-fw-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2007 06:15:35 -0800 Received: from d1-emea-10.sun.com ([192.18.2.120]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l22EFE6g022625 for ; Fri, 2 Mar 2007 14:15:14 GMT Received: from conversion-daemon.d1-emea-10.sun.com by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JEA000014UBKP00@d1-emea-10.sun.com> (original mail from Dyre.Tjeldvoll@Sun.COM) for derby-dev@db.apache.org; Fri, 02 Mar 2007 14:15:14 +0000 (GMT) Received: from khepri29.sun.com ([129.159.112.241]) by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JEA00AXJ4XCP300@d1-emea-10.sun.com> for derby-dev@db.apache.org; Fri, 02 Mar 2007 14:15:14 +0000 (GMT) Date: Fri, 02 Mar 2007 15:15:12 +0100 From: Dyre.Tjeldvoll@Sun.COM Subject: Re: [jira] Commented: (DERBY-827) Performance can be improved by re-using language ResultSets across Activation executions. In-reply-to: <32543840.1172828690780.JavaMail.jira@brutus> Sender: Dyre.Tjeldvoll@Sun.COM To: derby-dev@db.apache.org Message-id: MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <32543840.1172828690780.JavaMail.jira@brutus> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (usg-unix-v) X-Virus-Checked: Checked by ClamAV on apache.org "Knut Anders Hatlen (JIRA)" writes: > [ https://issues.apache.org/jira/browse/DERBY-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477237 ] > > Knut Anders Hatlen commented on DERBY-827: > ------------------------------------------ > > Thanks for writing the test, Dyre. I think it is a valuable addition > to the test suite. I committed rsfromps.v1 with revision 513679. > > Some small comments: > > - assertRow() and assertResultSet() duplicate functionality that is > already implemented in JDBC.assertRowInResultSet() and > JDBC.assertFullResultSet(). Perhaps they can be reused? A couple of things about this. When I started working on this test I started by copying lang.GroupByExpressionTest since that seemed like a pretty standard lang JUnit test. I observed that it had its own methods for verifying that result sets. I found that a bit odd, since that seemed something every test has to do, so I checked what was available in BaseJDBCTestCase since GroupByExpressionTest inherits from it. When I didn't find anything I decided to use those that I had copied. I ended up making quite a few modifications to them while writing the test because I needed additional functionality to debug the failures I saw during development. Now, I absolutely see the value in having such utilites in a location where it can be shared by all tests, but do we really need to spread these utilities to so many places? Makes it hard for someone who isn't a JUnit wizard when you can't find tests that actually follow "established best practices"... Well, I tried using the asserts from JDBC, but why don't they follow the standard JUnit assert pattern, (assertX(String message, T expected, T returned))? This isn't just a style issue, in this test I have relied heavily on passing context information, such as loop indices and prepared statement parameters, down to the actual assert method so that it gets displayed when something fails (also borrowed from GroupByExpressionTest). That info will just be lost if I switch to JDBC.assertFullResultSet... When I tried letting my assertResultSet call JDBC.assertFullResultSet() I got ArrayIndexOutOfBoundsExceptions all over the place since I use the assert method to test empty resultsets against zero-length Object arrays... -- dt