mirror of https://github.com/apache/poi.git
Add more test-files from bug 44501, all seem to work fine now
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1668369 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0850e7d846
commit
d6f8268e56
|
@ -19,10 +19,12 @@ package org.apache.poi.stress;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import org.apache.poi.hdgf.HDGFDiagram;
|
import org.apache.poi.hdgf.HDGFDiagram;
|
||||||
|
import org.apache.poi.hdgf.extractor.VisioTextExtractor;
|
||||||
import org.apache.poi.hdgf.streams.Stream;
|
import org.apache.poi.hdgf.streams.Stream;
|
||||||
import org.apache.poi.hdgf.streams.TrailerStream;
|
import org.apache.poi.hdgf.streams.TrailerStream;
|
||||||
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
||||||
|
@ -48,11 +50,27 @@ public class HDGFFileHandler extends POIFSFileHandler {
|
||||||
// a test-case to test this locally without executing the full TestAllFiles
|
// a test-case to test this locally without executing the full TestAllFiles
|
||||||
@Test
|
@Test
|
||||||
public void test() throws Exception {
|
public void test() throws Exception {
|
||||||
InputStream stream = new FileInputStream("test-data/diagram/44501.vsd");
|
File file = new File("test-data/diagram/44501.vsd");
|
||||||
|
|
||||||
|
InputStream stream = new FileInputStream(file);
|
||||||
try {
|
try {
|
||||||
handleFile(stream);
|
handleFile(stream);
|
||||||
} finally {
|
} finally {
|
||||||
stream.close();
|
stream.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleExtracting(file);
|
||||||
|
|
||||||
|
stream = new FileInputStream(file);
|
||||||
|
try {
|
||||||
|
VisioTextExtractor extractor = new VisioTextExtractor(stream);
|
||||||
|
try {
|
||||||
|
assertNotNull(extractor.getText());
|
||||||
|
} finally {
|
||||||
|
extractor.close();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
stream.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue