You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2019/05/27 17:46:41 UTC

svn commit: r1860155 - in /poi/trunk/src: integrationtest/org/apache/poi/ integrationtest/org/apache/poi/stress/ scratchpad/src/org/apache/poi/hsmf/datatypes/ scratchpad/testcases/org/apache/poi/hsmf/

Author: fanningpj
Date: Mon May 27 17:46:41 2019
New Revision: 1860155

URL: http://svn.apache.org/viewvc?rev=1860155&view=rev
Log:
try to fix integration tests (by ignoring some new msg files)

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

Modified: poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java?rev=1860155&r1=1860154&r2=1860155&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java Mon May 27 17:46:41 2019
@@ -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(

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=1860155&r1=1860154&r2=1860155&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/HSMFFileHandler.java Mon May 27 17:46:41 2019
@@ -41,7 +41,7 @@ public class HSMFFileHandler extends POI
 
 		   DirectoryChunk chunkDirectory = attachment.getAttachmentDirectory();
 		   if(chunkDirectory != null) {
-			   MAPIMessage attachmentMSG = chunkDirectory.getAsEmbededMessage();
+			   MAPIMessage attachmentMSG = chunkDirectory.getAsEmbeddedMessage();
 			   assertNotNull(attachmentMSG);
 			   String body = attachmentMSG.getTextBody();
 			   assertNotNull(body);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java?rev=1860155&r1=1860154&r2=1860155&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java Mon May 27 17:46:41 2019
@@ -81,7 +81,7 @@ public class AttachmentChunks implements
      */
     public MAPIMessage getEmbeddedMessage() throws IOException {
         if (attachmentDirectory != null) {
-            return attachmentDirectory.getAsEmbededMessage();
+            return attachmentDirectory.getAsEmbeddedMessage();
         }
         return null;
     }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java?rev=1860155&r1=1860154&r2=1860155&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java Mon May 27 17:46:41 2019
@@ -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 Chun
     }
 
     /**
-     * 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);
     }
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java?rev=1860155&r1=1860154&r2=1860155&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java Mon May 27 17:46:41 2019
@@ -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());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org