Yes, Jetty is a good option :-)

Richard Liang
China Software Development Lab, IBM



Geir Magnusson Jr wrote:


Stepan Mishura wrote:
Tim, George, I'd like to resume this topic

Thanks for posting to the dev list :)


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.


I've created a small local server that just demonstrates common approach
only. The idea is the next: a simple local server provides a way for a unit
test to configure a server's response (also it may be improved to save a
request message to be check by a unit test):
              ---invoke--->            ---request--->
A unit tests            tested API             a local server instance
    |         <---result---            <---response---   ^
    |                                                              |
     -------------------configure server--------------------

I believe this approach may be applied for most of cases and allow us to
eliminate dependency on an external server.

And give us tight control to be able to mimic misbehavior on the server side to be sure that the library behaves correctly.


I've created JIRA (see Harmony-164) and attached a file with local server and 2 JUnit test cases (one of them sends a chunked response, please note there is no server's code specific for a selected test). Could you please
review the code and let me know what you think?

I took a quick look, and while I really am convinced that our own framework is necessary for all sorts of reasons I and others have listed already, I do wonder if we could simply do better via using jetty or tomcat in some way?

geir



Reply via email to