Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 61381 invoked from network); 11 Mar 2009 00:56:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Mar 2009 00:56:56 -0000 Received: (qmail 91843 invoked by uid 500); 11 Mar 2009 00:56:55 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 91762 invoked by uid 500); 11 Mar 2009 00:56:55 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 91753 invoked by uid 99); 11 Mar 2009 00:56:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 17:56:55 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Mar 2009 00:56:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3ED05238889E; Wed, 11 Mar 2009 00:56:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r752329 - /commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java Date: Wed, 11 Mar 2009 00:56:32 -0000 To: commits@commons.apache.org From: dfabulich@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090311005632.3ED05238889E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dfabulich Date: Wed Mar 11 00:56:31 2009 New Revision: 752329 URL: http://svn.apache.org/viewvc?rev=752329&view=rev Log: (empty) 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=752329&r1=752328&r2=752329&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 Wed Mar 11 00:56:31 2009 @@ -59,7 +59,7 @@ runner.fillStatement(stmt, new Object[] { null, null }); } - private PreparedStatement fakeFillablePreparedStatement(final boolean simulateOracle, final int[] types) { + private PreparedStatement fakeFillablePreparedStatement(final boolean simulateOracle, final int[] types) throws NoSuchMethodException { // prepare a mock ParameterMetaData and a mock PreparedStatement to return the PMD final ParameterMetaData pmd = mockParameterMetaData(simulateOracle,types); InvocationHandler stmtHandler = new InvocationHandler() { @@ -153,8 +153,7 @@ public void testFillStatementWithBeanErrorReadMethodPrivate() throws Exception { getPrivate(); - Method getPrivate = getClass().getDeclaredMethod("getPrivate", new Class[0]); - PropertyDescriptor badReadMethod = new PropertyDescriptor("throwsException", getPrivate, null); + PropertyDescriptor badReadMethod = new BadPrivatePropertyDescriptor(); PropertyDescriptor properties[] = new PropertyDescriptor[] { badReadMethod }; try { runner.fillStatementWithBean(stmt, this, properties); @@ -162,6 +161,19 @@ } catch (RuntimeException expected) {} } + class BadPrivatePropertyDescriptor extends PropertyDescriptor { + Method getPrivate; + BadPrivatePropertyDescriptor() throws Exception { + super("throwsException", QueryRunnerTest.class, "getThrowsException", null); + getPrivate = QueryRunnerTest.class.getDeclaredMethod("getPrivate", new Class[0]); + } + + public synchronized Method getReadMethod() { + if (getPrivate == null) return super.getReadMethod(); + return getPrivate; + } + } + public void testRethrowNullMessage() { // DBUTILS-40 SQLException sqe = new SQLException((String)null);