use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class SeqZeroOrOneFuncTest method test_fn_zero_or_oneflt1args_3.
// Evaluates the "zero-or-one" function with the arguments set as follows: $arg = xs:float(upper bound).
public void test_fn_zero_or_oneflt1args_3() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-oneflt1args-3.xq";
String resultFile = "/ExpectedTestResults/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-oneflt1args-3.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 SeqZeroOrOneFuncTest method test_fn_zero_or_onelng1args_1.
// Evaluates the "zero-or-one" function with the arguments set as follows: $arg = xs:long(lower bound).
public void test_fn_zero_or_onelng1args_1() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-onelng1args-1.xq";
String resultFile = "/ExpectedTestResults/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-onelng1args-1.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 SeqZeroOrOneFuncTest method test_fn_zero_or_oneint1args_1.
// Evaluates the "zero-or-one" function with the arguments set as follows: $arg = xs:int(lower bound).
public void test_fn_zero_or_oneint1args_1() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-oneint1args-1.xq";
String resultFile = "/ExpectedTestResults/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-oneint1args-1.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 SeqZeroOrOneFuncTest method test_fn_zero_or_onesht1args_1.
// Evaluates the "zero-or-one" function with the arguments set as follows: $arg = xs:short(lower bound).
public void test_fn_zero_or_onesht1args_1() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-onesht1args-1.xq";
String resultFile = "/ExpectedTestResults/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-onesht1args-1.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 SeqZeroOrOneFuncTest method test_fn_zero_or_oneintg1args_3.
// Evaluates the "zero-or-one" function with the arguments set as follows: $arg = xs:integer(upper bound).
public void test_fn_zero_or_oneintg1args_3() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-oneintg1args-3.xq";
String resultFile = "/ExpectedTestResults/Functions/SeqFunc/CardinalitySeqFunc/SeqZeroOrOneFunc/fn-zero-or-oneintg1args-3.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