fail();
} catch(FileNotFoundException e) {}
// One with, from the top
MAPIMessage msgWith = new MAPIMessage(with);
assertEquals(2, msgWith.getAttachmentFiles().length);
attachment = msgWith.getAttachmentFiles()[0];
assertEquals("TEST-U~1.DOC", attachment.attachFileName.toString());
assertEquals("test-unicode.doc", attachment.attachLongFileName.toString());
assertEquals(24064, attachment.attachData.getValue().length);
attachment = msgWith.getAttachmentFiles()[1];
assertEquals("pj1.txt", attachment.attachFileName.toString());
assertEquals("pj1.txt", attachment.attachLongFileName.toString());
assertEquals(89, attachment.attachData.getValue().length);
// Plus check core details are there
try {
assertEquals("'nicolas1.23456@free.fr'", msgWith.getDisplayTo());
assertEquals("Nicolas1 23456", msgWith.getDisplayFrom());
assertEquals("test pi\u00e8ce jointe 1", msgWith.getSubject());
} catch(ChunkNotFoundException e) {
fail();
}
// One without, from the top
MAPIMessage msgWithout = new MAPIMessage(without);
// No attachments
assertEquals(0, msgWithout.getAttachmentFiles().length);
// But has core details
try {
assertEquals("Kevin Roast", msgWithout.getDisplayTo());
assertEquals("Kevin Roast", msgWithout.getDisplayFrom());
assertEquals("Test the content transformer", msgWithout.getSubject());
} catch(ChunkNotFoundException e) {
fail();
}
}