JETTY-1144 charset set for tests for bamboo

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1032 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2009-11-07 06:56:47 +00:00
parent e044abdbde
commit 792395284d
1 changed files with 5 additions and 7 deletions

View File

@ -80,15 +80,15 @@ public class HttpWriterTest extends TestCase
public void testUTF8() throws Exception
{
_writer.setCharacterEncoding(StringUtil.__UTF8);
_writer.write("How now rown cow");
assertArrayEquals("How now rown cow".getBytes(StringUtil.__UTF8),_bytes.asArray());
_writer.write("How now \uFF22rown cow");
assertArrayEquals("How now \uFF22rown cow".getBytes(StringUtil.__UTF8),_bytes.asArray());
}
public void testMultiByteOverflowUTF8() throws Exception
{
_writer.setCharacterEncoding(StringUtil.__UTF8);
final String singleByteStr = "a";
final String multiByteDuplicateStr = "";
final String multiByteDuplicateStr = "\uFF22";
int remainSize = 1;
int multiByteStrByteLength = multiByteDuplicateStr.getBytes("UTF-8").length;
@ -113,11 +113,10 @@ public class HttpWriterTest extends TestCase
public void testISO8859() throws Exception
{
_writer.setCharacterEncoding(StringUtil.__ISO_8859_1);
_writer.write("How now rown cow");
_writer.write("How now \uFF22rown cow");
assertEquals("How now ?rown cow",new String(_bytes.asArray(),StringUtil.__ISO_8859_1));
}
/* TODO fails on bamboo ??
public void testOutput()
throws Exception
{
@ -142,10 +141,9 @@ public class HttpWriterTest extends TestCase
hb.completeHeader(fields,true);
hb.flush(10000);
String response = new String(endp.getOut().asArray());
String response = new String(endp.getOut().asArray(),StringUtil.__UTF8);
assertTrue(response.startsWith("HTTP/1.1 200 OK\r\nContent-Length: 1025\r\n\r\n\u05531234567890"));
}
*/
}