use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testAnyUriEqualityBug.
public void testAnyUriEqualityBug() throws Exception {
// Bug 274719
// reusing the XML document from another bug
URL fileURL = bundle.getEntry("/bugTestFiles/bug274471.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = "xs:anyURI('abc') eq xs:anyURI('abc')";
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 testXSUnsignedByte.
public void testXSUnsignedByte() throws Exception {
// Bug 277650
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:unsignedByte is 0
// max value of xs:unsignedByte is 255
String xpath = "xs:unsignedByte('255') eq 255";
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.
public void testXPathInstanceOf5() 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 instance of element(x, x_Type)*";
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 testXPathInstanceOf3.
public void testXPathInstanceOf3() throws Exception {
// Bug 298267
URL fileURL = bundle.getEntry("/bugTestFiles/elementTypedValueBug.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/elementTypedValueBug.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "Example/Transportation/mode instance of element(mode, modeType)";
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 testBug280555_collations.
public void testBug280555_collations() throws Exception {
// Setup context
setupDynamicContext(null);
setCollationProvider(createLengthCollatorProvider());
// Parse expression
compileXPath(" 'abc' < 'de' ");
// Evaluate once
XSBoolean bval = (XSBoolean) evaluate(domDoc).first();
assertTrue("'abc' < 'de' for normal collations", bval.value());
// Evaluate again with the funny collator
setDefaultCollation(URN_X_ECLIPSE_XPATH20_FUNKY_COLLATOR);
XSBoolean bval2 = (XSBoolean) evaluate(domDoc).first();
assertFalse("'abc' < 'de' should be false for the strange collations", bval2.value());
}
Aggregations