use of org.eclipse.wst.xml.xpath2.processor.internal.ast.PrimaryExpr in project webtools.sourceediting by eclipse.
the class LiteralsTest method test_Literals022.
// Test for valid double literal.
public void test_Literals022() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals022.xq";
String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals022.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);
AnyType result = rs.first();
actual = result.getStringValue();
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error:", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.PrimaryExpr in project webtools.sourceediting by eclipse.
the class LiteralsTest method test_Literals055.
// Test for invalid double literal.
public void test_Literals055() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals055.xq";
String expectedResult = "XPST0003";
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);
AnyType result = rs.first();
actual = result.getStringValue();
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error:", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.PrimaryExpr in project webtools.sourceediting by eclipse.
the class LiteralsTest method test_Literals046.
// Test for invalid double literal.
public void test_Literals046() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals046.xq";
String expectedResult = "XPST0003";
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);
AnyType result = rs.first();
actual = result.getStringValue();
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error:", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.PrimaryExpr in project webtools.sourceediting by eclipse.
the class LiteralsTest method test_Literals052.
// Test for invalid double literal.
public void test_Literals052() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals052.xq";
String expectedResult = "XPST0003";
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);
AnyType result = rs.first();
actual = result.getStringValue();
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error:", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.PrimaryExpr in project webtools.sourceediting by eclipse.
the class LiteralsTest method test_Literals016.
// Test for valid double literal.
public void test_Literals016() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals016.xq";
String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals016.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);
AnyType result = rs.first();
actual = result.getStringValue();
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error:", expectedResult, actual);
}
Aggregations