use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testXPathInstanceOf4.
public void testXPathInstanceOf4() 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, abc)";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("false", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testXSNegativeInteger.
public void testXSNegativeInteger() throws Exception {
// Bug 277602
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:negativeInteger is -INF
// max value is -1
String xpath = "xs:negativeInteger('-1') eq -1";
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 testTypedValueEnhancement_BugUsingSeqIntoVariable_3.
public void testTypedValueEnhancement_BugUsingSeqIntoVariable_3() throws Exception {
// Bug 325262
setupDynamicContext(null);
ResultSequence rs = ResultSequenceFactory.create_new();
rs.add(new XSInteger(BigInteger.valueOf(2)));
rs.add(new XSInteger(BigInteger.valueOf(4)));
rs.add(new XSInteger(BigInteger.valueOf(6)));
setVariable("value", rs);
String xpath = "count(data($value)) = 3";
compileXPath(xpath);
ResultSequence rsRes = evaluate(domDoc);
XSBoolean result = (XSBoolean) rsRes.get(0);
assertEquals("true", result.getStringValue());
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testXPathInstanceOf6.
public void testXPathInstanceOf6() 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_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 testLongDataType.
public void testLongDataType() throws Exception {
// Bug 274952
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);
// long min value is -9223372036854775808
// and max value can be 9223372036854775807
String xpath = "xs:long('9223372036854775807') gt 0";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
Aggregations