Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 15082 invoked from network); 22 Feb 2006 15:09:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Feb 2006 15:09:20 -0000 Received: (qmail 49866 invoked by uid 500); 22 Feb 2006 15:09:15 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 49814 invoked by uid 500); 22 Feb 2006 15:09:14 -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 49803 invoked by uid 99); 22 Feb 2006 15:09:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2006 07:09:14 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of george.c.harley@googlemail.com designates 64.233.162.205 as permitted sender) Received: from [64.233.162.205] (HELO zproxy.gmail.com) (64.233.162.205) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2006 07:09:05 -0800 Received: by zproxy.gmail.com with SMTP id m22so1433154nzf for ; Wed, 22 Feb 2006 07:08:44 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:reply-to:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=kxDpNc5dK4SdGlt2LzjzOKUZQdLmw/e02ji70m+p4Gk4PFdNgrXOaJJeb4F6LchRddcKQamjR4CY0ichBlXDm/Q5rC400YC6EtsJr0h1iRb6lIKEk7Gpl15E9dbmawmR3GBBWSR/H5VYdCwQLwCR6cGHbr8C7PQVb20SK27uAwc= Received: by 10.36.222.27 with SMTP id u27mr3196993nzg; Wed, 22 Feb 2006 07:08:43 -0800 (PST) Received: from ?9.20.183.165? ( [195.212.29.75]) by mx.gmail.com with ESMTP id 16sm13129906nzo.2006.02.22.07.08.39; Wed, 22 Feb 2006 07:08:42 -0800 (PST) Message-ID: <43FC7E75.5070804@googlemail.com> Date: Wed, 22 Feb 2006 15:08:37 +0000 From: George Harley Reply-To: george.c.harley@googlemail.com User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: local test server (Was: Re: [jira] Commented: (HARMONY-71) java.net.URLConnection.setUseCaches throws unspecified IllegalAccessError) References: <6e47b64f0602202027t647b3cd3u4de7a9901fa2910c@mail.gmail.com> <43FAFBEF.4010208@gmail.com> <43FBD410.7070307@gmail.com> <6e47b64f0602220130q3361a52eo7b7b7f13081a28d1@mail.gmail.com> <43FC5DF4.6030401@pobox.com> <43FC5FF9.9030205@googlemail.com> <43FC6572.4070203@pobox.com> In-Reply-To: <43FC6572.4070203@pobox.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Geir Magnusson Jr wrote: > > > George Harley wrote: >> Geir Magnusson Jr wrote: >>> So, does this summarize to : >>> >>> 1) We need a new server or we should enahnce the current one? >>> >>> 2) We need instructions on how to do this. >>> >>> ? >>> >>> (I hope we don't need httpd to test Harmony...) >> >> Could you remind me what the "current one" is ? > > The one in the pending JIRA There is no server in the pending JIRA. As briefly mentioned somewhere else in this thread, the submitted zip for that JIRA contains configuration code and properties files that permits the tester to use any server in any location (including localhost) and test resources for deploying on those servers. > >> >> What is the problem with using httpd to test Harmony ? > > It's a rather large external dependency. Reminds me of the time we > got the TCK for JavaMail (a story in itself) and the only practical > way to use it was to get Sun's IMAP server which only ran on Solaris. > > So what I was getting at is can we use something smaller/lighter that > we can include in the project for this? What is it required to do? The tests require an HTTP server, an FTP server and a SOCKS server to be listening on certain (configurable) ports. The respective servers need to have certain resources - text files, jars etc - deployed on them as a number of the java.net.* tests try and access them from the configured locations. The tests check that the expected content is available, that it is the expected size, contains the expected data etc etc. There are a number of mature, stable, freely available HTTP/FTP/SOCKS servers out there that will do just great for satisfying the demands of these tests so I don't propose to recommend anything in particular (although I have had no problems running Apache HTTPD on my local Windows machine). I don't see any justification for someone to spend time developing a "new server" to run these tests. But, hey, it's not my time that will be wasted... > > geir > > >> >> >>> >>> >>> Stepan Mishura wrote: >>>> Hi Richard, >>>> >>>> Yes, I'm always for simplifying testing routine. And creating a >>>> detail guide >>>> for configuring some testing server is a possible way to do it. >>>> However I'd >>>> prefer to try to develop a simple local test server that is easy to >>>> configure. I believe that it will cover most of cases. >>>> >>>> And I assume that there may be a number of sophisticated test cases >>>> that >>>> requires a special server set up. But I'd place them separately >>>> this was >>>> discussed in '[testing] code for exotic configurations' topic. >>>> >>>> Otherwise there is a chance to get the following detailed >>>> instructions: >>>> 1) Download http server from http://www.apache.org >>>> ... >>>> 50) Do this and that >>>> ... >>>> 100) Now you can run net tests >>>> >>>> Thanks, >>>> Stepan >>>> >>>> >>>> On 2/22/06, Richard Liang wrote: >>>>> Dears, >>>>> Agree that server (maybe not local) is required for some >>>>> sophisticated >>>>> test cases. To make thing simply, we may provide more detail guide >>>>> (step-by-step) on how to setup/configure a typical testing server. Or >>>>> shall we setup a test server and allow user to share our testing >>>>> server? >>>>> >>>>> Richard Liang >>>>> China Software Development Lab, IBM >>>>> >>>>> >>>>> >>>>> Tim Ellison wrote: >>>>>> Stepan Mishura wrote: >>>>>> >>>>>>> I glanced through a local server code from HARMONY-57 contribution >>>>> without >>>>>>> looking into implementation details and ... this made me think. >>>>>>> I catch >>>>> hold >>>>>>> of the following: >>>>>>> 1) The server contains some testing code that looks not good for me >>>>>>> >>>>>> Care to explain? >>>>>> >>>>>> >>>>>>> 2) It is not as simple as I expected - my impression was that a >>>>>>> local >>>>> server >>>>>>> implementation should be very simple because we are not going to >>>>>>> test >>>>>>> whether it corresponds to http spec. or not. IMHO, it should only >>>>> provide a >>>>>>> test case with: >>>>>>> - a port number to open communication >>>>>>> - access to a server's input/output streams to verify a request >>>>>>> to a >>>>> server >>>>>>> or to form a server's response. >>>>>>> Naive? Well, I'm aware that I'm not so experienced in >>>>>>> java.netdevelopment >>>>>>> and testing and may be I'm wrong. >>>>>>> >>>>>> The local server I referenced can be used for a number of the >>>>>> java.net >>>>>> tests, some of which do require more sophisticated behavior, like >>>>>> basic >>>>>> authentication, eTags, etc. >>>>>> >>>>>> I agree that the tests in HARMONY-71 only need something to >>>>>> accept their >>>>>> connection, but I was simply pointing out that there will be a local >>>>>> server we can use if that contribution is accepted into the >>>>>> project, so >>>>>> probably not worth writing another. >>>>>> >>>>>> >>>>>>> I'd like to start with the first issue (BTW, is it ok to discuss >>>>> details of >>>>>>> contribution implementation if it is not accepted yet?). >>>>>>> >>>>>> Sure -- I would expect people to be evaluating it thoroughly so that >>>>>> they can vote the code in/out. The PPMC will shout early if the >>>>>> paperwork implies a contribution is unacceptable. >>>>>> >>>>>> >>>>>>> Can we avoid adding >>>>>>> a code that is specific for some test case to a local server? >>>>>>> >>>>>> Does it interfere with what you want to do? >>>>>> In some cases, the test case needs to know what is on the server a >>>>>> priori, so that it can test the client behavior correctly. >>>>>> >>>>>> Regards, >>>>>> Tim >>>>>> >>>>>> >>>>>>> On 2/16/06, Tim Ellison wrote: >>>>>>> >>>>>>>> I would rather that you just opened a new JIRA issue for that >>>>>>>> as it >>>>>>>> doesn't relate to the original problem. >>>>>>>> >>>>>>>> FYI there is a local server incoming in the HARMONY-57 >>>>>>>> contribution, >>>>> so >>>>>>>> don't spend any time on it, see: >>>>>>>> >>>>>>>> >>>>> \Harmony\Harmony_Tests\src\test\java\tests\support\Support_HttpServer.java >>>>> >>>>>>>> Regards, >>>>>>>> Tim >>>>>>>> >>>>>>>> Stepan Mishura (JIRA) wrote: >>>>>>>> >>>>>>>>> [ >>>>>>>>> >>>>> http://issues.apache.org/jira/browse/HARMONY-71?page=comments#action_12366637 >>>>> >>>>> ] >>>>>>>>> Stepan Mishura commented on HARMONY-71: >>>>>>>>> --------------------------------------- >>>>>>>>> >>>>>>>>> Tim, >>>>>>>>> >>>>>>>>> Added test case (test_setUseCachesZ) depends on network and it >>>>>>>>> fails >>>>> if >>>>>>>> it can not create connection with apache.org. The same for >>>>>>>> HARMONY-72. >>>>> I'm >>>>>>>> going to attach a patch file with a local server in it. Could you >>>>> reopen >>>>>>>> this JIRA? >>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Stepan. >>>>>>>>> >>>>>>>>> >>>>>>>>>> java.net.URLConnection.setUseCaches throws unspecified >>>>>>>>>> >>>>>>>> IllegalAccessError >>>>>>>> >>>>> -------------------------------------------------------------------------- >>>>> >>>>>>>>>> Key: HARMONY-71 >>>>>>>>>> URL: http://issues.apache.org/jira/browse/HARMONY-71 >>>>>>>>>> Project: Harmony >>>>>>>>>> Type: Bug >>>>>>>>>> Components: Classlib >>>>>>>>>> Reporter: Svetlana Samoilenko >>>>>>>>>> Assignee: Tim Ellison >>>>>>>>>> According to j2se 1.4.2 specification method >>>>>>>>>> >>>>>>>> java.net.URLConnection.setUseCaches(boolean) throws >>>>> IllegalStateException, >>>>>>>> if already connected. Harmony throws >>>>>>>> java.lang.IllegalAccessErrorinstead, >>>>>>>> that contradicts the specification. >>>>>>>> >>>>>>>>>> Code to reproduce: >>>>>>>>>> import java.io.IOException; >>>>>>>>>> import java.net.*; >>>>>>>>>> public class test2 { >>>>>>>>>> public static void main(String[] args) { >>>>>>>>>> HttpURLConnection u=null; >>>>>>>>>> try { >>>>>>>>>> u=(HttpURLConnection)(new URL("http://intel.com >>>>>>>>>> >>>>>>>> ").openConnection()); >>>>>>>> >>>>>>>>>> u.connect(); >>>>>>>>>> } catch (MalformedURLException e) { >>>>>>>>>> System.out.println("unexpected >>>>> MalformedURLException"+e); >>>>>>>>>> } catch (IOException f) { >>>>>>>>>> System.out.println("unexpected IOException"+f); >>>>>>>>>> } >>>>>>>>>> try { >>>>>>>>>> u.setUseCaches(true); >>>>>>>>>> } catch (IllegalStateException e) { >>>>>>>>>> System.out.println("OK. Expected >>>>>>>>>> IllegalStateException"); >>>>>>>>>> e.printStackTrace(); >>>>>>>>>> }; >>>>>>>>>> } >>>>>>>>>> } >>>>>>>>>> Steps to Reproduce: >>>>>>>>>> 1. Build Harmony (check-out on 2006-01-30) j2se subset as >>>>>>>>>> described >>>>> in >>>>>>>> README.txt. >>>>>>>> >>>>>>>>>> 2. Compile test2.java using BEA 1.4 javac >>>>>>>>>> >>>>>>>>>>> javac -d . test2.java >>>>>>>>>>> >>>>>>>>>> 3. Run java using compatible VM (J9) >>>>>>>>>> >>>>>>>>>>> java -showversion test2 >>>>>>>>>>> >>>>>>>>>> Output: >>>>>>>>>> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 >>>>>>>>>> java version "1.4.2_04" >>>>>>>>>> Java(TM) 2 Runtime Environment, Standard Edition (build >>>>>>>>>> 1.4.2_04-b05 >>>>> ) >>>>>>>>>> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build >>>>>>>>>> >>>>>>>> ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: >>>>> parallel) >>>>>>>>>> OK. Expected IllegalStateException >>>>>>>>>> java.lang.IllegalStateException: Already connected >>>>>>>>>> at java.net.URLConnection.setUseCaches(Z)V( >>>>> URLConnection.java >>>>>>>> :828) >>>>>>>> >>>>>>>>>> at test2.main([Ljava.lang.String;)V(test2.java:17) >>>>>>>>>> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 >>>>>>>>>> (c) Copyright 1991, 2005 The Apache Software Foundation or its >>>>>>>>>> >>>>>>>> licensors, as applicable. >>>>>>>> >>>>>>>>>> java.lang.IllegalAccessError: Connection already established >>>>>>>>>> at >>>>>>>>>> java.net.URLConnection.setUseCaches(URLConnection.java >>>>> :923) >>>>>>>>>> at test2.main(test2.java:17) >>>>>>>>>> Suggested junit test case: >>>>>>>>>> ------------------------ >>>>> URLConnectionTest.java------------------------------------------------- >>>>> >>>>>>>>>> import java.io.IOException; >>>>>>>>>> import java.net.*; >>>>>>>>>> import junit.framework.*; >>>>>>>>>> public class URLConnectionTest extends TestCase { >>>>>>>>>> public static void main(String[] args) { >>>>>>>>>> junit.textui.TestRunner.run(URLConnectionTest.class); >>>>>>>>>> } >>>>>>>>>> public void test_setUseCaches () { >>>>>>>>>> HttpURLConnection u=null; >>>>>>>>>> try { >>>>>>>>>> u=(HttpURLConnection)(new URL("http://intel.com >>>>>>>>>> >>>>>>>> ").openConnection()); >>>>>>>> >>>>>>>>>> u.connect(); >>>>>>>>>> } catch (MalformedURLException e) { >>>>>>>>>> fail("unexpected MalformedURLException"+e); >>>>>>>>>> } catch (IOException f) { >>>>>>>>>> fail("unexpected IOException"+f); >>>>>>>>>> } >>>>>>>>>> try { >>>>>>>>>> u.setUseCaches(true); >>>>>>>>>> } catch (IllegalStateException e) { //expected >>>>>>>>>> }; >>>>>>>>>> } >>>>>>>>>> } >>>>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> Tim Ellison (t.p.ellison@gmail.com) >>>>>>>> IBM Java technology centre, UK. >>>>>>>> >>>>>>>> >>>>>> >>>>> >>>> >>>> >>>> -- >>>> Thanks, >>>> Stepan Mishura >>>> Intel Middleware Products Division >>>> >>> >> >> >