use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testAttrNode_Test4.
public void testAttrNode_Test4() throws Exception {
// Bug 298535
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[1]/@mesg instance of attribute(*, 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 testXSByte.
public void testXSByte() throws Exception {
// Bug 277639
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:byte is -128
// max value of xs:byte is 127
String xpath = "xs:byte('-128') eq -128";
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 testBug338999_Fnsubsequence.
public void testBug338999_Fnsubsequence() throws Exception {
// bug 338999
URL fileURL = bundle.getEntry("/bugTestFiles/bug338999.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/bug338999.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
// test a)
String xpath = "count(subsequence(X/*, 2)) eq 2";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
String actual = ((XSBoolean) rs.first()).getStringValue();
assertEquals("true", actual);
// test b)
xpath = "subsequence(X/*, 2) instance of element(*, xs:integer)+";
compileXPath(xpath);
rs = evaluate(domDoc);
actual = ((XSBoolean) rs.first()).getStringValue();
assertEquals("true", actual);
// test c)
xpath = "deep-equal(subsequence((1,2,3,4), 2), (2,3,4))";
compileXPath(xpath);
rs = evaluate(domDoc);
actual = ((XSBoolean) rs.first()).getStringValue();
assertEquals("true", actual);
// test d)
// hetrogeneous sequence as input. arity 3 mode.
xpath = "deep-equal(subsequence(('a', 1, 1.5), 2, 2), (1, 1.5))";
compileXPath(xpath);
rs = evaluate(domDoc);
actual = ((XSBoolean) rs.first()).getStringValue();
assertEquals("true", actual);
// test e)
// hetrogeneous sequence as input. arity 3 mode (startingLoc is < 0).
xpath = "deep-equal(subsequence(('a', 1, 1.5, 'b'), -2, 3), ())";
compileXPath(xpath);
rs = evaluate(domDoc);
actual = ((XSBoolean) rs.first()).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 testXPathInstanceOf7.
public void testXPathInstanceOf7() 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 testIntDataType.
public void testIntDataType() throws Exception {
// Bug 275105
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);
// int min value is -2147483648
// and max value can be 2147483647
String xpath = "xs:int('2147483647') gt 0";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
Aggregations