On 2/22/07, Alexander Kleymenov <[EMAIL PROTECTED]> wrote:
Hi Andrew,
> Hi Alexander, why not launch jetty in embedded mode, say, in the test
code?
It'll make the test dependable on Jetty. And it requires some suporting
framework to be implemented.
iirc, jetty.jar has already been in dependency list.
We had a long discussion about jetty, and agreed to use it as a embedded
web
> server for harmony test,
To evaluate such an approach some sample tests are needed. I looked for
them, but could not find.
The sample code looks very simple:
jetty-based test example:
setUp code:
port = Support_PortManager.getNextPort();
Server server = new Server(port);
ResourceHandler resource_handler=new ResourceHandler();
resource_handler.setResourceBase("somewhere");
server.setHandler(resource_handler);
server.start();
tearDown code:
server.stop();
although I'm not sure whether it works for persistent connections.
I doubt it is possible to test persistence implementation with
external http server. Say, how is it possible to test that our
implementation will work correctly with 2 established persistent
connections
while third connection was interrupted by the server? There could be many
examples of such testing situations requiring tight control over http
server
behaviour.
Thank you for your note, I think we should decide is Jetty appropriate for
using
here or not.
Jetty is very flexible, and easy to implement customized handler as we
discussed before[1][2]. Thanks!
[1]
http://mail-archives.apache.org/mod_mbox/harmony-dev/200608.mbox/[EMAIL
PROTECTED]
[2] http://harmony.apache.org/subcomponents/classlibrary/agreements.html
Alexander
--
Best regards,
Andrew Zhang