Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 98276 invoked from network); 20 Sep 2010 20:47:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Sep 2010 20:47:30 -0000 Received: (qmail 50440 invoked by uid 500); 20 Sep 2010 20:47:30 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 50202 invoked by uid 500); 20 Sep 2010 20:47:29 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 50193 invoked by uid 99); 20 Sep 2010 20:47:29 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Sep 2010 20:47:29 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.62.16] (HELO qmta01.westchester.pa.mail.comcast.net) (76.96.62.16) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Sep 2010 20:47:04 +0000 Received: from omta17.westchester.pa.mail.comcast.net ([76.96.62.89]) by qmta01.westchester.pa.mail.comcast.net with comcast id 95cc1f0031vXlb8518mjpU; Mon, 20 Sep 2010 20:46:43 +0000 Received: from [192.168.1.200] ([69.143.109.145]) by omta17.westchester.pa.mail.comcast.net with comcast id 98mj1f00E38FjT13d8mj31; Mon, 20 Sep 2010 20:46:43 +0000 Message-ID: <4C97C832.60606@christopherschultz.net> Date: Mon, 20 Sep 2010 16:46:42 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: Writing unit tests References: <4C97A817.50604@christopherschultz.net> <4C97C516.6020105@apache.org> In-Reply-To: <4C97C516.6020105@apache.org> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig01699ABB6E807DD8004FBC54" X-Virus-Checked: Checked by ClamAV on apache.org --------------enig01699ABB6E807DD8004FBC54 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mark, On 9/20/2010 4:33 PM, Mark Thomas wrote: > On 20/09/2010 11:29, Christopher Schultz wrote: >> All, >> >> I'm attempting a patch for >> https://issues.apache.org/bugzilla/show_bug.cgi?id=3D49964 and I'd lik= e to >> write a few unit tests for it. In the Tomcat 6.0.x trunk, I can only >> find what appear to be 30-40 test files. Is there a test suite elsewhe= re >> that I can download and augment in order to properly test my code, and= >> to test against regressions? >=20 > Not for Tomcat 6. >=20 > Best option is write the patch for Tomcat 7, add the test cases to the > Tomcat 7 unit tests and then think about back-porting to 6. >=20 > New features always go into the latest version and then get back-ported= > so you'll need to start with 7 anyway. Gotcha. That also explains why you'd DUP'd the bug against a TC 7 enhancement. I'm glad to work on it either way. I have this working with a small patch against the 6.0.x trunk, but I have a few questions about it: 1. There's a method in catalina.connector.Connector called init(). When does that get called? I had expected that it would be called after all the setXXX attributes had be set on it from the digester upon start-up, but it appears that Connector.init /never/ gets called. That means that my defaults have a hard time being ... defaulted properly. I have a hack in there that does a sanity check when checking the list of methods to see if the current request should be parsed, but it seems like a waste of processing time during the request itself. Should I put my "startup" code somewhere other than Connector.init()? 2. Coding conventions seem to be applied ... inconsistently. Is there a code style guide that I can actually follow so my code "looks right", or should I just look at what's already there in the files I'm modifying and take my best guess at what's appropriate? Thanks, -chris --------------enig01699ABB6E807DD8004FBC54 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyXyDIACgkQ9CaO5/Lv0PAemQCgjP0CohcZrYbTGQY+MYOoMMMv CowAn3ec5ytIau3HH5Uc4V16qOGB4ng7 =D9pV -----END PGP SIGNATURE----- --------------enig01699ABB6E807DD8004FBC54--