use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class QNameEQTest method test_op_qname_equal_21.
// Evaluates the "op:qname-equal" operator used as an argument to the fn:not function. Uses the eq operator.
public void test_op_qname_equal_21() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/Operators/CompExpr/ValComp/QNameOp/QNameEQ/op-qname-equal-21.xq";
String resultFile = "/ExpectedTestResults/Expressions/Operators/CompExpr/ValComp/QNameOp/QNameEQ/op-qname-equal-21.txt";
String expectedResult = getExpectedResult(resultFile);
URL fileURL = bundle.getEntry(inputFile);
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = extractXPathExpression(xqFile, inputFile);
String actual = null;
try {
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
actual = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class QNameEQTest method test_op_qname_equal_22.
// Evaluates the "op:qname-equal" operator used as an argument to the fn:not function. Uses the ne operator.
public void test_op_qname_equal_22() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/Operators/CompExpr/ValComp/QNameOp/QNameEQ/op-qname-equal-22.xq";
String resultFile = "/ExpectedTestResults/Expressions/Operators/CompExpr/ValComp/QNameOp/QNameEQ/op-qname-equal-22.txt";
String expectedResult = getExpectedResult(resultFile);
URL fileURL = bundle.getEntry(inputFile);
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = extractXPathExpression(xqFile, inputFile);
String actual = null;
try {
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
actual = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class RangeExprTest method test_rangeExpr_9.
// Evaluation of a range expression, where the first operand is "xs:integer" function.
public void test_rangeExpr_9() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-9.xq";
String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-9.txt";
String expectedResult = getExpectedResult(resultFile);
URL fileURL = bundle.getEntry(inputFile);
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = extractXPathExpression(xqFile, inputFile);
String actual = null;
try {
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
actual = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class RangeExprTest method test_rangeExpr_4.
// Evaluation of a range expression that in conjunction with the "reverse" function.
public void test_rangeExpr_4() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-4.xq";
String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-4.txt";
String expectedResult = getExpectedResult(resultFile);
URL fileURL = bundle.getEntry(inputFile);
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = extractXPathExpression(xqFile, inputFile);
String actual = null;
try {
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
actual = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class RangeExprTest method test_rangeExpr_10.
// Evaluation of a range expression, where the second operand is "xs:integer" function.
public void test_rangeExpr_10() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-10.xq";
String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-10.txt";
String expectedResult = getExpectedResult(resultFile);
URL fileURL = bundle.getEntry(inputFile);
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = extractXPathExpression(xqFile, inputFile);
String actual = null;
try {
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
actual = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
Aggregations