Junit testing of restlet server?

2 messages Options
Embed this post
Permalink
Ty-3

Junit testing of restlet server?

Reply Threaded More More options
Print post
Permalink
Hi,
I am setting up a test harness for my restlet server; using junit inside Eclipse.  I am using restlet to generate the client side messages and view the responses.

It doesn't seem possible to generate bad HTTP headers with the restlet client.  Whenever I try to create headers that are part of the standard I get an error saying that I should be using the API.  I am currently doing this:

Form extraHeaders = new Form();
extraHeaders.add("Proxy-Authorization", "NTLM abcdef");
Request request = cResDataStore.getRequest();
request.getAttributes().put("org.restlet.http.headers", extraHeaders);

This makes things particularly difficult since when I try to use the API I get an unsupported message: "Challenge scheme HTTP_NTLM not supported by the Restlet engine."

ChallengeResponse cRes = new ChallengeResponse(ChallengeScheme.HTTP_NTLM, "abcdef");
Request request = cResDataStore.getRequest();
request.setProxyChallengeResponse(cRes);


Is it possible to do what I am trying to do?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2413167
StephanKoo

Re: Junit testing of restlet server?

Reply Threaded More More options
Print post
Permalink
Hi Ty,

the API is designed to do he right thing, and to avoid invalid things. I
think, without a code change it's not possible. You could perhaps try
another client api, e.g. the apache client (I don't know, if it also
avoid illegal values).

best regards
   Stephan

Ty schrieb:

> Hi,
> I am setting up a test harness for my restlet server; using junit inside Eclipse.  I am using restlet to generate the client side messages and view the responses.
>
> It doesn't seem possible to generate bad HTTP headers with the restlet client.  Whenever I try to create headers that are part of the standard I get an error saying that I should be using the API.  I am currently doing this:
>
> Form extraHeaders = new Form();
> extraHeaders.add("Proxy-Authorization", "NTLM abcdef");
> Request request = cResDataStore.getRequest();
> request.getAttributes().put("org.restlet.http.headers", extraHeaders);
>
> This makes things particularly difficult since when I try to use the API I get an unsupported message: "Challenge scheme HTTP_NTLM not supported by the Restlet engine."
>
> ChallengeResponse cRes = new ChallengeResponse(ChallengeScheme.HTTP_NTLM, "abcdef");
> Request request = cResDataStore.getRequest();
> request.setProxyChallengeResponse(cRes);
>
>
> Is it possible to do what I am trying to do?
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2413209