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
f9961331ff
commit
dad8d1547c
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
test-data/diagram/44501a.vsd
Executable file
BIN
test-data/diagram/44501a.vsd
Executable file
Binary file not shown.
BIN
test-data/diagram/44501b.vsd
Executable file
BIN
test-data/diagram/44501b.vsd
Executable file
Binary file not shown.
BIN
test-data/diagram/44501c.vsd
Normal file
BIN
test-data/diagram/44501c.vsd
Normal file
Binary file not shown.
BIN
test-data/diagram/44501d.vsd
Executable file
BIN
test-data/diagram/44501d.vsd
Executable file
Binary file not shown.
BIN
test-data/diagram/44501e.vsd
Normal file
BIN
test-data/diagram/44501e.vsd
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user