Re: Unit testing HttpClient code

2009-01-31 Thread ying lcs
On 1/31/09, Oleg Kalnichevski wrote: > ying lcs wrote: > > I have the following code which uses HttpClient to do a post request. > > Can you please tell tell me what is a good way to test it? Can I > > create a mock http server object for the test to run against? > > > > HttpClient cli = getClient

Re: HTTPCLIENT4 EXCEPTIONS

2009-01-31 Thread Oleg Kalnichevski
Joan Balagueró wrote: Hello, Just a question about exceptions sending http requests. If I set a very low value to HttpConnectionParams.setConnectionTimeout(this.objHttpParams, connectionTimeout), httpclient throws “SocketTimeoutException” with the message “connect timed out”, but I expe

Re: Unit testing HttpClient code

2009-01-31 Thread Oleg Kalnichevski
ying lcs wrote: I have the following code which uses HttpClient to do a post request. Can you please tell tell me what is a good way to test it? Can I create a mock http server object for the test to run against? HttpClient cli = getClient(); HttpPost method; method = new HttpPost(url); HttpRes

Re: SOME QUESTIONS ABOUT HTTPCLIENT 4

2009-01-31 Thread Oleg Kalnichevski
Joan Balagueró wrote: Hello, I’ve just migrated the code from HttpClient3 to HttpClient4, and before starting tests I’d like to make you some questions: 1. When I set the Schema “new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)”, what does it mean? It means

Re: GET METHOD

2009-01-31 Thread Oleg Kalnichevski
Joan Balagueró wrote: Hello Oleg, Yes, I saw it, but I also saw "Returns a String that is suitable for use as an application/x-www-form-urlencoded list of parameters in an HTTP PUT or HTTP POST". PUT and POST, but it does not say anything about GET. But now I suppose that this string is also su

HTTPCLIENT4 EXCEPTIONS

2009-01-31 Thread Joan Balagueró
Hello, Just a question about exceptions sending http requests. If I set a very low value to HttpConnectionParams.setConnectionTimeout(this.objHttpParams, connectionTimeout), httpclient throws “SocketTimeoutException” with the message “connect timed out”, but I expected to receive a “Connec