headerMultipartDigest.addField(
DefaultFieldParser.parse("Content-Type: multipart/digest; boundary=foo"));
}
public void testGetMimeType() {
MessageImpl parent = null;
MessageImpl child = null;
parent = new MessageImpl();
child = new MessageImpl();
child.setParent(parent);
parent.setHeader(headerMultipartDigest);
child.setHeader(headerEmpty);
assertEquals("multipart/digest, empty", "message/rfc822",
child.getMimeType());
child.setHeader(headerTextPlain);
assertEquals("multipart/digest, text/plain", "text/plain",
child.getMimeType());
child.setHeader(headerMessageRFC822);
assertEquals("multipart/digest, message/rfc822", "message/rfc822",
child.getMimeType());
parent = new MessageImpl();
child = new MessageImpl();
child.setParent(parent);
parent.setHeader(headerMultipartMixed);
child.setHeader(headerEmpty);
assertEquals("multipart/mixed, empty", "text/plain",
child.getMimeType());
child.setHeader(headerTextPlain);
assertEquals("multipart/mixed, text/plain", "text/plain",
child.getMimeType());
child.setHeader(headerMessageRFC822);
assertEquals("multipart/mixed, message/rfc822", "message/rfc822",
child.getMimeType());
child = new MessageImpl();
child.setHeader(headerEmpty);
assertEquals("null, empty", "text/plain", child.getMimeType());
child.setHeader(headerTextPlain);
assertEquals("null, text/plain", "text/plain", child.getMimeType());
child.setHeader(headerMessageRFC822);
assertEquals("null, message/rfc822", "message/rfc822",
child.getMimeType());
}