Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 15222 invoked from network); 25 May 2006 19:56:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 May 2006 19:56:47 -0000 Received: (qmail 73587 invoked by uid 500); 25 May 2006 19:56:44 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 73543 invoked by uid 500); 25 May 2006 19:56:44 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 73531 invoked by uid 99); 25 May 2006 19:56:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 May 2006 12:56:44 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 202.81.18.154 is neither permitted nor denied by domain of paulex.yang@gmail.com) Received: from [202.81.18.154] (HELO ausmtp05.au.ibm.com) (202.81.18.154) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 May 2006 12:56:43 -0700 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp05.au.ibm.com (8.13.6/8.13.6) with ESMTP id k4O7eSNe995370 for ; Wed, 24 May 2006 17:40:28 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k4O7eTJi243030 for ; Wed, 24 May 2006 17:40:34 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k4O7b74B003991 for ; Wed, 24 May 2006 17:37:07 +1000 Received: from d23m0011.cn.ibm.com (d23m0011.cn.ibm.com [9.181.32.74]) by d23av04.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k4O7b0FO003202 for ; Wed, 24 May 2006 17:37:01 +1000 Received: from [127.0.0.1] ([9.181.106.114]) by d23m0011.cn.ibm.com (Lotus Domino Release 6.5.5HF262) with ESMTP id 2006052415202570-15624 ; Wed, 24 May 2006 15:20:25 +0800 Message-ID: <4474093A.3010802@gmail.com> Date: Wed, 24 May 2006 15:20:26 +0800 From: Paulex Yang User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib] please review my regression test and patch for HttpURLConnection References: <906dd82e0605230154j757fc3c5r82a36fdd17cd3297@mail.gmail.com> In-Reply-To: <906dd82e0605230154j757fc3c5r82a36fdd17cd3297@mail.gmail.com> X-MIMETrack: Itemize by SMTP Server on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 24/05/2006 15:20:25, Serialize by Router on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 24/05/2006 15:37:01, Serialize complete at 24/05/2006 15:37:01 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Mikhail, I'm afraid I cannot agree with you on this patch, If I understand correctly, Harmony-482 is about the internal contract between java.net.HttpURLConnection.setRequestMethod() and o.a.h.l.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(), and the internal contract may be broken only if some of the codes refactored (no chance for user application), say, modification for the setRequestMethod() like this: - this.method = methodTokens[i]; + this.method = method; But this can be easily monitored by test codes below: public void testGetOutputStream() throws Exception { HttpURLConnection c = (HttpURLConnection) new URL("http://127.0.0.1:" + port).openConnection(); c.setDoOutput(true); c.setRequestMethod(new String("GET")); c.getOutputStream(); ...//other for POST/PUT } This test is enough to enforced the internal contract, it will shout if some refactory breaks the internal contract. So IMHO, I think the patch for HttpURLConnection is over-designed. However, I even have no strong objection on it. What makes me more confused is the introduction of injected java.net.HttpURLConnectionAccessor, I suggest to avoid the injected helper class as long as possible, because it introduces complexity to understand/manage and is sometimes fragile because it may highly coupled with implementation details, for this specific case, a mocked subclass of o.a.h....HttpURLConnection with overridden getRequestMethod can catch the fragility of the internal contract. Mikhail Loenko wrote: > I've created regression test and patch for > http://issues.apache.org/jira/browse/HARMONY-482 > > I had to make some changes in the luni's build.xml, > that are intended to be fixed once we all agree with > proposed test suite layout. > > Please review the changes. > > Thanks, > Mikhail > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > -- Paulex Yang China Software Development Lab IBM --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org