|
|
@@ -18,6 +18,7 @@ package org.apache.poi.xdgf.extractor; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
import static org.apache.poi.POITestCase.assertContains; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
@@ -27,6 +28,7 @@ import org.apache.poi.openxml4j.opc.OPCPackage; |
|
|
|
import org.apache.poi.xdgf.usermodel.XmlVisioDocument; |
|
|
|
import org.junit.After; |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Ignore; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
public class TestXDGFVisioExtractor { |
|
|
@@ -72,7 +74,26 @@ public class TestXDGFVisioExtractor { |
|
|
|
is.close(); |
|
|
|
XDGFVisioExtractor extractor = new XDGFVisioExtractor(document); |
|
|
|
String text = extractor.getText(); |
|
|
|
assertTrue(text.indexOf("Arrears") > -1); |
|
|
|
assertContains(text, "Arrears"); |
|
|
|
extractor.close(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Currently failing with: |
|
|
|
* org.apache.poi.POIXMLException: Invalid 'Row_Type' name 'PolylineTo' |
|
|
|
* at org.apache.poi.xdgf.util.ObjectFactory.load |
|
|
|
* at org.apache.poi.xdgf.usermodel.section.geometry.GeometryRowFactory.load |
|
|
|
*/ |
|
|
|
@Test |
|
|
|
@Ignore("TODO Fix bug #60973") |
|
|
|
public void testPolylineTo() throws IOException { |
|
|
|
InputStream is = SAMPLES.openResourceAsStream("60973.vsdx"); |
|
|
|
XmlVisioDocument document = new XmlVisioDocument(is); |
|
|
|
is.close(); |
|
|
|
XDGFVisioExtractor extractor = new XDGFVisioExtractor(document); |
|
|
|
String text = extractor.getText(); |
|
|
|
assertContains(text, "42 U"); |
|
|
|
assertContains(text, "Access VLANS"); |
|
|
|
extractor.close(); |
|
|
|
} |
|
|
|
} |