]> source.dussan.org Git - poi.git/commitdiff
try to fix integration tests (by ignoring some new msg files)
authorPJ Fanning <fanningpj@apache.org>
Mon, 27 May 2019 17:46:41 +0000 (17:46 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 27 May 2019 17:46:41 +0000 (17:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1860155 13f79535-47bb-0310-9956-ffa450edef68

src/integrationtest/org/apache/poi/TestAllFiles.java
src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java
src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java
src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java
src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java

index 6daf088ac34f0bdc639a0d51c872222e69126458..1cb87a655275f2f9c3f1679e5407723411335f62 100644 (file)
@@ -340,7 +340,14 @@ public class TestAllFiles {
 
         // sheet cloning errors
         "spreadsheet/56450.xls",
-        "spreadsheet/OddStyleRecord.xls"
+        "spreadsheet/OddStyleRecord.xls",
+
+        // msg files with non-standard encodings
+        "hsmf/ASCII_CP1251_LCID1049.msg",
+        "hsmf/ASCII_UTF-8_CP1252_LCID1031.msg",
+        "hsmf/ASCII_UTF-8_CP1252_LCID1031_HTML.msg",
+        "hsmf/HTMLBodyBinary_CP1251.msg",
+        "hsmf/HTMLBodyBinary_UTF-8.msg"
     );
 
     private static final Set<String> IGNORED = unmodifiableHashSet(
index 2aa02ed37360ccd9b3d904d5520fc171abee67d9..212904308b6f650a2fd232bf7cb1ab011c082a60 100644 (file)
@@ -41,7 +41,7 @@ public class HSMFFileHandler extends POIFSFileHandler {
 
                   DirectoryChunk chunkDirectory = attachment.getAttachmentDirectory();
                   if(chunkDirectory != null) {
-                          MAPIMessage attachmentMSG = chunkDirectory.getAsEmbededMessage();
+                          MAPIMessage attachmentMSG = chunkDirectory.getAsEmbeddedMessage();
                           assertNotNull(attachmentMSG);
                           String body = attachmentMSG.getTextBody();
                           assertNotNull(body);
index 3989af28f0caa1419e1dbd2fa41ed34c83cb41d8..9e31294c514830ba60afcdf06012c8d2eb96a800 100644 (file)
@@ -81,7 +81,7 @@ public class AttachmentChunks implements ChunkGroup {
      */
     public MAPIMessage getEmbeddedMessage() throws IOException {
         if (attachmentDirectory != null) {
-            return attachmentDirectory.getAsEmbededMessage();
+            return attachmentDirectory.getAsEmbeddedMessage();
         }
         return null;
     }
index 2be65a93d56fffa91028c72a0c226741e589ba12..6a12894998217b992bbb639ce01560dfa46f1fe3 100644 (file)
@@ -23,6 +23,7 @@ import java.io.OutputStream;
 import org.apache.poi.hsmf.MAPIMessage;
 import org.apache.poi.hsmf.datatypes.Types.MAPIType;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
+import org.apache.poi.util.Removal;
 
 /**
  * A Chunk that is just a placeholder in the MAPIMessage directory structure,
@@ -45,10 +46,24 @@ public class DirectoryChunk extends Chunk {
     }
 
     /**
-     * Treats the directory as an embeded MAPIMessage (it normally is one), and
+     * Treats the directory as an embedded MAPIMessage (it normally is one), and
      * returns a MAPIMessage object to process it with.
+     *
+     * @deprecated use {@link #getAsEmbeddedMessage()} instead
      */
+    @Removal(version = "4.3")
+    @Deprecated
     public MAPIMessage getAsEmbededMessage() throws IOException {
+        return getAsEmbeddedMessage();
+    }
+
+    /**
+     * Treats the directory as an embedded MAPIMessage (it normally is one), and
+     * returns a MAPIMessage object to process it with.
+     *
+     * @since 4.1.1
+     */
+    public MAPIMessage getAsEmbeddedMessage() throws IOException {
         return new MAPIMessage(dir);
     }
 
index 004fadd39ceb53ad38fff1ad98fb11cada5d538b..100c4505bc5cb18ed1ce7d3c8e8c590d15a451d5 100644 (file)
@@ -173,7 +173,7 @@ public class TestFileWithAttachmentsRead {
         assertNotNull(attachment.getAttachmentDirectory());
         
         // Check we can see some bits of it
-        MAPIMessage nested = attachment.getAttachmentDirectory().getAsEmbededMessage();
+        MAPIMessage nested = attachment.getAttachmentDirectory().getAsEmbeddedMessage();
         assertEquals(1, nested.getRecipientNamesList().length);
         assertEquals("Nick Booth", nested.getRecipientNames());
         assertEquals("Test Attachment", nested.getConversationTopic());