You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2015/03/22 22:48:28 UTC
svn commit: r1668485 -
/poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
Author: centic
Date: Sun Mar 22 21:48:27 2015
New Revision: 1668485
URL: http://svn.apache.org/r1668485
Log:
Integration test: Do a few more things with the MapiMessage
Modified:
poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java?rev=1668485&r1=1668484&r2=1668485&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java Sun Mar 22 21:48:27 2015
@@ -22,6 +22,8 @@ import java.io.FileInputStream;
import java.io.InputStream;
import org.apache.poi.hsmf.MAPIMessage;
+import org.apache.poi.hsmf.datatypes.AttachmentChunks;
+import org.apache.poi.hsmf.datatypes.DirectoryChunk;
import org.junit.Test;
public class HSMFFileHandler extends POIFSFileHandler {
@@ -32,6 +34,19 @@ public class HSMFFileHandler extends POI
assertNotNull(mapi.getDisplayBCC());
assertNotNull(mapi.getMessageDate());
+ AttachmentChunks[] attachments = mapi.getAttachmentFiles();
+
+ for(AttachmentChunks attachment : attachments) {
+
+ DirectoryChunk chunkDirectory = attachment.attachmentDirectory;
+ if(chunkDirectory != null) {
+ MAPIMessage attachmentMSG = chunkDirectory.getAsEmbededMessage();
+ assertNotNull(attachmentMSG);
+ String body = attachmentMSG.getTextBody();
+ assertNotNull(body);
+ }
+ }
+
/* => Writing isn't yet supported...
// write out the file
File file = TempFile.createTempFile("StressTest", ".msg");
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org