Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 30206 invoked from network); 17 Aug 2006 08:23:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Aug 2006 08:23:42 -0000 Received: (qmail 50292 invoked by uid 500); 17 Aug 2006 08:23:39 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 50139 invoked by uid 500); 17 Aug 2006 08:23:38 -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 50128 invoked by uid 99); 17 Aug 2006 08:23:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Aug 2006 01:23:38 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of stepan.mishura@gmail.com designates 64.233.162.204 as permitted sender) Received: from [64.233.162.204] (HELO nz-out-0102.google.com) (64.233.162.204) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Aug 2006 01:23:37 -0700 Received: by nz-out-0102.google.com with SMTP id v1so243548nzb for ; Thu, 17 Aug 2006 01:23:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=lmlo3lD9vBwJKOPrwrZ4BbUYOGeTGnJPCWnkF7V6FVfyFFVcicC9dE9Nup82VE27aQp+E/hn8libQW89WQSSJyZC5sXzI3JnOPqD+62+4e6j968aDUC28HlK4UZAYPa2B94HSqjpdkiC9kzYimPCStb/fIhVHzsEBUIAaL2UsTk= Received: by 10.65.114.11 with SMTP id r11mr1889419qbm; Thu, 17 Aug 2006 01:23:16 -0700 (PDT) Received: by 10.65.242.13 with HTTP; Thu, 17 Aug 2006 01:23:15 -0700 (PDT) Message-ID: <6e47b64f0608170123i5480efe7m978140bd8989632e@mail.gmail.com> Date: Thu, 17 Aug 2006 15:23:15 +0700 From: "Stepan Mishura" To: harmony-dev@incubator.apache.org Subject: Re: [test] Jetty integration progress ? (was Re: [classlib] jetty based tests) In-Reply-To: <4d0b24970608161938i53c0bfd4n946ec1a11b7ad823@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_84415_33277439.1155802995753" References: <4d0b24970607312039u25fdad8arb16b08fd5bb0597@mail.gmail.com> <4d0b24970608161938i53c0bfd4n946ec1a11b7ad823@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_84415_33277439.1155802995753 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/17/06, Andrew Zhang wrote: > > Hi folks, > > I'd like to say something more about jetty integration. We should reach an > agreement on how to integrate/use jetty in Harmony. There are some > concerns > I can image now: > > 1. Where to put jetty? support or luni module or somewhere else? It > depends > on question 2. +1 for support 2. How to use jetty? How many jetty instances are there? Singleton or > multiple instances? In other word, shall we start only one jetty server at > the beginning before running all tests? or will we start/destroy embedded > jetty server at will in any test case? Seems jetty supports both options. It should be possibile for a test dynamically configure testing server (remember my favorite scenario with sending chunked response?). So a test should be able to stat jetty. 3. How to write jetty based test?. Multi-thread network test always is a > problem to us. I found it's also hard to be theoretically. I've expected that you know :-) Are there any guidelines? Thanks, Stepan. According to the description above, I suggest put jetty in support module, > and encapsulate a class (i.e Support_JettyServer) with some public methods > for test writing (i.e getJettyPort(), setHandler(), set...). The advantage > of this approach hides all jetty details in support. Once jetty support > class is ready, all modules can write http tests in the same way. > > Any suggestions are highly appreciated! Thanks! > > On 8/1/06, Andrew Zhang wrote: > > > > Hi folks, > > > > I volunteer to work on excluded tests in luni module, most of which are > > dependent on external servers(http server, socks proxy and etc.). > > > > As we discussed some months earlier, we'd integrate Jetty to Harmony > test > > framework for eliminating external http server, but seems no more > progress. > > > > Any volunteer to do this job? :-) > > > > Thanks! > > > > > > On 5/23/06, Stepan Mishura wrote: > > > > > > Hi George, Paulex, > > > > > > Thanks for your answers. As a preliminary result - your convinced me > and > > > I'm > > > going to be volunteer to evaluate jetty integration to classlib test > > > suite. > > > > > > Do anybody work on integrating jetty http server to move net tests out > > > of > > > exclude list? > > > > > > Thanks, > > > Stepan. > > > > > > On 5/23/06, George Harley < george.c.harley@googlemail.com > wrote: > > > > > > > > Stepan Mishura wrote: > > > > > Hi George, Tim > > > > > > > > > > I'd like to clarify the following questions: > > > > > 1) Configuring > > > > > As I understood we say that the server is 'embedded' when we can > > > > > start/stop > > > > > it within Ant without additional configuration steps. And all we > > > need > > > > > to do > > > > > is just download required jars. Right? > > > > > > > > > > What about Eclipse users? > > > > > > > > Hi Stepan, > > > > > > > > In addition to be being start-able, stop-able and configurable from > > > Ant > > > > and XML config files, Jetty can also be embedded into the Java code > of > > > a > > > > test case or test suite. Configuration, starting and stopping are > all > > > > possible. Eclipse users should not be disadvantaged. > > > > > > > > > > > > > > > > > > 2) Time to run test suite > > > > > May be it is hard to estimate but anyway - will the test suite run > > > > > slow down > > > > > if we'll use jetty instead of mock objects? How much? > > > > > > > > Depends on configuration. Configure and start the server in the > > > setup() > > > > of a JUnit TesCase (and stopping the server in the teardown()) would > > > > obviously be slower than doing the equivalent in a JUnit TestSetup > > > > descendent. Start up is a lot less than half a second on my machine. > > > > > > > > Is there some performance benchmark for tests that is at risk here ? > > > > > > > > > > > > > > > > > > 3) Testing > > > > > Quoting Tim from 'local server thread': "There is no way to force > a > > > > > server > > > > > to send you a chunked response using regular HTTP headers, so in > > > this > > > > > case > > > > > the server and client have an understanding that when the client > > > asks > > > > > for a > > > > > particular resource the server will send it back in chunks." > > > > > > > > > > With mock objects this can be done with no problems and > HARMONY-164 > > > > > demonstrates the possible way. Also are we going to create > negative > > > > > tests, > > > > > for example, for broken server response? I think yes. Can > jettyserver > > > > be > > > > > used for negative testing? > > > > > > > > Yes. You can send back any error. > > > > > > > > > > > > > > > > > > See other comments below > > > > > > > > > > On 5/22/06, George Harley wrote: > > > > >> > > > > >> Stepan Mishura wrote: > > > > >> > On 5/19/06, Tim Ellison wrote: > > > > >> >> > > > > >> >> Stepan Mishura wrote: > > > > >> >> > > > > >> >> > I'm OK only if we separate tests with Jetty from common test > > > suite > > > > >> >> run. > > > > >> >> > > > > >> >> Why? > > > > >> > > > > > >> > > > > > >> > Because each external dependency complicates 'normal' test > suite > > > > >> run ( I > > > > >> > don't want to face with situation when to run Harmony test > suite > > > I > > > > >> > have to > > > > >> > configure and run 20 different external servers even they are > > > easy > > > > >> > configurable). As far as I remember we agreed to use mock > objects > > > - > > > > so > > > > >> > let's > > > > >> > use them! For example, in this case there is no need in > jettyserver. > > > > >> > > > > > >> > I'm not against 'jetty based tests' but I'd prefer to separate > > > such > > > > >> > tests. > > > > >> > > > > > >> > Thanks, > > > > >> > Stepan. > > > > >> > > > > > >> > > > > >> Hi Stepan, > > > > >> > > > > >> Just seen this note and think that my previous append on the "Re: > > > svn > > > > >> commit: r407752" thread sums up my thoughts. Allow me to quote > > > myself: > > > > >> > > > > >> > > > > >> Jetty or equivalent is a good basis for such local server stubs. > It > > > is > > > > >> fast, it is lightweight, > > > > > > > > > > > > > > > Fast and lightweight as what? > > > > > I saw sometimes ago java server that has jar size 4k. And > > > > > jetty-6.0.0beta6.jar is 423k size. > > > > > > > > > > > > > > > > > Not sure of your point here. Is there some test file footprint > > > benchmark > > > > that is at risk here ? If there is a better, faster, more > lightweight > > > > server that would suit our purposes then let's hear about it so that > > > we > > > > can investigate whether or not it may be used with our network > tests. > > > > > > > > > > > > > >> it can be started and stopped very simply from > > > > >> within Ant (so that it only runs for the duration of a specified > > > batch > > > > >> of unit tests) and may also be completely controlled from Java > test > > > > code > > > > >> so that we can configure its behaviour for any test case from > > > within > > > > >> that test case. > > > > > > > > > > > > > > > Good. > > > > > > > > > > It's architecture means that we do not have to run it as > > > > >> a complete web server but can stub out any aspect of its runtime > > > > >> behaviour we wish in order to suit the purposes of the test(s). > > > > > > > > > > > > > > > What about 'chunked response'? Can a testcase force jetty server > to > > > > > send it > > > > > a chunked response? > > > > > > > > Yes. The API provides options to do this. Chunks are encoded as per > > > > RFC2616. > > > > > > > > > > > > Best regards, > > > > George > > > > > > > > > > > > > > I don't really understand why such network tests making use of a > > > small, > > > > >> embedded server running locally would need to be considered as > > > outside > > > > >> of the "normal test flow". > > > > >> > > > > > > > > > > > > > > > Because I consider adding jetty server as precedent for adding > other > > > > > dependencies to the "normal test flow". I believe that "normal > test > > > > flow" > > > > > should be fast and lightweight as much as possible. Each > additional > > > > > dependency or configuration step adds a brick(even it light) to > > > > > developer's > > > > > large. As the result classlib test suite may become very slow and > > > hard > > > > to > > > > > configure. All I want is to understand - do we really need > jettyserver > > > > > inside it. > > > > > > > > > > Thanks, > > > > > Stepan. > > > > > > > > > > We are not talking about an external server here and we are not > > > talking > > > > >> about developers having to carry out complex configuration > > > manoeuvres > > > > >> when running the tests. That is something that nobody wants. The > > > > >> motivation here is purely to get more of the java.net tests out > of > > > the > > > > >> "excludes" sin bin. > > > > >> > > > > >> Best regards, > > > > >> George > > > > >> > > > > >> > > > > >> > Regards, > > > > >> >> Tim > > > > >> >> > > > > >> >> -- > > > > >> >> > > > > >> >> Tim Ellison (t.p.ellison@gmail.com) > > > > >> >> IBM Java technology centre, UK. > > > > >> >> > > -- Thanks, Stepan Mishura Intel Middleware Products Division ------------------------------------------------------ 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 ------=_Part_84415_33277439.1155802995753--