diff options
author | Maxim Valyanskiy <maxcom@apache.org> | 2010-07-07 10:41:17 +0000 |
---|---|---|
committer | Maxim Valyanskiy <maxcom@apache.org> | 2010-07-07 10:41:17 +0000 |
commit | d7c62aae580de7eea4c485094ac6e9af88d0c261 (patch) | |
tree | 20dafd4b16a96f860d5f74075b3e60ddb8de0a44 /src | |
parent | 06b37ca45bb8192b2965942fd1d7f9dca73b0b85 (diff) | |
download | poi-d7c62aae580de7eea4c485094ac6e9af88d0c261.tar.gz poi-d7c62aae580de7eea4c485094ac6e9af88d0c261.zip |
HWPF: test auto-saved document
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@961342 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java | 10 | ||||
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java b/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java index eabb16b7c8..22eaf0ade4 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java @@ -288,4 +288,14 @@ public final class TestWordExtractor extends TestCase { assertEquals(1, tp.length); assertEquals("The quick brown fox jumps over the lazy dog\r\n", tp[0]); } + + public void testFastSaved() throws Exception { + extractor = new WordExtractor( + POIDataSamples.getDocumentInstance().openResourceAsStream("rasp.doc") + ); + + String text = extractor.getText(); + assertTrue(text.contains("\u0425\u0425\u0425\u0425\u0425")); + assertTrue(text.contains("\u0423\u0423\u0423\u0423\u0423")); + } } diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java index 897ca86f1c..05013b07fb 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestPictures.java @@ -141,14 +141,20 @@ public final class TestPictures extends TestCase { HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug44603.doc"); List pics = doc.getPicturesTable().getAllPictures(); - assertEquals(pics.size(), 2); + assertEquals(2, pics.size()); } public void testPicturesInHeader() { HWPFDocument doc = HWPFTestDataSamples.openSampleFile("header_image.doc"); List pics = doc.getPicturesTable().getAllPictures(); - assertEquals(pics.size(), 2); + assertEquals(2, pics.size()); } + public void testFastSaved() { + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("rasp.doc"); + + doc.getPicturesTable().getAllPictures(); // just check that we do not throw Exception + } + } |