Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 81442 invoked from network); 8 Jan 2010 14:36:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jan 2010 14:36:57 -0000 Received: (qmail 92230 invoked by uid 500); 8 Jan 2010 14:36:57 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 92153 invoked by uid 500); 8 Jan 2010 14:36:57 -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 92144 invoked by uid 99); 8 Jan 2010 14:36:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2010 14:36:57 +0000 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; Fri, 08 Jan 2010 14:36:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 375952388A18; Fri, 8 Jan 2010 14:36:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r897215 - /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java Date: Fri, 08 Jan 2010 14:36:36 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100108143636.375952388A18@eris.apache.org> Author: sebb Date: Fri Jan 8 14:36:35 2010 New Revision: 897215 URL: http://svn.apache.org/viewvc?rev=897215&view=rev Log: Check for threads that did not run the connect test code Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java?rev=897215&r1=897214&r2=897215&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java Fri Jan 8 14:36:35 2010 @@ -712,6 +712,7 @@ */ int done=0; int failed=0; + int didNotRun = 0; for (int i = 0; i < pts.length; i++) { final PoolTest poolTest = pts[i]; poolTest.thread.join(); @@ -719,6 +720,9 @@ if (DONE.equals(state)){ done++; } + if (poolTest.loops == 0){ + didNotRun++; + } final Throwable thrown = poolTest.thrown; if (thrown != null) { failed++; @@ -734,6 +738,7 @@ + ". Hold time: " + holdTime + ". Maxwait: " + maxWait + ". Done: " + done + + ". Did not run: " + didNotRun + ". Failed: " + failed + ". expectError: " + expectError ); @@ -754,7 +759,11 @@ ); } } - assertEquals("WARNING: Expected half the threads to fail",pts.length/2,failed); + if (didNotRun > 0){ + System.out.println("NOTE: some threads did not run the code: "+didNotRun); + } + // Assume that threads that did not run would have timed out. + assertEquals("WARNING: Expected half the threads to fail",pts.length/2,failed+didNotRun); } else { assertEquals("Did not expect any threads to fail",0,failed); }