aboutsummaryrefslogtreecommitdiffstats
path: root/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-03-22 21:48:27 +0000
committerDominik Stadler <centic@apache.org>2015-03-22 21:48:27 +0000
commitdd875c9c040ac0e42326bb3c5b76a1d6748908ed (patch)
tree487f14ce9b693068275864b8a33ca01595441eed /src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
parent8b3da080a21f79eb7dc8b54ed996aef5150d96fd (diff)
downloadpoi-dd875c9c040ac0e42326bb3c5b76a1d6748908ed.tar.gz
poi-dd875c9c040ac0e42326bb3c5b76a1d6748908ed.zip
Integration test: Do a few more things with the MapiMessage
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1668485 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java')
-rw-r--r--src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
index 9de8b798c5..d68504a04c 100644
--- a/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
+++ b/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
@@ -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 POIFSFileHandler {
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");