Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-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 E925D78E9 for ; Sun, 18 Sep 2011 03:01:43 +0000 (UTC) Received: (qmail 57505 invoked by uid 500); 18 Sep 2011 03:01:43 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 57356 invoked by uid 500); 18 Sep 2011 03:01:42 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 57347 invoked by uid 99); 18 Sep 2011 03:01:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Sep 2011 03:01:42 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bill.speirs@gmail.com designates 209.85.212.41 as permitted sender) Received: from [209.85.212.41] (HELO mail-vw0-f41.google.com) (209.85.212.41) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Sep 2011 03:01:36 +0000 Received: by vwm42 with SMTP id 42so8941078vwm.0 for ; Sat, 17 Sep 2011 20:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wTqBJuF3uYM/1oIm5V898bR8J4fiNKC3jltAJRqu4sU=; b=G34cBhFq1tKtY+lAh1BX/Igb08T8AwxTkU5LHgyrURY5mWwR/YfDErnEaWo+Zd+OAK nnTrAkKQ9jXaVmjkfPu1Vk7lYvvIWtt9AgL5DrdXBtY367oYgrpLDx4GGOsoUl9UA6DA 9V7YAoicnuSXIXff6k+P1waho5i3ekGPXEpcs= MIME-Version: 1.0 Received: by 10.52.98.5 with SMTP id ee5mr892850vdb.135.1316314875752; Sat, 17 Sep 2011 20:01:15 -0700 (PDT) Received: by 10.52.163.100 with HTTP; Sat, 17 Sep 2011 20:01:15 -0700 (PDT) In-Reply-To: References: <20110916230259.432912388994@eris.apache.org> Date: Sat, 17 Sep 2011 23:01:15 -0400 Message-ID: Subject: Re: svn commit: r1171846 - /commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java From: Bill Speirs To: Commons Developers List Content-Type: multipart/alternative; boundary=20cf307f34a694f26504ad2e701b --20cf307f34a694f26504ad2e701b Content-Type: text/plain; charset=ISO-8859-1 Yea... I created these tests, and those values are not used. The DataSource which is used to call the commands is mocked and will simply (and always) return null. Good catch... Bill- On Sat, Sep 17, 2011 at 4:06 AM, Simone Tripodi wrote: > ouch, I was convinced I was fixing the async test :P > It makes sense, let's remove them! > Simo > > http://people.apache.org/~simonetripodi/ > http://www.99soft.org/ > > > > On Sat, Sep 17, 2011 at 1:10 AM, sebb wrote: > > On 17 September 2011 00:02, wrote: > >> Author: simonetripodi > >> Date: Fri Sep 16 23:02:58 2011 > >> New Revision: 1171846 > >> > >> URL: http://svn.apache.org/viewvc?rev=1171846&view=rev > >> Log: > >> muted 'variable res is never read' warnings > > > > If they are really not used, why not remove them? > > > >> Modified: > >> > commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java > >> > >> Modified: > commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java > >> URL: > http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java?rev=1171846&r1=1171845&r2=1171846&view=diff > >> > ============================================================================== > >> --- > commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java > (original) > >> +++ > commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java > Fri Sep 16 23:02:58 2011 > >> @@ -69,6 +69,7 @@ public class QueryRunnerTest { > >> > >> private void callGoodBatch(Connection conn, Object[][] params) > throws Exception { > >> when(meta.getParameterCount()).thenReturn(2); > >> + @SuppressWarnings( "unused" ) > >> int[] ret = runner.batch(conn, "select * from blah where ? = ?", > params); > >> > >> verify(stmt, times(2)).addBatch(); > >> @@ -79,6 +80,7 @@ public class QueryRunnerTest { > >> > >> private void callGoodBatch(Object[][] params) throws Exception { > >> when(meta.getParameterCount()).thenReturn(2); > >> + @SuppressWarnings( "unused" ) > >> int[] ret = runner.batch("select * from blah where ? = ?", > params); > >> > >> verify(stmt, times(2)).addBatch(); > >> @@ -121,6 +123,7 @@ public class QueryRunnerTest { > >> > >> // helper method for calling batch when an exception is expected > >> private void callBatchWithException(String sql, Object[][] params) > throws Exception { > >> + @SuppressWarnings( "unused" ) > >> int[] ret = null; > >> boolean caught = false; > >> > >> @@ -203,6 +206,7 @@ public class QueryRunnerTest { > >> // > >> private void callGoodQuery(Connection conn) throws Exception { > >> when(meta.getParameterCount()).thenReturn(2); > >> + @SuppressWarnings( "unused" ) > >> Object[] ret = runner.query(conn, "select * from blah where ? = > ?", handler, "unit", "test"); > >> > >> verify(stmt, times(1)).executeQuery(); > >> @@ -222,6 +226,7 @@ public class QueryRunnerTest { > >> > >> private void callGoodQuery() throws Exception { > >> when(meta.getParameterCount()).thenReturn(2); > >> + @SuppressWarnings( "unused" ) > >> Object[] ret = runner.query("select * from blah where ? = ?", > handler, "unit", "test"); > >> > >> verify(stmt, times(1)).executeQuery(); > >> @@ -259,6 +264,7 @@ public class QueryRunnerTest { > >> > >> // helper method for calling batch when an exception is expected > >> private void callQueryWithException(Object... params) throws > Exception { > >> + @SuppressWarnings( "unused" ) > >> Object[] ret = null; > >> boolean caught = false; > >> > >> @@ -329,6 +335,7 @@ public class QueryRunnerTest { > >> // > >> private void callGoodUpdate(Connection conn) throws Exception { > >> when(meta.getParameterCount()).thenReturn(2); > >> + @SuppressWarnings( "unused" ) > >> Integer ret = runner.update(conn, "update blah set ? = ?", > "unit", "test"); > >> > >> verify(stmt, times(1)).executeUpdate(); > >> @@ -354,6 +361,7 @@ public class QueryRunnerTest { > >> > >> private void callGoodUpdate() throws Exception { > >> when(meta.getParameterCount()).thenReturn(2); > >> + @SuppressWarnings( "unused" ) > >> Integer ret = runner.update("update blah set ? = ?", "unit", > "test"); > >> > >> verify(stmt, times(1)).executeUpdate(); > >> @@ -396,6 +404,7 @@ public class QueryRunnerTest { > >> > >> // helper method for calling batch when an exception is expected > >> private void callUpdateWithException(Object... params) throws > Exception { > >> + @SuppressWarnings( "unused" ) > >> Integer ret = null; > >> boolean caught = false; > >> > >> > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > > For additional commands, e-mail: dev-help@commons.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --20cf307f34a694f26504ad2e701b--