return new TestSuite(TestMultipartForm.class);
}
public void testMultipartFormLowLevel() throws Exception {
Message message = new Message();
Header header = new Header();
header.addField(
Field.parse("Content-Type: multipart/form-data; boundary=foo"));
message.setHeader(header);
HttpMultipart multipart = new HttpMultipart("form-data");
multipart.setParent(message);
BodyPart p1 = new BodyPart();
Header h1 = new Header();
h1.addField(Field.parse("Content-Type: text/plain"));
p1.setHeader(h1);
p1.setBody(new StringBody("this stuff"));
BodyPart p2 = new BodyPart();
Header h2 = new Header();
h2.addField(Field.parse("Content-Type: text/plain"));
p2.setHeader(h2);
p2.setBody(new StringBody("that stuff"));
BodyPart p3 = new BodyPart();
Header h3 = new Header();
h3.addField(Field.parse("Content-Type: text/plain"));
p3.setHeader(h3);
p3.setBody(new StringBody("all kind of stuff"));
multipart.addBodyPart(p1);
multipart.addBodyPart(p2);