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 F2339C289 for ; Sat, 5 May 2012 10:22:37 +0000 (UTC) Received: (qmail 74678 invoked by uid 500); 5 May 2012 10:22:37 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 74576 invoked by uid 500); 5 May 2012 10:22:37 -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 74566 invoked by uid 99); 5 May 2012 10:22:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 May 2012 10:22:37 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.214.171 as permitted sender) Received: from [209.85.214.171] (HELO mail-ob0-f171.google.com) (209.85.214.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 May 2012 10:22:31 +0000 Received: by obfk16 with SMTP id k16so7204728obf.30 for ; Sat, 05 May 2012 03:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=oeneiDwHcgMGT4BwNNrjV7CWhI7XlJwTyiWS9IUMY2U=; b=ArmaNWkjcS8InD9ayzF3Z9tAR35pslcyMhLE598z/dsOTtVlYjrOb//Nc4WDC8ZoKx stwBGcvF0BE7tuDSTDk9jx6dr+rjQBgTwXpXljbUDCvlcMcZuNGcN4fqkut5d/y75Jof UJ/zMoSB9jYi7aMFDs6VdkB0ped3GZmgV31QSq0eGtLuiKTuQXEL38MX0hg8b026PELj OnSzxCpl+Z2o3zimUxzXPu6/pLdtkefCyNTtzNx3Cxb4SDB+9DC/vjAhmZvXWQ7ISqqk fY8Da/nX1/pBZl/yPoV1gfxwzH4vgNkRJhMYknq23S2EAkIOaNZ2VQCnfvEm6MFfM0DP +eZQ== MIME-Version: 1.0 Received: by 10.182.139.2 with SMTP id qu2mr12984533obb.34.1336213330416; Sat, 05 May 2012 03:22:10 -0700 (PDT) Sender: sebbaz@gmail.com Received: by 10.182.90.230 with HTTP; Sat, 5 May 2012 03:22:10 -0700 (PDT) In-Reply-To: References: <20120504180227.E9E10238896F@eris.apache.org> Date: Sat, 5 May 2012 11:22:10 +0100 X-Google-Sender-Auth: pBRmSdUzUY-gWTpFvAHEY7krLZk Message-ID: Subject: Re: svn commit: r1334103 - /commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java From: sebb AT ASF To: dev@commons.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On 4 May 2012 19:05, sebb AT ASF wrote: > The following change to the GKOP ctor seems to fix the problem: > > > =A0 =A0 =A0 =A0if (factory =3D=3D null) { > =A0 =A0 =A0 =A0 =A0 =A0this.close(); // <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D close the parent > =A0 =A0 =A0 =A0 =A0 =A0throw new IllegalArgumentException("factory may no= t be null"); > =A0 =A0 =A0 =A0} > > Not 100% sure if that is the correct fix - perhaps tearDown() needs to > be adjusted? I've fixed GOP and GKOP to call jmxUnregister() instead. Hope that's OK; it fixes the remaining test errors. > On 4 May 2012 19:02, =A0 wrote: >> Author: sebb >> Date: Fri May =A04 18:02:27 2012 >> New Revision: 1334103 >> >> URL: http://svn.apache.org/viewvc?rev=3D1334103&view=3Drev >> Log: >> Add specific test for null factory >> TODO causes tearDown error >> >> Modified: >> =A0 =A0commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/= impl/TestGenericKeyedObjectPool.java >> >> Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/poo= l2/impl/TestGenericKeyedObjectPool.java >> URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/jav= a/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java?rev=3D13341= 03&r1=3D1334102&r2=3D1334103&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/imp= l/TestGenericKeyedObjectPool.java (original) >> +++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/imp= l/TestGenericKeyedObjectPool.java Fri May =A04 18:02:27 2012 >> @@ -1111,6 +1111,14 @@ public class TestGenericKeyedObjectPool >> =A0 =A0 =A0 =A0 pool.close(); >> =A0 =A0 } >> >> + =A0 =A0@Test(expected=3DIllegalArgumentException.class) >> + =A0 =A0public void testConstructorNullFactory() { >> + =A0 =A0 =A0 =A0// add dummy assert (won't be invoked because of IAE) t= o avoid "unused" warning >> + =A0 =A0 =A0 =A0assertNotNull(new GenericKeyedObjectPool= (null)); >> + =A0 =A0 =A0 =A0// TODO this currently causes tearDown to report an err= or >> + =A0 =A0 =A0 =A0// Looks like GKOP needs to call close() on its parent = before throwing IAE >> + =A0 =A0} >> + >> =A0 =A0 @Test(timeout=3D60000) >> =A0 =A0 public void testExceptionOnPassivateDuringReturn() throws Except= ion { >> =A0 =A0 =A0 =A0 SimpleFactory factory =3D new SimpleFactory(); >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org