JETTY-1151
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1180 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
cbd9ed8386
commit
32ae0b68cc
|
@ -56,19 +56,11 @@ public class Utf8StringBufferTest extends junit.framework.TestCase
|
|||
byte[] bytes = source.getBytes(StringUtil.__UTF8);
|
||||
bytes[3]=(byte)0xc0;
|
||||
bytes[4]=(byte)0x00;
|
||||
|
||||
|
||||
Utf8StringBuffer buffer = new Utf8StringBuffer();
|
||||
try
|
||||
{
|
||||
for (int i=0;i<bytes.length;i++)
|
||||
buffer.append(bytes[i]);
|
||||
buffer.toString();
|
||||
assertTrue(false);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
assertTrue(e.toString().indexOf("!utf8")>=0);
|
||||
}
|
||||
for (int i=0;i<bytes.length;i++)
|
||||
buffer.append(bytes[i]);
|
||||
assertEquals("abc?",buffer.toString());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -55,19 +55,11 @@ public class Utf8StringBuilderTest extends junit.framework.TestCase
|
|||
byte[] bytes = source.getBytes(StringUtil.__UTF8);
|
||||
bytes[3]=(byte)0xc0;
|
||||
bytes[4]=(byte)0x00;
|
||||
|
||||
|
||||
Utf8StringBuilder buffer = new Utf8StringBuilder();
|
||||
try
|
||||
{
|
||||
for (int i=0;i<bytes.length;i++)
|
||||
buffer.append(bytes[i]);
|
||||
buffer.toString();
|
||||
assertTrue(false);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
assertTrue(e.toString().indexOf("!utf8")>=0);
|
||||
}
|
||||
for (int i=0;i<bytes.length;i++)
|
||||
buffer.append(bytes[i]);
|
||||
assertEquals("abc?",buffer.toString());
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue