hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Matzura <...@eviware.com>
Subject Re: HttpCore to mock remote servers in unit tests?
Date Fri, 06 Apr 2007 16:55:38 GMT
Hi Stefan,

I recommend you to use Jetty for this, it will allow you to do exactly 
what you want (ie start a small service with few lines of code and 
inject some handlers..), we use it in soapUI for mocking webservices and 
it works just great..

regards,

/Ole
eviware.com


Stefan Hübner wrote:
> Thanks for clarifying that to me, Roland!
>
> Tomcat on the other hand is way too oversized, since I just want to
> start a small service with a few lines of code, inject a
> request/response-handler (e.g. based on JMock) run a test and shut
> that thing down again. Thought, HttpCore could provide me with the
> service part of it, but ok, that's what prototypes are good for,
> right?
>
> Regards,
> Stefan
>
> 2007/4/6, Roland Weber <ossfwot@dubioso.net>:
>> Hi Stefan,
>>
>> > So I thought, I could set up a small server based on
>> > HttpCore-components.
>>
>> There's one in the test code for HttpCore, and a slightly different
>> one in the test code for HttpClient (though the latter still lacks
>> some pieces for expect-continue handling). Both are based on the
>> HttpService class and the ElementalHttpServer example.
>>
>> > I progressed up to the point where I actually
>> > were about to check parameters of the requests, the mocked server
>> > received. There I stuck since HttpCore's HttpRequest-Interface is
>> > lacking any higher level API to read it's parameters.
>> >
>> > Maybe, that interface is just not intended to serve use cases like the
>> > one described above?
>>
>> Exactly. "Core" is not a higher level API. See our project charter,
>> section "Project Scope", item 2:
>>
>>    Jakarta HttpComponents will provide ONLY a toolset of low level
>>    generic transport APIs. In particular, server side application
>>    layer APIs WILL NOT be developed.
>>    http://jakarta.apache.org/httpcomponents/charter.html
>>
>> Please use the Servlet API for that purpose, for example in Tomcat:
>>         http://tomcat.apache.org/
>> Our project charter was specifically drafted to avoid scope clashes
>> with other Apache projects.
>>
>> cheers,
>>   Roland
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message