use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testNormalizeSpaceFunctionBug274471.
public void testNormalizeSpaceFunctionBug274471() throws Exception {
// Bug 274471. normalize-space() with arity 0
URL fileURL = bundle.getEntry("/bugTestFiles/bug274471.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = "x/normalize-space() = 'unhappy'";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testXPathInstanceOf5_3.
public void testXPathInstanceOf5_3() throws Exception {
// Bug 298267
URL fileURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "(/Example/x, /Example/x) instance of element(x, x_Type)";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
assertFalse(result.value());
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testSchemaAwarenessForElements.
public void testSchemaAwarenessForElements() throws Exception {
// Bug 276134
URL fileURL = bundle.getEntry("/bugTestFiles/bug276134_2.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/bug276134_2.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "person/dob eq xs:date('2006-12-10')";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testBooleanTypeBug.
public void testBooleanTypeBug() throws Exception {
// Bug 274784
// reusing the XML document from another bug
URL fileURL = bundle.getEntry("/bugTestFiles/bug273719.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = "xs:boolean('1') eq xs:boolean('true')";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testXSShort.
public void testXSShort() throws Exception {
// Bug 277608
bundle = Platform.getBundle("org.w3c.xqts.testsuite");
URL fileURL = bundle.getEntry("/TestSources/emptydoc.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
// min value of xs:short is -32768
// max value of xs:short is 32767
String xpath = "xs:short('-32768') eq -32768";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
Aggregations