Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIBM_ADMIN2014-05-15 12:27:14 +0000
committerIBM_ADMIN2014-05-15 12:27:14 +0000
commit93f0343fde5138153672c692d540315ced3a1a78 (patch)
tree84060158df86bdc2a76158b132281e3f7e95032d
parented6ab1e8673f4ee76b9c7545fedb9686fe38e9c3 (diff)
downloadwebtools.sourceediting.xpath.tests-93f0343fde5138153672c692d540315ced3a1a78.tar.gz
webtools.sourceediting.xpath.tests-93f0343fde5138153672c692d540315ced3a1a78.tar.xz
webtools.sourceediting.xpath.tests-93f0343fde5138153672c692d540315ced3a1a78.zip
[xpath2] adding a test case to support a bug fix
-rw-r--r--tests/org.eclipse.wst.xml.xpath2.processor.tests/bugTestFiles/dashboard.xml25
-rw-r--r--tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/test/TestBugs.java21
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/org.eclipse.wst.xml.xpath2.processor.tests/bugTestFiles/dashboard.xml b/tests/org.eclipse.wst.xml.xpath2.processor.tests/bugTestFiles/dashboard.xml
new file mode 100644
index 00000000..9954ae01
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.processor.tests/bugTestFiles/dashboard.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dashboard>
+ <widget type="chart">
+ <title text="Chart Title"></title>
+ <plotOptions xmlns="http://jaspersoft.com/highcharts">
+ <plotOptions>
+ <pie showInLegend="true" shadow="false" innerSize="50%">
+ <dataLabels color="#fff" distance="-20" format="{point.percentage:.0f} %" overflow="false"></dataLabels>
+ </pie>
+ </plotOptions>
+ <legend width="150" align="right" x="10" layout="vertical">
+ <navigation></navigation>
+ </legend>
+ <tooltip enabled="false"></tooltip>
+ <exporting enabled="true"></exporting>
+ </plotOptions>
+ </widget>
+ <widget type="table">
+ <title>table</title>
+ <table xmlns="http://www.w3.org/1999/xhtml">
+ <thead>dsds</thead>
+ <tbody>dsds</tbody>
+ </table>
+ </widget>
+</dashboard>
diff --git a/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/test/TestBugs.java b/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/test/TestBugs.java
index 9f6da89b..bb5ff3e3 100644
--- a/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/test/TestBugs.java
+++ b/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/test/TestBugs.java
@@ -2957,6 +2957,27 @@ public class TestBugs extends AbstractPsychoPathTest {
}
+ public void testXSAnyURI_bug() throws Exception {
+
+ URL fileURL = bundle.getEntry("/bugTestFiles/dashboard.xml");
+ loadDOMDocument(fileURL);
+
+ // Get XML Schema Information for the Document
+ XSModel schema = getGrammar();
+
+ DynamicContext dc = setupDynamicContext(schema);
+
+ String xpath = "count(/dashboard/widget/*[namespace-uri() eq 'http://jaspersoft.com/highcharts']) eq 1";
+ XPath path = compileXPath(dc, xpath);
+ Evaluator eval = new DefaultEvaluator(dc, domDoc);
+ ResultSequence rs = eval.evaluate(path);
+ XSBoolean result = (XSBoolean) rs.first();
+ String actual = result.string_value();
+ assertEquals("true", actual);
+ }
+
+
+
private CollationProvider createLengthCollatorProvider() {
return new CollationProvider() {
@SuppressWarnings("unchecked")

Back to the top