Thanks to all who have sent suggestions. However, I did not phrase my
question well enough. The goal of this test is to verify that receiving
several lines of response content works fine. The name of the test is:
testGetResponseAsStringMultiLines

I was surprised to see that different containers yielded different
result on this. My question is: is that normal? Isn't this behavior
defined in the servlet spec? Is it possible by some setting to control
the output of containers WRT line-endings?

Of course, if the answer to this is that it's dependent on containers,
it's not defined in the servlet spec and there's no way to control what
the server answers, then of course, I'll modify the test so that we
don't check for line endings.

But before concluding this I'd like to know if the bug is in the
container's implementation or not.

Any idea?

Thanks
-Vincent        

> -----Original Message-----
> From: Kazuhito SUGURI [mailto:[EMAIL PROTECTED]
> Sent: 25 March 2004 03:38
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Help] Servlet response's encoding of new lines, what is
the
> correct behavior?
> 
> Hi Vincent,
> 
> In article <[EMAIL PROTECTED]>,
> Wed, 24 Mar 2004 16:08:16 +0100,
> "Vincent Massol" <[EMAIL PROTECTED]> wrote:
> vmassol> The container where the test succeeds are those returning
Windows
> eol
> vmassol> characters (\r\n) whereas those that fail return Unix eol
(\n).
> vmassol>
> vmassol> Is there a way (through some encoding?) to control how the
> response
> vmassol> stream should encode end of lines?
> 
> Some ideas:
> - don't use println() but print() in both test and end methods.
>       pw.print("<html><head/>\n");
> 
> - compare each line in end method.
>       String result = theResponse.getText();
>       BufferedReader reader = new BufferedReader(new
> StringReader(result));
>       assertEquals("<html><head/>", reader.readLine());
> 
> I hope this helps,
> ----
> Kazuhito SUGURI
> mailto:[EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to