Fixed broken test cases

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051425 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2010-12-21 09:07:42 +00:00
parent c1e0539a93
commit 0dbecf3a49
2 changed files with 5 additions and 10 deletions

View File

@ -28,7 +28,6 @@
package org.apache.http.entity.mime;
import java.io.ByteArrayInputStream;
import java.nio.charset.Charset;
import org.apache.http.entity.mime.content.InputStreamBody;
import org.apache.http.entity.mime.content.StringBody;
@ -42,9 +41,7 @@ public class TestMultipartContentBody {
StringBody b1 = new StringBody("text");
Assert.assertEquals(4, b1.getContentLength());
Charset defCharset = Charset.defaultCharset();
Assert.assertEquals(defCharset.name(), b1.getCharset());
Assert.assertEquals("US-ASCII", b1.getCharset());
Assert.assertNull(b1.getFilename());
Assert.assertEquals("text/plain", b1.getMimeType());

View File

@ -53,7 +53,7 @@ public class TestMultipartForm {
new StringBody("this stuff"));
FormBodyPart p2 = new FormBodyPart(
"field2",
new StringBody("that stuff", Charset.forName("US-ASCII")));
new StringBody("that stuff", Charset.forName("UTF-8")));
FormBodyPart p3 = new FormBodyPart(
"field3",
new StringBody("all kind of stuff"));
@ -69,21 +69,19 @@ public class TestMultipartForm {
String expected =
"--foo\r\n" +
"Content-Disposition: form-data; name=\"field1\"\r\n" +
"Content-Type: text/plain; charset=" +
Charset.defaultCharset() + "\r\n" +
"Content-Type: text/plain; charset=US-ASCII\r\n" +
"Content-Transfer-Encoding: 8bit\r\n" +
"\r\n" +
"this stuff\r\n" +
"--foo\r\n" +
"Content-Disposition: form-data; name=\"field2\"\r\n" +
"Content-Type: text/plain; charset=US-ASCII\r\n" +
"Content-Type: text/plain; charset=UTF-8\r\n" +
"Content-Transfer-Encoding: 8bit\r\n" +
"\r\n" +
"that stuff\r\n" +
"--foo\r\n" +
"Content-Disposition: form-data; name=\"field3\"\r\n" +
"Content-Type: text/plain; charset=" +
Charset.defaultCharset() + "\r\n" +
"Content-Type: text/plain; charset=US-ASCII\r\n" +
"Content-Transfer-Encoding: 8bit\r\n" +
"\r\n" +
"all kind of stuff\r\n" +