You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/08/09 14:50:15 UTC
svn commit: r1155339 - in /poi/trunk:
src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java
src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java
test-data/document/Bug41898.doc test-data/document/emf_2003_image.doc
Author: sergey
Date: Tue Aug 9 12:50:15 2011
New Revision: 1155339
URL: http://svn.apache.org/viewvc?rev=1155339&view=rev
Log:
rename emf_2003_image.doc to Bug41898.doc and move test to TestBugs class
Added:
poi/trunk/test-data/document/Bug41898.doc (with props)
Removed:
poi/trunk/test-data/document/emf_2003_image.doc
Modified:
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java?rev=1155339&r1=1155338&r2=1155339&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java Tue Aug 9 12:50:15 2011
@@ -21,6 +21,8 @@ import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
+import org.apache.poi.util.LittleEndian;
+
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.commons.codec.digest.DigestUtils;
@@ -150,6 +152,38 @@ public class TestBugs extends TestCase
}
/**
+ * [FAILING] 41898 - Word 2003 pictures cannot be extracted
+ */
+ public void Bug41898()
+ {
+ /*
+ * Commenting out this test case temporarily. The file emf_2003_image
+ * does not contain any pictures. Instead it has an office drawing
+ * object. Need to rewrite this test after revisiting the implementation
+ * of office drawing objects. -- (nick?)
+ */
+ HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug41898.doc" );
+ List<Picture> pics = doc.getPicturesTable().getAllPictures();
+
+ assertNotNull( pics );
+ assertEquals( 1, pics.size() );
+
+ Picture pic = pics.get( 0 );
+ assertNotNull( pic.suggestFileExtension() );
+ assertNotNull( pic.suggestFullFileName() );
+
+ // This one's tricky
+ // TODO: Fix once we've sorted bug #41898
+ assertNotNull( pic.getContent() );
+ assertNotNull( pic.getRawContent() );
+
+ // These are probably some sort of offset, need to figure them out
+ assertEquals( 4, pic.getSize() );
+ assertEquals( 0x80000000l, LittleEndian.getUInt( pic.getContent() ) );
+ assertEquals( 0x80000000l, LittleEndian.getUInt( pic.getRawContent() ) );
+ }
+
+ /**
* Bug 34898 - WordExtractor doesn't read the whole string from the file
*/
public void test34898()
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java?rev=1155339&r1=1155338&r2=1155339&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java Tue Aug 9 12:50:15 2011
@@ -108,36 +108,6 @@ public final class TestPictures extends
}
}
- /**
- * emf image, with a crazy offset
- */
- public void disabled_testEmfComplexImage() {
-
- // Commenting out this test case temporarily. The file emf_2003_image does not contain any
- // pictures. Instead it has an office drawing object. Need to rewrite this test after
- // revisiting the implementation of office drawing objects.
-
- HWPFDocument doc = HWPFTestDataSamples.openSampleFile("emf_2003_image.doc");
- List<Picture> pics = doc.getPicturesTable().getAllPictures();
-
- assertNotNull(pics);
- assertEquals(1, pics.size());
-
- Picture pic = pics.get(0);
- assertNotNull(pic.suggestFileExtension());
- assertNotNull(pic.suggestFullFileName());
-
- // This one's tricky
- // TODO: Fix once we've sorted bug #41898
- assertNotNull(pic.getContent());
- assertNotNull(pic.getRawContent());
-
- // These are probably some sort of offset, need to figure them out
- assertEquals(4, pic.getSize());
- assertEquals(0x80000000l, LittleEndian.getUInt(pic.getContent()));
- assertEquals(0x80000000l, LittleEndian.getUInt(pic.getRawContent()));
- }
-
public void testPicturesWithTable() {
HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug44603.doc");
Added: poi/trunk/test-data/document/Bug41898.doc
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/document/Bug41898.doc?rev=1155339&view=auto
==============================================================================
Binary file - no diff available.
Propchange: poi/trunk/test-data/document/Bug41898.doc
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org