### Eclipse Workspace Patch 1.0 #P org.eclipse.wst.xml.xpath2.processor.tests Index: src/org/eclipse/wst/xml/xpath2/processor/test/AbstractPsychoPathTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/test/AbstractPsychoPathTest.java,v retrieving revision 1.2 diff -u -r1.2 AbstractPsychoPathTest.java --- src/org/eclipse/wst/xml/xpath2/processor/test/AbstractPsychoPathTest.java 27 Apr 2009 15:07:18 -0000 1.2 +++ src/org/eclipse/wst/xml/xpath2/processor/test/AbstractPsychoPathTest.java 3 May 2009 00:40:53 -0000 @@ -7,11 +7,18 @@ * * Contributors: * David Carver (STAR) - initial API and implementation + * Jin Mingjan - bug 262765 - extractXPathExpression and getExpectedResults *******************************************************************************/ package org.eclipse.wst.xml.xpath2.processor.test; + + import java.io.*; import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.apache.xerces.xs.ElementPSVI; import org.apache.xerces.xs.XSModel; @@ -20,6 +27,9 @@ import org.eclipse.wst.xml.xpath2.processor.ast.*; import org.eclipse.wst.xml.xpath2.processor.function.*; import org.eclipse.wst.xml.xpath2.processor.internal.function.XDTCtrLibrary; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.internal.types.ElementType; +import org.eclipse.wst.xml.xpath2.processor.internal.types.QName; import org.osgi.framework.Bundle; import org.w3c.dom.Document; @@ -29,6 +39,17 @@ protected Document domDoc = null; protected Bundle bundle = null; + + private static final String INPUT_CONTEXT = "input-context"; + private static final String INPUT_CONTEXT1 = "input-context1"; + private static final String INPUT_CONTEXT2 = "input-context2"; +// private static final String S_COMMENT1 = "(:"; + private static final String S_COMMENT2 = ":)"; + private static final String DECLARE_NAMESPACE = "declare namespace"; + private static final String DECLARE_VARIABLE = "declare variable"; + private static final String REGEX_DN = "declare namespace\\s+(\\w[-_\\w]*)\\s*=\\s*['\"]([^;]*)['\"];"; + private static HashMap namespaceMap = new HashMap(3); + private static HashMap inputMap = new HashMap(3); @Override protected void setUp() throws Exception { @@ -59,12 +80,16 @@ protected DynamicContext setupDynamicContext(XSModel schema) { DynamicContext dc = new DefaultDynamicContext(schema, domDoc); - dc.add_namespace("xsd", "http://www.w3.org/2001/XMLSchema"); + dc.add_namespace("xs", "http://www.w3.org/2001/XMLSchema"); dc.add_namespace("xdt", "http://www.w3.org/2004/10/xpath-datatypes"); + dc.add_namespace("fn", "http://www.w3.org/2004/10/xpath-functions");//XXX:PP FunctionLibrary ns bug + dc.add_namespace("local", "http://www.w3.org/2005/xquery-local-functions"); + dc.add_function_library(new FnFunctionLibrary()); dc.add_function_library(new XSCtrLibrary()); dc.add_function_library(new XDTCtrLibrary()); + setupVariables(dc); return dc; } @@ -77,5 +102,118 @@ name_check.check(path); return path; } + + protected String getExpectedResult(String xqFile){ + String resultFile = xqFile; + // + if (resultFile.length()<10) { //<9 enough? like XPST0001 + return resultFile; + } + String content=""; + // + InputStream isrf; + try { + isrf = bundle.getEntry(resultFile).openStream(); + BufferedReader rfreader = new BufferedReader(new InputStreamReader(isrf)); + //XXX:assume char buffer 2048 is long enough;1024 maybe enough + //Exception: Axes085, NodeTest003/04/05,... + int bufferLength = 2048; + if ((resultFile.indexOf("Axes085") != -1) + || (resultFile.indexOf("NodeTest003") != -1) + || (resultFile.indexOf("NodeTest004") != -1) + || (resultFile.indexOf("NodeTest005") != -1)) { + bufferLength = 40000; + }else if(resultFile.indexOf("ForExpr013") != -1) { + bufferLength = 433500; + }else if(resultFile.indexOf("ForExpr016") != -1 + || (resultFile.indexOf("ReturnExpr011") != -1) + || (resultFile.indexOf("sgml-queries-results-q1") != -1) + || (resultFile.indexOf("sgml-queries-results-q2") != -1)) { + bufferLength = 10240; + } + char[] cbuf = new char[bufferLength]; + int nByte = rfreader.read(cbuf); + assertTrue(resultFile,nByte iterator = rs.iterator(); + while (iterator.hasNext()) { + AnyType anyType = iterator.next(); + actual = actual + anyType.string_value() + " "; + } + + return actual.trim(); + } + } Index: createXPath2Junit3Test.xsl =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.xml.xpath2.processor.tests/createXPath2Junit3Test.xsl,v retrieving revision 1.1 diff -u -r1.1 createXPath2Junit3Test.xsl --- createXPath2Junit3Test.xsl 29 Apr 2009 04:28:11 -0000 1.1 +++ createXPath2Junit3Test.xsl 3 May 2009 00:40:53 -0000 @@ -18,21 +18,29 @@ /Queries/XQuery - SequenceTypeSyntax + DayTimeDurationDivideDTD +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ package org.eclipse.wst.xml.xpath2.processor.testsuite; import java.net.URL; import org.apache.xerces.xs.XSModel; -import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator; -import org.eclipse.wst.xml.xpath2.processor.DynamicContext; -import org.eclipse.wst.xml.xpath2.processor.Evaluator; -import org.eclipse.wst.xml.xpath2.processor.ResultSequence; +import org.eclipse.wst.xml.xpath2.processor.*; import org.eclipse.wst.xml.xpath2.processor.ast.XPath; -import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; @@ -42,7 +50,7 @@ public class - extends AbstractPsychoPathTest { + Test extends AbstractPsychoPathTest { @@ -65,7 +73,7 @@ // - public void + public void test_ @@ -74,8 +82,12 @@ - throws Exception { - URL fileURL = bundle.getEntry("/bugTestFiles/bug273719.xml"); + () throws Exception { + + + + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); loadDOMDocument(fileURL); // Get XML Schema Information for the Document @@ -83,17 +95,25 @@ DynamicContext dc = setupDynamicContext(schema); - String xpath = "string-length(x) > 2"; - XPath path = compileXPath(dc, xpath); - - Evaluator eval = new DefaultEvaluator(dc, domDoc); - ResultSequence rs = eval.evaluate(path); - - XSBoolean result = (XSBoolean) rs.first(); - - String actual = result.string_value(); + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + actual = buildResultString(rs); + + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } catch (DynamicError ex) { + actual = ex.code(); + } - assertEquals("true", actual); + assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual); @@ -102,6 +122,22 @@ + + String inputFile = "/TestSources/ + + .xml"; + + String xqFile = "/Queries/XQuery/ + + + .xq"; + + String resultFile = "/ExpectedTestResults/ + + + "; + + Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class YearMonthDurationDivideTest extends AbstractPsychoPathTest { + + //Evaluates the "op:divide-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:double(lower bound). + public void test_op_divide_yearMonthDuration2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(mid range) $arg2 = xs:double(lower bound). + public void test_op_divide_yearMonthDuration2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(upper bound) $arg2 = xs:double(lower bound). + public void test_op_divide_yearMonthDuration2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:double(mid range). + public void test_op_divide_yearMonthDuration2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:double(upper bound). + public void test_op_divide_yearMonthDuration2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_divide_yearMonthDuration_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_divide_yearMonthDuration_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_divide_yearMonthDuration_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator used in conjunction with the "fn:not" function. + public void test_op_divide_yearMonthDuration_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator as an argument to the "fn:boolean" function. + public void test_op_divide_yearMonthDuration_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator as an argument to the "fn:number" function. + public void test_op_divide_yearMonthDuration_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator as an argument to the "fn:string" function. + public void test_op_divide_yearMonthDuration_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator that returns a negative value. + public void test_op_divide_yearMonthDuration_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator, which is part of an "and" expression. + public void test_op_divide_yearMonthDuration_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" operator as part of an "or" expression. + public void test_op_divide_yearMonthDuration_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" function, which is part of a div expression. + public void test_op_divide_yearMonthDuration_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_divide_yearMonthDuration_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" function, which is part of a numeric-equal expression (eq operator). + public void test_op_divide_yearMonthDuration_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" function, which is part of a numeric-equal expression (ne operator). + public void test_op_divide_yearMonthDuration_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" function, which is part of a numeric-equal expression (le operator). + public void test_op_divide_yearMonthDuration_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration" function, which is part of a numeric-equal expression (ge operator). + public void test_op_divide_yearMonthDuration_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivide/op-divide-yearMonthDuration-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationMultiplyTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationMultiplyTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationMultiplyTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationMultiplyTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,877 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class DayTimeDurationMultiplyTest extends AbstractPsychoPathTest { + + //Evaluates the "op:multiply-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:double(lower bound). + public void test_op_multiply_dayTimeDuration2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(mid range) $arg2 = xs:double(lower bound). + public void test_op_multiply_dayTimeDuration2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(upper bound) $arg2 = xs:double(lower bound). + public void test_op_multiply_dayTimeDuration2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:double(mid range). + public void test_op_multiply_dayTimeDuration2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:double(upper bound). + public void test_op_multiply_dayTimeDuration2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_multiply_dayTimeDuration_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_multiply_dayTimeDuration_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_multiply_dayTimeDuration_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator used in conjunction with the "fn:not" function. + public void test_op_multiply_dayTimeDuration_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator as an argument to the "fn:boolean" function. + public void test_op_multiply_dayTimeDuration_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator as an argument to the "fn:number" function. + public void test_op_multiply_dayTimeDuration_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator as an argument to the "fn:string" function. + public void test_op_multiply_dayTimeDuration_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator that returns a negative value. + public void test_op_multiply_dayTimeDuration_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator, which is part of an "and" expression. + public void test_op_multiply_dayTimeDuration_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator as part of an "or" expression. + public void test_op_multiply_dayTimeDuration_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" function, which is part of a div expression. + public void test_op_multiply_dayTimeDuration_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_multiply_dayTimeDuration_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" function, which is part of a numeric-equal expression (eq operator). + public void test_op_multiply_dayTimeDuration_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" function, which is part of a numeric-equal expression (ne operator). + public void test_op_multiply_dayTimeDuration_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" function, which is part of a numeric-equal expression (le operator). + public void test_op_multiply_dayTimeDuration_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" function, which is part of a numeric-equal expression (ge operator). + public void test_op_multiply_dayTimeDuration_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator multiplied by -0. + public void test_op_multiply_dayTimeDuration_17() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-dayTimeDuration" operator multiplied by -0. + public void test_op_multiply_dayTimeDuration_18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationMultiply/op-multiply-dayTimeDuration-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/AbbrAxesTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/AbbrAxesTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/AbbrAxesTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/AbbrAxesTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class AbbrAxesTest extends AbstractPsychoPathTest { + + //Evaluates abbreviated syntax, "hours". Selects the "hours" element children of the context node. + public void test_abbreviatedSyntax_1() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "text()". Selects all text node children of the context node. + public void test_abbreviatedSyntax_2() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "@name". Selects the name attribute of the context node. + public void test_abbreviatedSyntax_3() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[1]". Selects the first employee child of the context node. + public void test_abbreviatedSyntax_5() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "para[fn:last()]". Selects the last employee child of the context node. + public void test_abbreviatedSyntax_6() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "*/hours". Selects all hours grandchildren of the context node. + public void test_abbreviatedSyntax_7() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "/works/employee[5]/hours[2]". Selects the second hours of the fifth employee of the book whose parent is the document node that contains the context node. + public void test_abbreviatedSyntax_8() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee//hours". Selects the hours element descendants of the employee element children of the context node. + public void test_abbreviatedSyntax_9() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "//hours". Selects all the hours descendants of the root document node and thus selects all hours elements in the same document as the context node. + public void test_abbreviatedSyntax_10() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "//overtime/day". Selects all the day elements in the same document as the context node that have an overtime parent. + public void test_abbreviatedSyntax_12() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, ".//day". Selects the day element descendants of the context node. + public void test_abbreviatedSyntax_13() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "..". Selects the parent of the context node. + public void test_abbreviatedSyntax_14() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[@name="Jane Doe 11"]". Selects all employee children of the context node that have a name attribute with a value "Jane Doe 11". + public void test_abbreviatedSyntax_16() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[@gender="female"][5]". Selects the fifth element child of the context node that has a gender attribute with value "female". + public void test_abbreviatedSyntax_17() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[5][@gender="female"]". Selects the fifth employee child of the context node if that child has a gender attribute with value "female". + public void test_abbreviatedSyntax_18() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[status="active"]". Selects the employee children of the context node that have one or more status children whose typed value is equal to the string "active". + public void test_abbreviatedSyntax_19() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[overtime]". Selects the employee children of the context node that have one or more overtime children. + public void test_abbreviatedSyntax_20() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[@name and @type]". Selects all the employee children of the context node that have both a name attribute and a type attribute. + public void test_abbreviatedSyntax_21() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee/(status|overtime)/day". Selects every day element that has a parent that is either a status or an overime element, that in turn is a child of an employee element that is a child of the context node. + public void test_abbreviatedSyntax_22() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-22.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee/(status|overtime)/day". Selects every day element that has a parent that is either a status or an overime element, that in turn is a child of an employee element that is a child of the context node. Uses "union" Operator. + public void test_abbreviatedSyntax_24() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-24.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-24.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates abbreviated syntax, "employee[@name=condition or @type=condition]". Selects all the employee children of the context node that have both a name attribute and a type attribute. Uses the "or" operator. + public void test_abbreviatedSyntax_25() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-25.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-25.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/InternalContextExprTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/InternalContextExprTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/InternalContextExprTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/InternalContextExprTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class InternalContextExprTest extends AbstractPsychoPathTest { + + //Context Item expression that just uses the "." and no context item defined. + public void test_internalcontextitem_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is used as a string. + public void test_internalcontextitem_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is used as an integer. + public void test_internalcontextitem_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is used as a decimal. + public void test_internalcontextitem_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is used as a float. + public void test_internalcontextitem_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is used as a double. + public void test_internalcontextitem_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is used as a boolean value. + public void test_internalcontextitem_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is used as aboolean with fn:not. + public void test_internalcontextitem_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item is the empty sequence. + public void test_internalcontextitem_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of addition operation. + public void test_internalcontextitem_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of a subtraction operation. + public void test_internalcontextitem_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of a multiplication operation. + public void test_internalcontextitem_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of a modulus operation. + public void test_internalcontextitem_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of a divison (div operator) operation. + public void test_internalcontextitem_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of a divison (idiv operator) operation. + public void test_internalcontextitem_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of a boolean expression (and operator). + public void test_internalcontextitem_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as part of a boolean expression (or operator). + public void test_internalcontextitem_17() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as argument to string-length function. + public void test_internalcontextitem_18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as argument to "avg" function. + public void test_internalcontextitem_19() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as argument to "min" function. + public void test_internalcontextitem_20() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of Internal context item expression where context item used as argument to "max" function. + public void test_internalcontextitem_21() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/InternalContextExpr/internalcontextitem-21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericIntegerDivideTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericIntegerDivideTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericIntegerDivideTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericIntegerDivideTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1876 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericIntegerDivideTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(lower bound). + public void test_op_numeric_integer_divideint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:int(mid range) $arg2 = xs:int(lower bound). + public void test_op_numeric_integer_divideint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:int(upper bound) $arg2 = xs:int(lower bound). + public void test_op_numeric_integer_divideint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(mid range). + public void test_op_numeric_integer_divideint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(upper bound). + public void test_op_numeric_integer_divideint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(lower bound). + public void test_op_numeric_integer_divideintg2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:integer(mid range) $arg2 = xs:integer(lower bound). + public void test_op_numeric_integer_divideintg2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:integer(upper bound) $arg2 = xs:integer(lower bound). + public void test_op_numeric_integer_divideintg2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(mid range). + public void test_op_numeric_integer_divideintg2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(upper bound). + public void test_op_numeric_integer_divideintg2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideintg2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_integer_dividedec2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:decimal(mid range) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_integer_dividedec2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:decimal(upper bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_integer_dividedec2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(mid range). + public void test_op_numeric_integer_dividedec2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(upper bound). + public void test_op_numeric_integer_dividedec2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividedec2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(lower bound). + public void test_op_numeric_integer_dividelng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:long(mid range) $arg2 = xs:long(lower bound). + public void test_op_numeric_integer_dividelng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:long(upper bound) $arg2 = xs:long(lower bound). + public void test_op_numeric_integer_dividelng2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(mid range). + public void test_op_numeric_integer_dividelng2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(upper bound). + public void test_op_numeric_integer_dividelng2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividelng2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(mid range). + public void test_op_numeric_integer_divideusht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideusht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideusht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(upper bound). + public void test_op_numeric_integer_divideusht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideusht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideusht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_integer_dividenint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(mid range) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_integer_dividenint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(upper bound) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_integer_dividenint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(mid range). + public void test_op_numeric_integer_dividenint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(upper bound). + public void test_op_numeric_integer_dividenint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_integer_dividepint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(mid range) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_integer_dividepint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(upper bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_integer_dividepint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(mid range). + public void test_op_numeric_integer_dividepint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(upper bound). + public void test_op_numeric_integer_dividepint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividepint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(mid range). + public void test_op_numeric_integer_divideulng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideulng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideulng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(upper bound). + public void test_op_numeric_integer_divideulng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideulng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divideulng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_integer_dividenpi2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(mid range) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_integer_dividenpi2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(upper bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_integer_dividenpi2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(mid range). + public void test_op_numeric_integer_dividenpi2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenpi2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(mid range). + public void test_op_numeric_integer_dividenni2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenni2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenni2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_integer_dividenni2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenni2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividenni2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(lower bound). + public void test_op_numeric_integer_dividesht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:short(mid range) $arg2 = xs:short(lower bound). + public void test_op_numeric_integer_dividesht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:short(upper bound) $arg2 = xs:short(lower bound). + public void test_op_numeric_integer_dividesht2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(mid range). + public void test_op_numeric_integer_dividesht2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-integer-divide" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(upper bound). + public void test_op_numeric_integer_dividesht2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividesht2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple integer division test with () as one operand should return null. + public void test_op_numeric_integer_dividemix2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividemix2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividemix2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple integer division test pass string for second operator. + public void test_op_numeric_integer_dividemix2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividemix2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple integer division test, second operator cast string to integer. + public void test_op_numeric_integer_dividemix2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividemix2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividemix2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //If the divisor is zeri, then an error is raised. + public void test_op_numeric_integer_dividemix2args_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-dividemix2args-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of "numeric-integer-divide" operator when one operand is set to NaN. + public void test_op_numeric_integer_divide_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/op-numeric-integer-divide-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericIntegerDivide/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationSubtractTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationSubtractTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationSubtractTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationSubtractTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class DayTimeDurationSubtractTest extends AbstractPsychoPathTest { + + //Evaluates the "op:subtract-dayTimeDurations" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_subtract_dayTimeDurations2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(mid range) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_subtract_dayTimeDurations2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(upper bound) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_subtract_dayTimeDurations2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(mid range). + public void test_op_subtract_dayTimeDurations2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(upper bound). + public void test_op_subtract_dayTimeDurations2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_subtract_dayTimeDurations_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_subtract_dayTimeDurations_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_subtract_dayTimeDurations_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator used in conjunction with the "fn:not" function. + public void test_op_subtract_dayTimeDurations_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator as an argument to the "fn:boolean" function. + public void test_op_subtract_dayTimeDurations_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator as an argument to the "fn:number" function. + public void test_op_subtract_dayTimeDurations_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator as an argument to the "fn:string" function. + public void test_op_subtract_dayTimeDurations_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator that returns a negative value. + public void test_op_subtract_dayTimeDurations_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator, which is part of an "and" expression. + public void test_op_subtract_dayTimeDurations_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" operator as part of an "or" expression. + public void test_op_subtract_dayTimeDurations_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" function, which is part of a div expression. + public void test_op_subtract_dayTimeDurations_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_subtract_dayTimeDurations_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" function, which is part of a numeric-equal expression (eq operator). + public void test_op_subtract_dayTimeDurations_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" function, which is part of a numeric-equal expression (ne operator). + public void test_op_subtract_dayTimeDurations_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" function, which is part of a numeric-equal expression (le operator). + public void test_op_subtract_dayTimeDurations_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-dayTimeDurations" function, which is part of a numeric-equal expression (ge operator). + public void test_op_subtract_dayTimeDurations_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationSubtract/op-subtract-dayTimeDurations-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/AllW3CXPath20Tests.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/AllW3CXPath20Tests.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/AllW3CXPath20Tests.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/AllW3CXPath20Tests.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,48 @@ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllW3CXPath20Tests { + + public static Test suite() { + TestSuite suite = new TestSuite("Test for W3C XPath 2.0 test suite."); + //$JUnit-BEGIN$ + suite.addTestSuite(NumericUnaryPlusTest.class); + suite.addTestSuite(RangeExprTest.class); + suite.addTestSuite(SequenceTypeSyntaxTest.class); + suite.addTestSuite(LiteralsTest.class); + suite.addTestSuite(YearMonthDurationMultiplyTest.class); + suite.addTestSuite(YearMonthDurationDivideTest.class); + suite.addTestSuite(CombNodeSeqTest.class); + suite.addTestSuite(NumericAddTest.class); + suite.addTestSuite(commaOpTest.class); + suite.addTestSuite(DayTimeDurationDivideDTDTest.class); + suite.addTestSuite(NumericIntegerDivideTest.class); + suite.addTestSuite(FilterExprTest.class); + suite.addTestSuite(NumericMultiplyTest.class); + suite.addTestSuite(YearMonthDurationDivideYMDTest.class); + suite.addTestSuite(PredicatesTest.class); + suite.addTestSuite(AxesTest.class); + suite.addTestSuite(ExternalContextExprTest.class); + suite.addTestSuite(NodeTestTest.class); + suite.addTestSuite(NumericModTest.class); + suite.addTestSuite(YearMonthDurationAddTest.class); + suite.addTestSuite(DayTimeDurationAddTest.class); + suite.addTestSuite(InternalContextExprTest.class); + suite.addTestSuite(DayTimeDurationMultiplyTest.class); + suite.addTestSuite(AbbrAxesTest.class); + suite.addTestSuite(DayTimeDurationSubtractTest.class); + suite.addTestSuite(NumericUnaryMinusTest.class); + suite.addTestSuite(NumericSubtractTest.class); + suite.addTestSuite(DayTimeDurationDivideTest.class); + suite.addTestSuite(NameTestTest.class); + suite.addTestSuite(ParenExprTest.class); + suite.addTestSuite(NumericDivideTest.class); + suite.addTestSuite(UnabbrAxesTest.class); + suite.addTestSuite(YearMonthDurationSubtractTest.class); + //$JUnit-END$ + return suite; + } + +} Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NodeTestTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NodeTestTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NodeTestTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NodeTestTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,914 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + +// NodeTests need to compare based on Fragments. We which means need to compare DOM outputs. +public class NodeTestTest extends AbstractPsychoPathTest { + + //Simple test for comment() node type. + public void test_NodeTest001() throws Exception { + String inputFile = "/TestSources/bib2.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest001.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest001.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test for processing-instruction() node test. + public void test_NodeTest002() throws Exception { + String inputFile = "/TestSources/bib2.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest002.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest002.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test for node type text(). + public void test_NodeTest006() throws Exception { + String inputFile = "/TestSources/bib.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest006.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest006.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //processing-instruction() finds no descendant PIs of the given name anywhere. + public void test_NodeTest007_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest007.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest007-1.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //processing-instruction() gets all PIs of the given name, including those off root. + public void test_NodeTest007_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest007.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest007-2.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //text() gets no descendant text nodes. + public void test_NodeTest008_1() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest008.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest008-1.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //text() gets text nodes. + public void test_NodeTest008_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest008.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest008-2.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //comment() gets no descendant comment nodes. + public void test_NodeTest009_1() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest009.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest009-1.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //comment() gets comment nodes. + public void test_NodeTest009_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest009.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest009-2.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////comment() gets no comment nodes anywhere. + public void test_NodeTest010_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest010.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest010-1.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////comment() gets all comments, including those off root. + public void test_NodeTest010_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest010.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest010-2.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //processing-instruction() finds no descendant PIs. + public void test_NodeTest011_1() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest011.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest011-1.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //processing-instruction() gets all descendant PIs. + public void test_NodeTest011_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest011.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest011-2.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //processing-instruction() finds no descendant PIs anywhere. + public void test_NodeTest012_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest012.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest012-1.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //processing-instruction() gets all PIs, including those off root. + public void test_NodeTest012_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest012.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest012-2.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //processing-instruction() gets descendant PIs of the given name. + public void test_NodeTest013_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest013.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest013-1.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving a text node and a boolean expression (and fn:true()). + public void test_NodeTesthc_1() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving a text node and a boolean expression (or fn:true()). + public void test_NodeTesthc_2() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving a text node and a boolean expression (and fn:false()). + public void test_NodeTesthc_3() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving a text node and a boolean expression (or fn:false()). + public void test_NodeTesthc_4() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving Element node types and a boolean expression (or fn:false()). + public void test_NodeTesthc_5() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving Element node types and a boolean expression (or fn:true()). + public void test_NodeTesthc_6() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving Element node types and a boolean expression (and fn:false()). + public void test_NodeTesthc_7() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test involving Element node types and a boolean expression (and fn:true()). + public void test_NodeTesthc_8() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTesthc-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationSubtractTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationSubtractTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationSubtractTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationSubtractTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class YearMonthDurationSubtractTest extends AbstractPsychoPathTest { + + //Evaluates the "op:subtract-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_subtract_yearMonthDurations2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(mid range) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_subtract_yearMonthDurations2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(upper bound) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_subtract_yearMonthDurations2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(mid range). + public void test_op_subtract_yearMonthDurations2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(upper bound). + public void test_op_subtract_yearMonthDurations2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_subtract_yearMonthDurations_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_subtract_yearMonthDurations_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_subtract_yearMonthDurations_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator used in conjunction with the "fn:not" function. + public void test_op_subtract_yearMonthDurations_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator as an argument to the "fn:boolean" function. + public void test_op_subtract_yearMonthDurations_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator as an argument to the "fn:number" function. + public void test_op_subtract_yearMonthDurations_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator as an argument to the "fn:string" function. + public void test_op_subtract_yearMonthDurations_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator that returns a negative value. + public void test_op_subtract_yearMonthDurations_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator, which is part of an "and" expression. + public void test_op_subtract_yearMonthDurations_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" operator as part of an "or" expression. + public void test_op_subtract_yearMonthDurations_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" function, which is part of a div expression. + public void test_op_subtract_yearMonthDurations_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_subtract_yearMonthDurations_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" function, which is part of a numeric-equal expression (eq operator). + public void test_op_subtract_yearMonthDurations_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" function, which is part of a numeric-equal expression (ne operator). + public void test_op_subtract_yearMonthDurations_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" function, which is part of a numeric-equal expression (le operator). + public void test_op_subtract_yearMonthDurations_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:subtract-yearMonthDurations" function, which is part of a numeric-equal expression (ge operator). + public void test_op_subtract_yearMonthDurations_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationSubtract/op-subtract-yearMonthDurations-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/commaOpTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/commaOpTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/commaOpTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/commaOpTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1913 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class commaOpTest extends AbstractPsychoPathTest { + + //Simple Sequence construction involving integers. + public void test_sequenceexpressionhc1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction involving nested sequences using integers. + public void test_sequenceexpressionhc2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction using the empty sequence. + public void test_sequenceexpressionhc3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction using the "to" operand. + public void test_sequenceexpressionhc4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction using a repeated element. + public void test_sequenceexpressionhc5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence expression resulting in an empty sequence. + public void test_sequenceexpressionhc6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence expression resulting on a sequence in reverse order. + public void test_sequenceexpressionhc7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence expression resulting by quering string data from xml source. + public void test_sequenceexpressionhc8() throws Exception { + String inputFile = "/TestSources/works.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple sequence expression resulting by quering string data from multiple xml source. + public void test_sequenceexpressionhc9() throws Exception { + String inputFile = "/TestSources/works.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/sequenceexpressionhc9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of the members is an addition operation. + public void test_constSeq_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of the members is a subtraction operation. + public void test_constSeq_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of the members is a multiplication operation. + public void test_constSeq_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of the members is a division (div) operation. + public void test_constSeq_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of the members is a division (idiv) operation. + public void test_constSeq_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of the members contains invocation to "fn:count" function. + public void test_constSeq_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of the members contains invacotion to "fn:string-length" function. + public void test_constSeq_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where both of its members contains invocation to "fn:true" function. + public void test_constSeq_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where both of its members contains invocation to "fn:false" function. + public void test_constSeq_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where both of its members contains invocation to "fn:not()" function. + public void test_constSeq_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains a boolean (and) operation. + public void test_constSeq_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains a boolean (or) operation. + public void test_constSeq_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains invocation to "xs:string()". + public void test_constSeq_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains invocation to "xs:integer()". + public void test_constSeq_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains invocation to "xs:decimal()". + public void test_constSeq_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where both of its members contains invocation to "xs:anyURI". + public void test_constSeq_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains invocation to "xs:float()". + public void test_constSeq_17() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains invocation to "xs:double()". + public void test_constSeq_18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where one of its members contains invocation to "xs:boolean()". + public void test_constSeq_19() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where both of its members contains invocation to "xs:date()". + public void test_constSeq_20() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where both of its members contains invocation to "xs:dateTime()". + public void test_constSeq_21() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple Sequence construction, where both of its members contains invocation to "xs:time()". + public void test_constSeq_22() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-22.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/ConstructSeq/commaOp/constSeq-22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1 and arg2 : sequence of number. + public void test_op_concatenate_mix_args_001() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-001.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-001.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1 and arg2 : string. + public void test_op_concatenate_mix_args_002() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-002.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-002.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Args : string. + public void test_op_concatenate_mix_args_003() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-003.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-003.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Args : string. + public void test_op_concatenate_mix_args_004() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-004.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-004.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1 : string, arg2:anyURI. + public void test_op_concatenate_mix_args_005() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-005.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-005.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1 : string, arg2:integer, arg3:anyURI. + public void test_op_concatenate_mix_args_006() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-006.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-006.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1 : anyURI, arg2: decimal. + public void test_op_concatenate_mix_args_007() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-007.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-007.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1 and arg2 : float. + public void test_op_concatenate_mix_args_008() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-008.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-008.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1:float, arg2: double. + public void test_op_concatenate_mix_args_009() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-009.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-009.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1: double, arg2: double, arg3:float. + public void test_op_concatenate_mix_args_010() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-010.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-010.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1:boolean, arg2: boolean, arg3: integer. + public void test_op_concatenate_mix_args_011() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-011.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-011.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1:boolean, arg2: boolean. + public void test_op_concatenate_mix_args_012() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-012.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-012.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Iarg1:date, arg2: boolean, arg3: string. + public void test_op_concatenate_mix_args_013() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-013.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-013.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1:dateTime, arg2: empty sequence. + public void test_op_concatenate_mix_args_014() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-014.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-014.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1:time, arg2: string , arg3: decimal. + public void test_op_concatenate_mix_args_015() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-015.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-015.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Arg1:empty seq, arg2: string , arg3: decimal. + public void test_op_concatenate_mix_args_016() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-016.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-016.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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 simple arithmetic expression with concat. + public void test_op_concatenate_mix_args_017() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-017.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-017.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Concat more than two sequences. + public void test_op_concatenate_mix_args_018() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-018.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-018.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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 an external variable with op:concatenate. + public void test_op_concatenate_mix_args_019() throws Exception { + String inputFile = "/TestSources/bib.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-019.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-019.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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 two external variables with op:contenate. + public void test_op_concatenate_mix_args_020() throws Exception { + String inputFile = "/TestSources/bib.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-020.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/SeqOp/SeqConcat/op-concatenate-mix-args-020.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationAddTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationAddTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationAddTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationAddTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class DayTimeDurationAddTest extends AbstractPsychoPathTest { + + //Evaluates the "op:add-dayTimeDurations" operator with the arguments set as follows: Sarg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_add_dayTimeDurations2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator with the arguments set as follows: Sarg1 = xs:dayTimeDuration(mid range) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_add_dayTimeDurations2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator with the arguments set as follows: Sarg1 = xs:dayTimeDuration(upper bound) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_add_dayTimeDurations2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator with the arguments set as follows: Sarg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(mid range). + public void test_op_add_dayTimeDurations2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator with the arguments set as follows: Sarg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(upper bound). + public void test_op_add_dayTimeDurations2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_add_dayTimeDurations_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_add_dayTimeDurations_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_add_dayTimeDurations_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator used in conjunction with the "fn:not" function. + public void test_op_add_dayTimeDurations_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator as an argument to the "fn:boolean" function. + public void test_op_add_dayTimeDurations_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator as an argument to the "fn:number" function. + public void test_op_add_dayTimeDurations_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator as an argument to the "fn:string" function. + public void test_op_add_dayTimeDurations_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator that returns a negative value. + public void test_op_add_dayTimeDurations_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator, which is part of an "and" expression. + public void test_op_add_dayTimeDurations_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" operator as part of an "or" expression. + public void test_op_add_dayTimeDurations_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" function, which is part of a div expression. + public void test_op_add_dayTimeDurations_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_add_dayTimeDurations_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" function, which is part of a numeric-equal expression (eq operator). + public void test_op_add_dayTimeDurations_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" function, which is part of a numeric-equal expression (ne operator). + public void test_op_add_dayTimeDurations_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" function, which is part of a numeric-equal expression (le operator). + public void test_op_add_dayTimeDurations_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-dayTimeDurations" function, which is part of a numeric-equal expression (ge operator). + public void test_op_add_dayTimeDurations_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationAdd/op-add-dayTimeDurations-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericAddTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericAddTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericAddTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericAddTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,2209 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericAddTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:int(mid range) $arg2 = xs:int(lower bound). + public void test_op_numeric_addint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:int(upper bound) $arg2 = xs:int(lower bound). + public void test_op_numeric_addint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(mid range). + public void test_op_numeric_addint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(upper bound). + public void test_op_numeric_addint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:integer(mid range) $arg2 = xs:integer(lower bound). + public void test_op_numeric_addintg2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:integer(upper bound) $arg2 = xs:integer(lower bound). + public void test_op_numeric_addintg2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(mid range). + public void test_op_numeric_addintg2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(upper bound). + public void test_op_numeric_addintg2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addintg2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:decimal(mid range) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_adddec2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:decimal(upper bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_adddec2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(mid range). + public void test_op_numeric_adddec2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(upper bound). + public void test_op_numeric_adddec2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddec2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:double(mid range) $arg2 = xs:double(lower bound). + public void test_op_numeric_adddbl2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:double(upper bound) $arg2 = xs:double(lower bound). + public void test_op_numeric_adddbl2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(mid range). + public void test_op_numeric_adddbl2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(upper bound). + public void test_op_numeric_adddbl2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-adddbl2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:float(mid range) $arg2 = xs:float(lower bound). + public void test_op_numeric_addflt2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:float(upper bound) $arg2 = xs:float(lower bound). + public void test_op_numeric_addflt2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(mid range). + public void test_op_numeric_addflt2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(upper bound). + public void test_op_numeric_addflt2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addflt2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:long(mid range) $arg2 = xs:long(lower bound). + public void test_op_numeric_addlng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:long(upper bound) $arg2 = xs:long(lower bound). + public void test_op_numeric_addlng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(mid range). + public void test_op_numeric_addlng2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(upper bound). + public void test_op_numeric_addlng2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addlng2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_addusht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedShort(mid range) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_addusht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedShort(upper bound) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_addusht2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(mid range). + public void test_op_numeric_addusht2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(upper bound). + public void test_op_numeric_addusht2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addusht2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:negativeInteger(mid range) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_addnint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:negativeInteger(upper bound) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_addnint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(mid range). + public void test_op_numeric_addnint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(upper bound). + public void test_op_numeric_addnint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_addpint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:positiveInteger(mid range) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_addpint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:positiveInteger(upper bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_addpint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(mid range). + public void test_op_numeric_addpint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(upper bound). + public void test_op_numeric_addpint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addpint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_addulng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedLong(mid range) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_addulng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedLong(upper bound) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_addulng2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(mid range). + public void test_op_numeric_addulng2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(upper bound). + public void test_op_numeric_addulng2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addulng2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(mid range) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_addnpi2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(upper bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_addnpi2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(mid range). + public void test_op_numeric_addnpi2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(upper bound). + public void test_op_numeric_addnpi2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnpi2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_addnni2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(mid range) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_addnni2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(upper bound) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_addnni2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(mid range). + public void test_op_numeric_addnni2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_addnni2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addnni2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:short(mid range) $arg2 = xs:short(lower bound). + public void test_op_numeric_addsht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:short(upper bound) $arg2 = xs:short(lower bound). + public void test_op_numeric_addsht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(mid range). + public void test_op_numeric_addsht2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-add" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(upper bound). + public void test_op_numeric_addsht2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addsht2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple addition test with () as one operand should return null. + public void test_op_numeric_addmix2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addmix2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addmix2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple addition test pass string for second operator. + public void test_op_numeric_addmix2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addmix2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple addition test, second operator cast string to integer. + public void test_op_numeric_addmix2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addmix2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericAdd/op-numeric-addmix2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericDivideTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericDivideTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericDivideTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericDivideTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,2098 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericDivideTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(lower bound). + public void test_op_numeric_divideint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:int(mid range) $arg2 = xs:int(lower bound). + public void test_op_numeric_divideint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:int(upper bound) $arg2 = xs:int(lower bound). + public void test_op_numeric_divideint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(mid range). + public void test_op_numeric_divideint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(upper bound). + public void test_op_numeric_divideint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(lower bound). + public void test_op_numeric_divideintg2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:integer(mid range) $arg2 = xs:integer(lower bound). + public void test_op_numeric_divideintg2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:integer(upper bound) $arg2 = xs:integer(lower bound). + public void test_op_numeric_divideintg2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(mid range). + public void test_op_numeric_divideintg2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(upper bound). + public void test_op_numeric_divideintg2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideintg2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_dividedec2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:decimal(mid range) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_dividedec2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:decimal(upper bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_dividedec2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(mid range). + public void test_op_numeric_dividedec2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(upper bound). + public void test_op_numeric_dividedec2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedec2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(lower bound). + public void test_op_numeric_dividedbl2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:double(mid range) $arg2 = xs:double(lower bound). + public void test_op_numeric_dividedbl2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:double(upper bound) $arg2 = xs:double(lower bound). + public void test_op_numeric_dividedbl2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(upper bound). + public void test_op_numeric_dividedbl2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividedbl2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(lower bound). + public void test_op_numeric_divideflt2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:float(mid range) $arg2 = xs:float(lower bound). + public void test_op_numeric_divideflt2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:float(upper bound) $arg2 = xs:float(lower bound). + public void test_op_numeric_divideflt2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(upper bound). + public void test_op_numeric_divideflt2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideflt2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(lower bound). + public void test_op_numeric_dividelng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:long(mid range) $arg2 = xs:long(lower bound). + public void test_op_numeric_dividelng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:long(upper bound) $arg2 = xs:long(lower bound). + public void test_op_numeric_dividelng2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(mid range). + public void test_op_numeric_dividelng2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(upper bound). + public void test_op_numeric_dividelng2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividelng2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(mid range). + public void test_op_numeric_divideusht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideusht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideusht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(upper bound). + public void test_op_numeric_divideusht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideusht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideusht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_dividenint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(mid range) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_dividenint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(upper bound) $arg2 = xs:negativeInteger(lower bound). + public void test_op_numeric_dividenint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(mid range). + public void test_op_numeric_dividenint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(upper bound). + public void test_op_numeric_dividenint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_dividepint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(mid range) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_dividepint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(upper bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_dividepint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(mid range). + public void test_op_numeric_dividepint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(upper bound). + public void test_op_numeric_dividepint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividepint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(mid range). + public void test_op_numeric_divideulng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideulng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideulng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(upper bound). + public void test_op_numeric_divideulng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideulng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-divideulng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_dividenpi2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(mid range) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_dividenpi2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(upper bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_dividenpi2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(mid range). + public void test_op_numeric_dividenpi2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenpi2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(mid range). + public void test_op_numeric_dividenni2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenni2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenni2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_dividenni2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenni2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividenni2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(lower bound). + public void test_op_numeric_dividesht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:short(mid range) $arg2 = xs:short(lower bound). + public void test_op_numeric_dividesht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:short(upper bound) $arg2 = xs:short(lower bound). + public void test_op_numeric_dividesht2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(mid range). + public void test_op_numeric_dividesht2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-divide" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(upper bound). + public void test_op_numeric_dividesht2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividesht2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple division test with () as one operand should return null. + public void test_op_numeric_dividemix2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividemix2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividemix2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple division test pass string for second operator. + public void test_op_numeric_dividemix2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividemix2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple division test, second operator cast string to integer. + public void test_op_numeric_dividemix2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividemix2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericDivide/op-numeric-dividemix2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/PredicatesTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/PredicatesTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/PredicatesTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/PredicatesTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1617 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class PredicatesTest extends AbstractPsychoPathTest { + + //Evaluation of a simple predicate with a "true" value (uses "fn:true"). + public void test_predicates_1() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate with a "false" value (uses "fn:false"). Use "fn:count" to avoid empty file. + public void test_predicates_2() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate with a "true" value (uses "fn:true" and fn:not()). + public void test_predicates_3() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("and" operator), returns true. + public void test_predicates_4() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("or" operator), return true. + public void test_predicates_5() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("and" operator), returns false. Use "fn:count" to avoid empty file. + public void test_predicates_6() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("or" operator), returns false. Use "fn:count" to avoid empty file. + public void test_predicates_7() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:string() function. + public void test_predicates_8() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:integer()" function. + public void test_predicates_9() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:decimal()" function. + public void test_predicates_10() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:float()" function. + public void test_predicates_11() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:double()" function. + public void test_predicates_12() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:boolean()" function. + public void test_predicates_13() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:date()" function. + public void test_predicates_14() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "eq" operator. + public void test_predicates_17() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "ne" operator. + public void test_predicates_18() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "lt" operator. + public void test_predicates_19() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "le" operator. + public void test_predicates_20() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "gt" operator. + public void test_predicates_21() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "ge" operator. + public void test_predicates_22() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-22.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "=" operator. + public void test_predicates_23() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-23.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-23.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "!=" operator. + public void test_predicates_24() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-24.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-24.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "<" operator. + public void test_predicates_25() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-25.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-25.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the "<=" operator. + public void test_predicates_26() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-26.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-26.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the ">" operator. + public void test_predicates_27() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-27.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-27.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate that uses the ">=" operator. + public void test_predicates_28() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-28.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-28.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of numeric range used as filter expression. + public void test_predicates_29() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-29.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of predicates, where implementation may switch order of predicates order. + public void test_predicates_30() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-30.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-30.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of predicates, where implementation may switch order of predicates for evaluation. + public void test_predicates_31() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-31.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-31.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate with a "true" value (uses "fn:true"). Not Schema dependent. + public void test_predicatesns_1() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate with a "false" value (uses "fn:false"). Use "fn:count" to avoid empty file. Not Schema dependent. + public void test_predicatesns_2() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate with a "true" value (uses "fn:true" and fn:not()). Not Schema dependent. + public void test_predicatesns_3() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("and" operator), returns true. Not Schema dependent. + public void test_predicatesns_4() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("or" operator), return true. Not Schema dependent. + public void test_predicatesns_5() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("and" operator), returns false. Use "fn:count" to avoid empty file. Not Schema dependent. + public void test_predicatesns_6() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate set to a boolean expression ("or" operator), returns false. Use "fn:count" to avoid empty file. Not Schema dependent. + public void test_predicatesns_7() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:string() function. Not Schema dependent. + public void test_predicatesns_8() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:integer()" function. Not Schema dependent. + public void test_predicatesns_9() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:decimal()" function. Not Schema dependent. + public void test_predicatesns_10() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:float()" function. Not Schema dependent. + public void test_predicatesns_11() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:double()" function. Not Schema dependent. + public void test_predicatesns_12() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:boolean()" function. Not Schema dependent. + public void test_predicatesns_13() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a simple predicate, that uses the "xs:date()" function. Not Schema dependent. + public void test_predicatesns_14() throws Exception { + String inputFile = "/TestSources/atomicns.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/SequenceTypeSyntaxTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/SequenceTypeSyntaxTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/SequenceTypeSyntaxTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/SequenceTypeSyntaxTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,787 @@ +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology for Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver (STAR) - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator; +import org.eclipse.wst.xml.xpath2.processor.DynamicContext; +import org.eclipse.wst.xml.xpath2.processor.Evaluator; +import org.eclipse.wst.xml.xpath2.processor.ResultSequence; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.XPathParserException; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; +import org.eclipse.wst.xml.xpath2.processor.StaticError; + + +public class SequenceTypeSyntaxTest extends AbstractPsychoPathTest { + + //Simple evaluation of sequence type matching involving instance of and a sequence of integers. + public void test_sequence_type_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-1.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of doubles. + public void test_sequence_type_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-2.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of decimal. + public void test_sequence_type_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-3.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of strings. + public void test_sequence_type_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-4.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of strings. (uses integer*). + public void test_sequence_type_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-5.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of one integer (Uses integer?). + public void test_sequence_type_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-6.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of integers. (Uses integer?). + public void test_sequence_type_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-7.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of integers. (Uses integer+). + public void test_sequence_type_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-8.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of one integer. (Uses integer?). + public void test_sequence_type_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-9.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of two integers. (Uses integer?). + public void test_sequence_type_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-10.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of one double. (Uses double?). + public void test_sequence_type_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-11.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of two double. (Uses double?). + public void test_sequence_type_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-12.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of one decimal. (Uses decimal?). + public void test_sequence_type_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-13.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of two decimals. (Uses decimal?). + public void test_sequence_type_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-14.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of one string. (Uses string?). + public void test_sequence_type_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-15.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of two strings. (Uses string?). + public void test_sequence_type_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-16.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of one string. (Uses integer?). + public void test_sequence_type_17() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-17.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving castable as and a sequence of two strings. (Uses integer?). + public void test_sequence_type_18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-18.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of two booleans. (Uses xs:boolean*). + public void test_sequence_type_19() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-19.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of two booleans. (Uses xs:boolean?). + public void test_sequence_type_20() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-20.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/falsevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple evaluation of sequence type matching involving instance of and a sequence of two booleans. (Uses xs:boolean+). + public void test_sequence_type_21() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Basics/Types/SequenceTypeSyntax/sequence-type-21.xq"; + String resultFile = "/ExpectedTestResults/Basics/Types/SequenceTypeSyntax/truevalue.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,766 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class DayTimeDurationDivideTest extends AbstractPsychoPathTest { + + //Evaluates the "op:divide-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:double(lower bound). + public void test_op_divide_dayTimeDuration2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(mid range) $arg2 = xs:double(lower bound). + public void test_op_divide_dayTimeDuration2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(upper bound) $arg2 = xs:double(lower bound). + public void test_op_divide_dayTimeDuration2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:double(mid range). + public void test_op_divide_dayTimeDuration2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:double(upper bound). + public void test_op_divide_dayTimeDuration2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_divide_dayTimeDuration_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_divide_dayTimeDuration_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator used in conjunction with the "fn:not" function. + public void test_op_divide_dayTimeDuration_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator as an argument to the "fn:boolean" function. + public void test_op_divide_dayTimeDuration_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator as an argument to the "fn:number" function. + public void test_op_divide_dayTimeDuration_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator as an argument to the "fn:string" function. + public void test_op_divide_dayTimeDuration_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator that returns a negative value. + public void test_op_divide_dayTimeDuration_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator, which is part of an "and" expression. + public void test_op_divide_dayTimeDuration_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" operator as part of an "or" expression. + public void test_op_divide_dayTimeDuration_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" function, which is part of a div expression. + public void test_op_divide_dayTimeDuration_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_divide_dayTimeDuration_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" function, which is part of a numeric-equal expression (eq operator). + public void test_op_divide_dayTimeDuration_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" function, which is part of a numeric-equal expression (ne operator). + public void test_op_divide_dayTimeDuration_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" function, which is part of a numeric-equal expression (le operator). + public void test_op_divide_dayTimeDuration_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration" function, which is part of a numeric-equal expression (ge operator). + public void test_op_divide_dayTimeDuration_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivide/op-divide-dayTimeDuration-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericMultiplyTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericMultiplyTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericMultiplyTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericMultiplyTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1506 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericMultiplyTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_multiplydec2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:decimal(mid range) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_multiplydec2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:decimal(upper bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_multiplydec2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(mid range). + public void test_op_numeric_multiplydec2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(upper bound). + public void test_op_numeric_multiplydec2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydec2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(lower bound). + public void test_op_numeric_multiplydbl2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:double(mid range) $arg2 = xs:double(lower bound). + public void test_op_numeric_multiplydbl2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:double(upper bound) $arg2 = xs:double(lower bound). + public void test_op_numeric_multiplydbl2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(mid range). + public void test_op_numeric_multiplydbl2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(upper bound). + public void test_op_numeric_multiplydbl2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplydbl2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(lower bound). + public void test_op_numeric_multiplyflt2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:float(mid range) $arg2 = xs:float(lower bound). + public void test_op_numeric_multiplyflt2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:float(upper bound) $arg2 = xs:float(lower bound). + public void test_op_numeric_multiplyflt2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(mid range). + public void test_op_numeric_multiplyflt2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(upper bound). + public void test_op_numeric_multiplyflt2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyflt2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_multiplyusht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedShort(mid range) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_multiplyusht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedShort(upper bound) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_multiplyusht2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(mid range). + public void test_op_numeric_multiplyusht2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(upper bound). + public void test_op_numeric_multiplyusht2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyusht2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_multiplypint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:positiveInteger(mid range) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_multiplypint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:positiveInteger(upper bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_multiplypint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(mid range). + public void test_op_numeric_multiplypint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(upper bound). + public void test_op_numeric_multiplypint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplypint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_multiplyulng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedLong(mid range) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_multiplyulng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedLong(upper bound) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_multiplyulng2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(mid range). + public void test_op_numeric_multiplyulng2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(upper bound). + public void test_op_numeric_multiplyulng2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplyulng2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(upper bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_multiplynpi2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynpi2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynpi2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(upper bound). + public void test_op_numeric_multiplynpi2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynpi2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynpi2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_multiplynni2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(mid range) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_multiplynni2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(upper bound) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_multiplynni2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(mid range). + public void test_op_numeric_multiplynni2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-multiply" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_multiplynni2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplynni2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple multiplication test with () as one operand should return null. + public void test_op_numeric_multiplymix2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplymix2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplymix2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple multiplication test pass string for second operator. + public void test_op_numeric_multiplymix2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplymix2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple multiplication test, second operator cast string to integer. + public void test_op_numeric_multiplymix2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplymix2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMultiply/op-numeric-multiplymix2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericSubtractTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericSubtractTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericSubtractTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericSubtractTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,2357 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericSubtractTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(lower bound). + public void test_op_numeric_subtractint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:int(mid range) $arg2 = xs:int(lower bound). + public void test_op_numeric_subtractint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:int(upper bound) $arg2 = xs:int(lower bound). + public void test_op_numeric_subtractint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(mid range). + public void test_op_numeric_subtractint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(upper bound). + public void test_op_numeric_subtractint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(lower bound). + public void test_op_numeric_subtractintg2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:integer(mid range) $arg2 = xs:integer(lower bound). + public void test_op_numeric_subtractintg2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:integer(upper bound) $arg2 = xs:integer(lower bound). + public void test_op_numeric_subtractintg2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(mid range). + public void test_op_numeric_subtractintg2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(upper bound). + public void test_op_numeric_subtractintg2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractintg2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_subtractdec2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:decimal(mid range) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_subtractdec2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:decimal(upper bound) $arg2 = xs:decimal(lower bound). + public void test_op_numeric_subtractdec2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(mid range). + public void test_op_numeric_subtractdec2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(upper bound). + public void test_op_numeric_subtractdec2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdec2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(lower bound). + public void test_op_numeric_subtractdbl2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:double(mid range) $arg2 = xs:double(lower bound). + public void test_op_numeric_subtractdbl2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:double(upper bound) $arg2 = xs:double(lower bound). + public void test_op_numeric_subtractdbl2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(mid range). + public void test_op_numeric_subtractdbl2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(upper bound). + public void test_op_numeric_subtractdbl2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractdbl2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(lower bound). + public void test_op_numeric_subtractflt2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:float(mid range) $arg2 = xs:float(lower bound). + public void test_op_numeric_subtractflt2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:float(upper bound) $arg2 = xs:float(lower bound). + public void test_op_numeric_subtractflt2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(mid range). + public void test_op_numeric_subtractflt2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(upper bound). + public void test_op_numeric_subtractflt2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractflt2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(lower bound). + public void test_op_numeric_subtractlng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:long(mid range) $arg2 = xs:long(lower bound). + public void test_op_numeric_subtractlng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:long(upper bound) $arg2 = xs:long(lower bound). + public void test_op_numeric_subtractlng2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(mid range). + public void test_op_numeric_subtractlng2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(upper bound). + public void test_op_numeric_subtractlng2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractlng2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_subtractusht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedShort(mid range) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_subtractusht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedShort(upper bound) $arg2 = xs:unsignedShort(lower bound). + public void test_op_numeric_subtractusht2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(mid range). + public void test_op_numeric_subtractusht2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(upper bound). + public void test_op_numeric_subtractusht2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractusht2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(mid range). + public void test_op_numeric_subtractnint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:negativeInteger(lower bound) $arg2 = xs:negativeInteger(upper bound). + public void test_op_numeric_subtractnint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:positiveInteger(mid range) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_subtractpint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractpint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractpint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:positiveInteger(upper bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_subtractpint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractpint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractpint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(mid range). + public void test_op_numeric_subtractpint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractpint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractpint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_subtractulng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedLong(mid range) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_subtractulng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedLong(upper bound) $arg2 = xs:unsignedLong(lower bound). + public void test_op_numeric_subtractulng2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(mid range). + public void test_op_numeric_subtractulng2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(upper bound). + public void test_op_numeric_subtractulng2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractulng2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_subtractnpi2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(mid range) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_subtractnpi2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(upper bound) $arg2 = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_subtractnpi2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(mid range). + public void test_op_numeric_subtractnpi2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonPositiveInteger(lower bound) $arg2 = xs:nonPositiveInteger(upper bound). + public void test_op_numeric_subtractnpi2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnpi2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_subtractnni2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(mid range) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_subtractnni2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(upper bound) $arg2 = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_subtractnni2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(mid range). + public void test_op_numeric_subtractnni2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_subtractnni2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractnni2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(lower bound). + public void test_op_numeric_subtractsht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:short(mid range) $arg2 = xs:short(lower bound). + public void test_op_numeric_subtractsht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:short(upper bound) $arg2 = xs:short(lower bound). + public void test_op_numeric_subtractsht2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(mid range). + public void test_op_numeric_subtractsht2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-subtract" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(upper bound). + public void test_op_numeric_subtractsht2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractsht2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple subtraction test with () as one operand should return null. + public void test_op_numeric_subtractmix2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractmix2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractmix2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple subtraction test pass string for second operator. + public void test_op_numeric_subtractmix2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractmix2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple subtraction test, second operator cast string to integer. + public void test_op_numeric_subtractmix2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractmix2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericSubtract/op-numeric-subtractmix2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryMinusTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryMinusTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryMinusTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryMinusTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1469 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericUnaryMinusTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:int(lower bound). + public void test_op_numeric_unary_minusint1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusint1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusint1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:int(mid range). + public void test_op_numeric_unary_minusint1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusint1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusint1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:int(upper bound). + public void test_op_numeric_unary_minusint1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusint1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusint1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:integer(lower bound). + public void test_op_numeric_unary_minusintg1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusintg1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusintg1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:integer(mid range). + public void test_op_numeric_unary_minusintg1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusintg1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusintg1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:integer(upper bound). + public void test_op_numeric_unary_minusintg1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusintg1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusintg1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:decimal(lower bound). + public void test_op_numeric_unary_minusdec1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdec1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdec1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:decimal(mid range). + public void test_op_numeric_unary_minusdec1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdec1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdec1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:decimal(upper bound). + public void test_op_numeric_unary_minusdec1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdec1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdec1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:double(lower bound). + public void test_op_numeric_unary_minusdbl1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdbl1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdbl1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:double(mid range). + public void test_op_numeric_unary_minusdbl1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdbl1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdbl1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:double(upper bound). + public void test_op_numeric_unary_minusdbl1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdbl1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusdbl1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:float(lower bound). + public void test_op_numeric_unary_minusflt1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusflt1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusflt1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:float(mid range). + public void test_op_numeric_unary_minusflt1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusflt1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusflt1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:float(upper bound). + public void test_op_numeric_unary_minusflt1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusflt1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusflt1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:long(lower bound). + public void test_op_numeric_unary_minuslng1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuslng1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuslng1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:long(mid range). + public void test_op_numeric_unary_minuslng1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuslng1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuslng1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:long(upper bound). + public void test_op_numeric_unary_minuslng1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuslng1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuslng1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:unsignedShort(lower bound). + public void test_op_numeric_unary_minususht1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minususht1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minususht1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:unsignedShort(mid range). + public void test_op_numeric_unary_minususht1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minususht1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minususht1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:unsignedShort(upper bound). + public void test_op_numeric_unary_minususht1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minususht1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minususht1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:negativeInteger(lower bound). + public void test_op_numeric_unary_minusnint1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnint1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnint1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:negativeInteger(mid range). + public void test_op_numeric_unary_minusnint1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnint1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnint1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:negativeInteger(upper bound). + public void test_op_numeric_unary_minusnint1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnint1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnint1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:positiveInteger(lower bound). + public void test_op_numeric_unary_minuspint1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuspint1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuspint1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:positiveInteger(mid range). + public void test_op_numeric_unary_minuspint1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuspint1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuspint1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:positiveInteger(upper bound). + public void test_op_numeric_unary_minuspint1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuspint1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minuspint1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:unsignedLong(lower bound). + public void test_op_numeric_unary_minusulng1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusulng1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusulng1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:unsignedLong(mid range). + public void test_op_numeric_unary_minusulng1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusulng1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusulng1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:unsignedLong(upper bound). + public void test_op_numeric_unary_minusulng1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusulng1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusulng1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_unary_minusnpi1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnpi1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnpi1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:nonPositiveInteger(mid range). + public void test_op_numeric_unary_minusnpi1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnpi1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnpi1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:nonPositiveInteger(upper bound). + public void test_op_numeric_unary_minusnpi1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnpi1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnpi1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_unary_minusnni1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnni1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnni1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:nonNegativeInteger(mid range). + public void test_op_numeric_unary_minusnni1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnni1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnni1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_unary_minusnni1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnni1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minusnni1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:short(lower bound). + public void test_op_numeric_unary_minussht1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minussht1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minussht1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:short(mid range). + public void test_op_numeric_unary_minussht1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minussht1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minussht1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-minus" operator with the arguments set as follows: $arg = xs:short(upper bound). + public void test_op_numeric_unary_minussht1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minussht1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryMinus/op-numeric-unary-minussht1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/CombNodeSeqTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/CombNodeSeqTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/CombNodeSeqTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/CombNodeSeqTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,63 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class CombNodeSeqTest extends AbstractPsychoPathTest { + + //Simple combination of two empty sequence. Use of the "intersect" operator. + public void test_combiningnodeseqintersecthc2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/CombNodeSeq/combiningnodeseqintersecthc2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/CombNodeSeq/combiningnodeseqintersecthc2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/AxesTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/AxesTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/AxesTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/AxesTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,6908 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class AxesTest extends AbstractPsychoPathTest { + + //No children for child::*. + public void test_Axes001_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes001.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes001-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 child for child::*. + public void test_Axes001_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes001.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes001-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several children for child::*. + public void test_Axes001_3() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes001.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes001-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children, child::name gets none. + public void test_Axes002_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes002.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes002-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //child::name gets none, none of that name exist. + public void test_Axes002_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes002.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes002-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //child::name gets 1 child. + public void test_Axes002_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes002.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes002-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several children for child::name. + public void test_Axes002_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes002.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes002-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children of any kind, child::node() gets none. + public void test_Axes003_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes003.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes003-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //child::node() gets 1 text node. + public void test_Axes003_2() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes003.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes003-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //child::node() gets 1 child element. + public void test_Axes003_3() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes003.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes003-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several nodes for child::node(). + public void test_Axes003_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes003.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes003-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children for *. + public void test_Axes004_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes004.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes004-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 child for *. + public void test_Axes004_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes004.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes004-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several children for *. + public void test_Axes004_3() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes004.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes004-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children, implied child with name gets none. + public void test_Axes005_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes005.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes005-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Implied child with name gets none, none of that name exist. + public void test_Axes005_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes005.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes005-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Implied child with name gets 1 child. + public void test_Axes005_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes005.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes005-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several children for implied child with name. + public void test_Axes005_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes005.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes005-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children, implied child with node() gets none. + public void test_Axes006_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes006.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes006-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Implied child with node() gets 1 text node. + public void test_Axes006_2() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes006.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes006-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Implied child with node() gets 1 child element. + public void test_Axes006_3() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes006.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes006-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several nodes for implied child with node(). + public void test_Axes006_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes006.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes006-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for attribute::*. + public void test_Axes007_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes007.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes007-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for attribute::*. + public void test_Axes007_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes007.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes007-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for attribute::*. + public void test_Axes007_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes007.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes007-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes, attribute::name gets none. + public void test_Axes008_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes008.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes008-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attribute satisfies attribute::name. + public void test_Axes008_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes008.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes008-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for attribute::name. + public void test_Axes008_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes008.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes008-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for attribute::node(). + public void test_Axes009_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes009.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes009-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for attribute::node(). + public void test_Axes009_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes009.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes009-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for attribute::node(). + public void test_Axes009_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes009.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes009-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for @*. + public void test_Axes010_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes010.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes010-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for @*. + public void test_Axes010_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes010.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes010-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for @*. + public void test_Axes010_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes010.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes010-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes, @name gets none. + public void test_Axes011_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes011.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes011-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attribute satisfies @name. + public void test_Axes011_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes011.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes011-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for @name. + public void test_Axes011_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes011.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes011-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get root node from / alone. + public void test_Axes012_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes012.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 element from parent::*. + public void test_Axes013_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes013.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes013-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get no nodes from parent::* at top of tree. + public void test_Axes014_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes014.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes014-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 element from parent::name. + public void test_Axes015_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes015.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes015-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get no nodes from parent::name when name is not parent's name. + public void test_Axes016_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes016.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes016-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 element from parent::node(). + public void test_Axes017_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes017.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes017-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get root node from parent::node() at top of tree. + public void test_Axes018_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes018.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes018-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 element from. + public void test_Axes019_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes019.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes019-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 element from self::*. + public void test_Axes020_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes020.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes020-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 element from self::name. + public void test_Axes021_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes021.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes021-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 element from self::node(). + public void test_Axes023_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes023.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes023-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 attribute from self::node(). + public void test_Axes027_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes027.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes027-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //text()/self::node() gets no nodes when no such text node exists. + public void test_Axes030_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes030.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes030-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Get 1 text node from self::node(). + public void test_Axes030_2() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes030.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes030-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No subtree, descendant::* gets none. + public void test_Axes031_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes031.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes031-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant::* gets none when there are no element children. + public void test_Axes031_2() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes031.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes031-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant::* gets the 1 child. + public void test_Axes031_3() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes031.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes031-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several descendant elements found by descendant::*. + public void test_Axes031_4() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes031.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes031-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No subtree, descendant::name gets nothing. + public void test_Axes032_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes032.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes032-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant::name gets none when no elements have that name. + public void test_Axes032_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes032.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes032-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant::name gets the 1 child. + public void test_Axes032_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes032.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes032-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several children for descendant::name. + public void test_Axes032_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes032.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes032-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No subtree, descendant::node() gets none. + public void test_Axes033_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes033.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes033-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant::node() gets 1 text child. + public void test_Axes033_2() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes033.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes033-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant::node() gets 1 element child. + public void test_Axes033_3() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes033.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes033-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several descendant elements found by descendant::node(). + public void test_Axes033_4() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes033.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes033-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::* from an element gets 1 element (self). + public void test_Axes034_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes034.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes034-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::* from an element gets several elements. + public void test_Axes034_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes034.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes034-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::name gets nothing when no sub-tree and self has different name. + public void test_Axes035_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes035.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes035-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::name gets none when no elements have that name. + public void test_Axes035_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes035.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes035-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::name gets the 1 descendant of that name. + public void test_Axes035_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes035.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes035-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::name gets several elements. + public void test_Axes035_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes035.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes035-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::name gets self of that name. + public void test_Axes036_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes036.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes036-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::name gets several elements, including self. + public void test_Axes036_2() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes036.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes036-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No descendants, descendant-or-self::node() gets self. + public void test_Axes037_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes037.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes037-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::node() gets several nodes. + public void test_Axes037_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes037.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes037-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::node() from an attribute gets the attribute. + public void test_Axes041_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes041.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes041-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //text()/descendant-or-self::node() gets no nodes when no such text node exists. + public void test_Axes043_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes043.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes043-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //descendant-or-self::node() from a text node gets that node. + public void test_Axes043_2() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes043.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes043-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///child::* on typical tree gets just 1 (document) element. + public void test_Axes044_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes044.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes044-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///child::* on tree with top-level nodes gets just 1 (document) element. + public void test_Axes044_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes044.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes044-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///child::name on tree with top-level non-element nodes gets nothing. + public void test_Axes045_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes045.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes045-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///child::name on typical tree gets 1 (document) element. + public void test_Axes045_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes045.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes045-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///child::node() on typical tree gets 1 (document) element. + public void test_Axes046_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes046.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes046-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///child::node() on tree with top-level nodes gets many nodes. + public void test_Axes046_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes046.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes046-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///* on typical tree gets just 1 (document) element. + public void test_Axes047_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes047.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes047-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///* on tree with top-level nodes gets just 1 (document) element. + public void test_Axes047_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes047.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes047-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///name on tree with top-level non-element nodes gets nothing. + public void test_Axes048_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes048.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes048-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///name on typical tree gets 1 (document) element. + public void test_Axes048_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes048.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes048-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///node() on typical tree gets 1 (document) element. + public void test_Axes049_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes049.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes049-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///node() on tree with top-level nodes gets many nodes. + public void test_Axes049_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes049.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes049-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///self::node() gets root node. + public void test_Axes055_1() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes055.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes055-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::* gets just the document element from a 1-element tree. + public void test_Axes056_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes056.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes056-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::* gets many nodes from a typical tree. + public void test_Axes056_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes056.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes056-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::* gets many nodes from a tree with top-level nodes. + public void test_Axes056_3() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes056.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes056-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::name gets nothing when no element of that name. + public void test_Axes057_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes057.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes057-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::name gets 1 top-level element of that name. + public void test_Axes057_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes057.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes057-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::name gets the 1 descendant of that name. + public void test_Axes057_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes057.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes057-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::name gets several elements. + public void test_Axes057_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes057.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes057-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::node() gets 1 top-level element. + public void test_Axes058_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes058.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes058-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::node() on typical tree gets many nodes. + public void test_Axes058_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes058.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes058-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant::node() gets many nodes from a tree with top-level nodes. + public void test_Axes058_3() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes058.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes058-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::* gets 1 element from a 1-element tree. + public void test_Axes059_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes059.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes059-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::* on typical tree gets many nodes. + public void test_Axes059_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes059.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes059-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::name gets nothing when no element of that name. + public void test_Axes060_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes060.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes060-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::name gets 1 top-level element of that name. + public void test_Axes060_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes060.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes060-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::name gets the 1 descendant of that name. + public void test_Axes060_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes060.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes060-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::name gets several elements. + public void test_Axes060_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes060.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes060-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::node() on typical tree gets many nodes. + public void test_Axes061_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes061.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes061-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ///descendant-or-self::node() gets many nodes from a tree with top-level nodes. + public void test_Axes061_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes061.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes061-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::* gets 1 element from a 1-element tree. + public void test_Axes062_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes062.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes062-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::* on typical tree gets many nodes. + public void test_Axes062_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes062.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes062-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::name gets nothing when no element of that name. + public void test_Axes063_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes063.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes063-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::name gets 1 top-level element of that name. + public void test_Axes063_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes063.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes063-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::name gets the 1 descendant of that name. + public void test_Axes063_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes063.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes063-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::name gets several elements. + public void test_Axes063_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes063.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes063-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::node() gets 1 element from a 1-element tree. + public void test_Axes064_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes064.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes064-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::node() on typical tree gets many nodes. + public void test_Axes064_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes064.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes064-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////child::node() gets many nodes from a tree with top-level nodes. + public void test_Axes064_3() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes064.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes064-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////* gets 1 element from a 1-element tree. + public void test_Axes065_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes065.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes065-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////* on typical tree gets many nodes. + public void test_Axes065_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes065.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes065-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////name gets nothing when no element of that name. + public void test_Axes066_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes066.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes066-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////name gets 1 top-level element of that name. + public void test_Axes066_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes066.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes066-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////name gets the 1 descendant of that name. + public void test_Axes066_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes066.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes066-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////name gets several elements. + public void test_Axes066_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes066.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes066-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////node() gets 1 element from a 1-element tree. + public void test_Axes067_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes067.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes067-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////node() on typical tree gets many nodes. + public void test_Axes067_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes067.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes067-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////node() gets many nodes from a tree with top-level nodes. + public void test_Axes067_3() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes067.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes067-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////attribute::* gets nothing when no attributes. + public void test_Axes068_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes068.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes068-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////attribute::* gets 1 attribute from document element. + public void test_Axes068_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes068.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes068-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////attribute::* gets many attributes. + public void test_Axes068_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes068.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes068-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////attribute::name gets nothing when no attributes. + public void test_Axes069_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes069.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes069-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////attribute::name gets 1 attribute from document element. + public void test_Axes069_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes069.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes069-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////attribute::name gets many attributes. + public void test_Axes069_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes069.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes069-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////@* gets nothing when no attributes. + public void test_Axes070_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes070.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes070-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////@* gets 1 attribute from document element. + public void test_Axes070_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes070.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes070-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////@* gets many attributes. + public void test_Axes070_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes070.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes070-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////@name gets nothing when no attributes. + public void test_Axes071_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes071.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes071-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////@name gets 1 attribute from document element. + public void test_Axes071_2() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes071.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes071-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////@name gets many attributes. + public void test_Axes071_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes071.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes071-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////self::* gets 1 element from a 1-element tree. + public void test_Axes072_1() throws Exception { + String inputFile = "/TestSources/TreeEmpty.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes072.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes072-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////self::* on typical tree gets many nodes. + public void test_Axes072_2() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes072.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes072-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////self::node() on typical tree gets many nodes. + public void test_Axes073_1() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes073.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes073-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + ////self::node() gets many nodes from a tree with top-level nodes. + public void test_Axes073_2() throws Exception { + String inputFile = "/TestSources/TopMany.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes073.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes073-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children of any kind, elem//child::* gets none. + public void test_Axes074_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::* gets nothing when no element children. + public void test_Axes074_2() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::* gets 1 child element. + public void test_Axes074_3() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::* gets several nodes. + public void test_Axes074_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::name gets nothing when no sub-tree. + public void test_Axes075_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::name gets none when no elements have that name. + public void test_Axes075_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::name gets the 1 descendant of that name. + public void test_Axes075_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::name gets several elements. + public void test_Axes075_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children, elem//child::node() gets none. + public void test_Axes076_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::node() gets 1 child element. + public void test_Axes076_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//child::node() gets 1 child text node. + public void test_Axes076_3() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several children for elem//child::node(). + public void test_Axes076_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children for elem//*. + public void test_Axes077_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes077.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes077-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 child for elem//*. + public void test_Axes077_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes077.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes077-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Many children for elem//*. + public void test_Axes077_3() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes077.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes077-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//name gets none when there are no children. + public void test_Axes078_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//name gets none when no elements have that name. + public void test_Axes078_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//name gets the 1 descendant of that name. + public void test_Axes078_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//name gets several elements. + public void test_Axes078_4() throws Exception { + String inputFile = "/TestSources/TreeStack.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No children, elem//node() gets none. + public void test_Axes079_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes079.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes079-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//node() gets 1 child element. + public void test_Axes079_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes079.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes079-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //elem//node() gets 1 child text node. + public void test_Axes079_3() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes079.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes079-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several children for elem//node(). + public void test_Axes079_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes079.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes079-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for elem//attribute::*. + public void test_Axes080_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes080.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes080-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for elem//attribute::*. + public void test_Axes080_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes080.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes080-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for elem//attribute::*. + public void test_Axes080_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes080.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes080-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for elem//attribute::name, due to none existing at all. + public void test_Axes081_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes081.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes081-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for elem//attribute::name, none of that name exist. + public void test_Axes081_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes081.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes081-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for elem//attribute::name. + public void test_Axes081_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes081.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes081-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for elem//attribute::name. + public void test_Axes081_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes081.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes081-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for elem//attribute::node(). + public void test_Axes082_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes082.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes082-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for elem//attribute::node(). + public void test_Axes082_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes082.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes082-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for elem//attribute::node(). + public void test_Axes082_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes082.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes082-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for elem//@*. + public void test_Axes083_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes083.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes083-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for elem//@*. + public void test_Axes083_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes083.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes083-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for elem//@*. + public void test_Axes083_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes083.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes083-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for elem//@name, due to none existing at all. + public void test_Axes084_1() throws Exception { + String inputFile = "/TestSources/TreeTrunc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes084.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes084-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //No attributes for elem//@name, none of that name exist. + public void test_Axes084_2() throws Exception { + String inputFile = "/TestSources/Tree1Child.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes084.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes084-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //1 attribute for elem//@name. + public void test_Axes084_3() throws Exception { + String inputFile = "/TestSources/TreeCompass.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes084.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes084-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Several attributes for elem//@name. + public void test_Axes084_4() throws Exception { + String inputFile = "/TestSources/TreeRepeat.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes084.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes084-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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 // to get all elements of a given name. + public void test_Axes085() throws Exception { + String inputFile = "/TestSources/nw_Customers.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes085.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes085.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Parent of attribute node. + public void test_Axes086() throws Exception { + String inputFile = "/TestSources/Tree1Text.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes086.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes086.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Parent of text nodes. + public void test_Axes087() throws Exception { + String inputFile = "/TestSources/xq311B.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes087.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes087.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Empty step should result in parse error. + public void test_Axes088() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes088.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a step axis, which operates on a non node context item. + public void test_axis_err_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/axis-err-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericModTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericModTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericModTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericModTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,877 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericModTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:int(lower bound) $arg2 = xs:int(upper bound). + public void test_op_numeric_modint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(mid range). + public void test_op_numeric_modintg2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modintg2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modintg2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:integer(lower bound) $arg2 = xs:integer(upper bound). + public void test_op_numeric_modintg2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modintg2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modintg2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(mid range). + public void test_op_numeric_moddec2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-moddec2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-moddec2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:decimal(lower bound) $arg2 = xs:decimal(upper bound). + public void test_op_numeric_moddec2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-moddec2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-moddec2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:double(lower bound) $arg2 = xs:double(upper bound). + public void test_op_numeric_moddbl2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-moddbl2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-moddbl2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:float(lower bound) $arg2 = xs:float(upper bound). + public void test_op_numeric_modflt2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modflt2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modflt2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:long(lower bound) $arg2 = xs:long(upper bound). + public void test_op_numeric_modlng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modlng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modlng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(mid range). + public void test_op_numeric_modusht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modusht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modusht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:unsignedShort(lower bound) $arg2 = xs:unsignedShort(upper bound). + public void test_op_numeric_modusht2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modusht2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modusht2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_modpint2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:positiveInteger(mid range) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_modpint2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:positiveInteger(upper bound) $arg2 = xs:positiveInteger(lower bound). + public void test_op_numeric_modpint2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(mid range). + public void test_op_numeric_modpint2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:positiveInteger(lower bound) $arg2 = xs:positiveInteger(upper bound). + public void test_op_numeric_modpint2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modpint2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(mid range). + public void test_op_numeric_modulng2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modulng2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modulng2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:unsignedLong(lower bound) $arg2 = xs:unsignedLong(upper bound). + public void test_op_numeric_modulng2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modulng2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modulng2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(mid range). + public void test_op_numeric_modnni2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modnni2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modnni2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:nonNegativeInteger(lower bound) $arg2 = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_modnni2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modnni2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modnni2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-mod" operator with the arguments set as follows: $arg1 = xs:short(lower bound) $arg2 = xs:short(upper bound). + public void test_op_numeric_modsht2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modsht2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modsht2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple mod test with () as one operand should return null. + public void test_op_numeric_modmix2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modmix2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modmix2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple mod test pass string for second operator. + public void test_op_numeric_modmix2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modmix2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple mod test, second operator cast string to integer. + public void test_op_numeric_modmix2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modmix2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericMod/op-numeric-modmix2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NameTestTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NameTestTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NameTestTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NameTestTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NameTestTest extends AbstractPsychoPathTest { + + //Simple test for * node test. + public void test_NodeTest003() throws Exception { + String inputFile = "/TestSources/nw_Customers.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest003.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest003.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test for . node test. + public void test_NodeTest004() throws Exception { + String inputFile = "/TestSources/nw_Customers.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest004.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest004.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple test for . and * node test. + public void test_NodeTest005() throws Exception { + String inputFile = "/TestSources/nw_Customers.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/NodeTest005.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/NodeTest005.xml"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that evaluates "child::*" of a newly construted node. + public void test_nametest_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that evaluates "child::b" of a newly construted node. + public void test_nametest_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that uses an unknown prefix. + public void test_nametest_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that uses an unknown prefix. Uses "*". + public void test_nametest_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that examines "*:b" for a newly constructed element. + public void test_nametest_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that examines "ns1:b" for a newly constructed element that uses a declared namespace. + public void test_nametest_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that examines "b" for a newly constructed element node. + public void test_nametest_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that examines "b" for a newly constructed element node and used as argument to "node-name" function. + public void test_nametest_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that attempts to select a non-existent node from a newly constructed element node. + public void test_nametest_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects an "child::b" of a newly created element node and whose namespace URI is declared as the default namespace. + public void test_nametest_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects an "child::b" of a newly created element node and whose namespace URI is in no namespace. + public void test_nametest_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects an "child::*:day" of an element node used as part of an union operation. + public void test_nametest_12() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects an "child::*" and "child::day" (same nodes) of an element node used as part of an intersect operation. + public void test_nametest_13() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects an "child::*" and "child::day" (same nodes) of an element node used as part of an except operation. + public void test_nametest_14() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects all the children of the context node ("child::*"). + public void test_nametest_15() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects all the children of the context node ("child::employee"). + public void test_nametest_16() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Name test that selects all the children of the context node ("child::*:employee"). + public void test_nametest_17() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a name test, which selects a child that was created using a declared namespace (qualified name). Use "child::*:b" syntax. + public void test_nametest_18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/NodeTest/nametest-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/NodeTest/nametest-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryPlusTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryPlusTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryPlusTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/NumericUnaryPlusTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1469 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class NumericUnaryPlusTest extends AbstractPsychoPathTest { + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:int(lower bound). + public void test_op_numeric_unary_plusint1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusint1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusint1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:int(mid range). + public void test_op_numeric_unary_plusint1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusint1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusint1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:int(upper bound). + public void test_op_numeric_unary_plusint1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusint1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusint1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:integer(lower bound). + public void test_op_numeric_unary_plusintg1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusintg1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusintg1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:integer(mid range). + public void test_op_numeric_unary_plusintg1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusintg1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusintg1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:integer(upper bound). + public void test_op_numeric_unary_plusintg1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusintg1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusintg1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:decimal(lower bound). + public void test_op_numeric_unary_plusdec1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdec1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdec1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:decimal(mid range). + public void test_op_numeric_unary_plusdec1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdec1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdec1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:decimal(upper bound). + public void test_op_numeric_unary_plusdec1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdec1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdec1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:double(lower bound). + public void test_op_numeric_unary_plusdbl1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdbl1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdbl1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:double(mid range). + public void test_op_numeric_unary_plusdbl1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdbl1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdbl1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:double(upper bound). + public void test_op_numeric_unary_plusdbl1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdbl1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusdbl1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:float(lower bound). + public void test_op_numeric_unary_plusflt1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusflt1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusflt1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:float(mid range). + public void test_op_numeric_unary_plusflt1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusflt1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusflt1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:float(upper bound). + public void test_op_numeric_unary_plusflt1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusflt1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusflt1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:long(lower bound). + public void test_op_numeric_unary_pluslng1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluslng1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluslng1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:long(mid range). + public void test_op_numeric_unary_pluslng1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluslng1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluslng1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:long(upper bound). + public void test_op_numeric_unary_pluslng1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluslng1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluslng1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:unsignedShort(lower bound). + public void test_op_numeric_unary_plususht1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plususht1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plususht1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:unsignedShort(mid range). + public void test_op_numeric_unary_plususht1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plususht1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plususht1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:unsignedShort(upper bound). + public void test_op_numeric_unary_plususht1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plususht1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plususht1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:negativeInteger(lower bound). + public void test_op_numeric_unary_plusnint1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnint1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnint1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:negativeInteger(mid range). + public void test_op_numeric_unary_plusnint1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnint1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnint1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:negativeInteger(upper bound). + public void test_op_numeric_unary_plusnint1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnint1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnint1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:positiveInteger(lower bound). + public void test_op_numeric_unary_pluspint1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluspint1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluspint1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:positiveInteger(mid range). + public void test_op_numeric_unary_pluspint1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluspint1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluspint1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:positiveInteger(upper bound). + public void test_op_numeric_unary_pluspint1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluspint1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-pluspint1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:unsignedLong(lower bound). + public void test_op_numeric_unary_plusulng1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusulng1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusulng1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:unsignedLong(mid range). + public void test_op_numeric_unary_plusulng1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusulng1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusulng1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:unsignedLong(upper bound). + public void test_op_numeric_unary_plusulng1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusulng1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusulng1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:nonPositiveInteger(lower bound). + public void test_op_numeric_unary_plusnpi1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnpi1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnpi1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:nonPositiveInteger(mid range). + public void test_op_numeric_unary_plusnpi1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnpi1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnpi1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:nonPositiveInteger(upper bound). + public void test_op_numeric_unary_plusnpi1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnpi1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnpi1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:nonNegativeInteger(lower bound). + public void test_op_numeric_unary_plusnni1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnni1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnni1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:nonNegativeInteger(mid range). + public void test_op_numeric_unary_plusnni1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnni1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnni1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:nonNegativeInteger(upper bound). + public void test_op_numeric_unary_plusnni1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnni1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plusnni1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:short(lower bound). + public void test_op_numeric_unary_plussht1args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plussht1args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plussht1args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:short(mid range). + public void test_op_numeric_unary_plussht1args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plussht1args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plussht1args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:numeric-unary-plus" operator with the arguments set as follows: $arg = xs:short(upper bound). + public void test_op_numeric_unary_plussht1args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plussht1args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/NumericOpr/NumericUnaryPlus/op-numeric-unary-plussht1args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationMultiplyTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationMultiplyTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationMultiplyTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationMultiplyTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,914 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class YearMonthDurationMultiplyTest extends AbstractPsychoPathTest { + + //Evaluates the "op:multiply-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:double(lower bound). + public void test_op_multiply_yearMonthDuration2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(mid range) $arg2 = xs:double(lower bound). + public void test_op_multiply_yearMonthDuration2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(upper bound) $arg2 = xs:double(lower bound). + public void test_op_multiply_yearMonthDuration2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:double(mid range). + public void test_op_multiply_yearMonthDuration2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:double(upper bound). + public void test_op_multiply_yearMonthDuration2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_multiply_yearMonthDuration_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_multiply_yearMonthDuration_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_multiply_yearMonthDuration_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator used in conjunction with the "fn:not" function. + public void test_op_multiply_yearMonthDuration_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator as an argument to the "fn:boolean" function. + public void test_op_multiply_yearMonthDuration_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator as an argument to the "fn:number" function. + public void test_op_multiply_yearMonthDuration_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator as an argument to the "fn:string" function. + public void test_op_multiply_yearMonthDuration_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator that returns a negative value. + public void test_op_multiply_yearMonthDuration_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator, which is part of an "and" expression. + public void test_op_multiply_yearMonthDuration_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator as part of an "or" expression. + public void test_op_multiply_yearMonthDuration_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" function, which is part of a div expression. + public void test_op_multiply_yearMonthDuration_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_multiply_yearMonthDuration_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" function, which is part of a numeric-equal expression (eq operator). + public void test_op_multiply_yearMonthDuration_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" function, which is part of a numeric-equal expression (ne operator). + public void test_op_multiply_yearMonthDuration_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" function, which is part of a numeric-equal expression (le operator). + public void test_op_multiply_yearMonthDuration_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" function, which is part of a numeric-equal expression (ge operator). + public void test_op_multiply_yearMonthDuration_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator multiplied by +0. + public void test_op_multiply_yearMonthDuration_17() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator multiplied by +0. + public void test_op_multiply_yearMonthDuration_18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:multiply-yearMonthDuration" operator, with $arg2 set to NAN, should raise error. + public void test_op_multiply_yearMonthDuration_19() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/op-multiply-yearMonthDuration-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationMultiply/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/UnabbrAxesTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/UnabbrAxesTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/UnabbrAxesTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/UnabbrAxesTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,988 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class UnabbrAxesTest extends AbstractPsychoPathTest { + + //Evaluates unabbreviated syntax - child::empnum - select empnum children of the context node. + public void test_unabbreviatedSyntax_1() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - child::* - select all element children of the context node. + public void test_unabbreviatedSyntax_2() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - child::text() - select all text node children of the context node. + public void test_unabbreviatedSyntax_3() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - child::node() - select all children of the context node. + public void test_unabbreviatedSyntax_4() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - child::node() - select all children of the context node. + public void test_unabbreviatedSyntax_5() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - parent::node() - Selects the parent of the context node. + public void test_unabbreviatedSyntax_8() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - descendant::empnum - Selects the "empnum" descendants of the context node. + public void test_unabbreviatedSyntax_9() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - descendant-or-self::employee - Selects all the "employee" descendant of the context node (selects employee, if the context node is "employee"). + public void test_unabbreviatedSyntax_12() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - self::employee - Selects the context node, if it is an "employee" element, otherwise returns empty sequence. This test retuns an "employee" element. + public void test_unabbreviatedSyntax_13() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax - self::hours - Selects the context node, if it is an "hours" element, otherwise returns empty sequence. This test retuns the empty sequence. + public void test_unabbreviatedSyntax_14() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax child::employee/descendant:empnum- Selects the empnum element descendants of the employee element children of the context node. + public void test_unabbreviatedSyntax_15() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax child::*/child:pnum)- Selects the pnum grandchildren of the context node. + public void test_unabbreviatedSyntax_16() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate /descendant::pnum - Selects all the pnum elements in the same document as the context node. + public void test_unabbreviatedSyntax_18() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate /descendant::employee/child::pnum selects all the pnum elements that have an "employee" parent and that are in the same document as the context node. + public void test_unabbreviatedSyntax_19() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::employee[fn:position() = 1]". Selects the first employee child of the context node. + public void test_unabbreviatedSyntax_20() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::employee[fn:position() = fn:last()]". Selects the last "employee" child of the context node. + public void test_unabbreviatedSyntax_21() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::employee[fn:position() = fn:last()-1]. Selects the previous to the last one "employee" child of the context node. + public void test_unabbreviatedSyntax_22() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-22.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::hours[fn:position() > 1]". Selects all the para children of the context node other than the first "hours" child of the context node. + public void test_unabbreviatedSyntax_23() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-23.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-23.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "/descendant::employee[fn:position() = 12]". Selects the twelfth employee element in the document containing the context node. + public void test_unabbreviatedSyntax_26() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-26.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-26.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "/child::works/child::employee[fn:position() = 5]/child::hours[fn:position() = 2]". Selects the second "hours" of the fifth "employee" of the "works" whose parent is the document node that contains the context node. + public void test_unabbreviatedSyntax_27() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-27.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-27.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::employee[attribute::name eq "Jane Doe 11"]". Selects all "employee" children of the context node that have a "name" attribute with value "Jane Doe 11". + public void test_unabbreviatedSyntax_28() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-28.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-28.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::employee[attribute::gender eq 'female'][fn:position() = 5]". Selects the fifth employee child of the context node that has a gender attribute with value "female". + public void test_unabbreviatedSyntax_29() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-29.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-29.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::employee[child::empnum = 'E3']". Selects the employee children of the context node that have one or more empnum children whose typed value is equal to the string "E3". + public void test_unabbreviatedSyntax_30() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-30.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-30.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::employee[child::status]". Selects the employee children of the context node that have one or more status children. + public void test_unabbreviatedSyntax_31() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-31.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-31.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::*[self::pnum or self::empnum]". Selects the pnum and empnum children of the context node. + public void test_unabbreviatedSyntax_32() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-32.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-32.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates unabbreviated syntax. Evaluate "child::*[self::empnum or self::pnum][fn:position() = fn:last()]". Selects the last empnum or pnum child of the context node. + public void test_unabbreviatedSyntax_33() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-33.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-33.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/ParenExprTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/ParenExprTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/ParenExprTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/ParenExprTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,526 @@ +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology for Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver (STAR) - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; +import java.util.Iterator; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class ParenExprTest extends AbstractPsychoPathTest { + + //Arithmetic operations. + public void test_Parenexpr_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Arithmetic operations. + public void test_Parenexpr_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Arithmetic operations. + public void test_Parenexpr_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Arithmetic operations. + public void test_Parenexpr_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Arithmetic operations. + public void test_Parenexpr_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Arithmetic operations. + public void test_Parenexpr_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Arithmetic operations. + public void test_Parenexpr_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Arithmetic operations. + public void test_Parenexpr_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Logical expressions. + public void test_Parenexpr_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Logical expressions. + public void test_Parenexpr_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //If expression. + public void test_Parenexpr_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Literal. + public void test_Parenexpr_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Sequence. + public void test_Parenexpr_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/ParenExpr/Parenexpr-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/ParenExpr/Parenexpr-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + Iterator iterator = rs.iterator(); + actual = new String(); + while (iterator.hasNext()) { + AnyType result = (AnyType)iterator.next(); + actual = actual + result.string_value() + " "; + } + + actual = actual.trim(); + + } 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); + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideDTDTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideDTDTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideDTDTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/DayTimeDurationDivideDTDTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class DayTimeDurationDivideDTDTest extends AbstractPsychoPathTest { + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_divide_dayTimeDuration_by_dayTimeDuration2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(mid range) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_divide_dayTimeDuration_by_dayTimeDuration2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(upper bound) $arg2 = xs:dayTimeDuration(lower bound). + public void test_op_divide_dayTimeDuration_by_dayTimeDuration2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(mid range). + public void test_op_divide_dayTimeDuration_by_dayTimeDuration2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator with the arguments set as follows: $arg1 = xs:dayTimeDuration(lower bound) $arg2 = xs:dayTimeDuration(upper bound). + public void test_op_divide_dayTimeDuration_by_dayTimeDuration2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dayTimeDuration2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_divide_dayTimeDuration_by_dTD_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_divide_dayTimeDuration_by_dTD_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_divide_dayTimeDuration_by_dTD_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator used in conjunction with the "fn:not" function. + public void test_op_divide_dayTimeDuration_by_dTD_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator as an argument to the "fn:boolean" function. + public void test_op_divide_dayTimeDuration_by_dTD_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator as an argument to the "fn:number" function. + public void test_op_divide_dayTimeDuration_by_dTD_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator as an argument to the "fn:string" function. + public void test_op_divide_dayTimeDuration_by_dTD_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator that returns a negative value. + public void test_op_divide_dayTimeDuration_by_dTD_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator, which is part of an "and" expression. + public void test_op_divide_dayTimeDuration_by_dTD_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" operator as part of an "or" expression. + public void test_op_divide_dayTimeDuration_by_dTD_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" function, which is part of a div expression. + public void test_op_divide_dayTimeDuration_by_dTD_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_divide_dayTimeDuration_by_dTD_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" function, which is part of a numeric-equal expression (eq operator). + public void test_op_divide_dayTimeDuration_by_dTD_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" function, which is part of a numeric-equal expression (ne operator). + public void test_op_divide_dayTimeDuration_by_dTD_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" function, which is part of a numeric-equal expression (le operator). + public void test_op_divide_dayTimeDuration_by_dTD_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-dayTimeDuration-by-dayTimeDuration" function, which is part of a numeric-equal expression (ge operator). + public void test_op_divide_dayTimeDuration_by_dTD_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/DayTimeDurationDivideDTD/op-divide-dayTimeDuration-by-dTD-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/FilterExprTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/FilterExprTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/FilterExprTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/FilterExprTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,840 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class FilterExprTest extends AbstractPsychoPathTest { + + //Simple filter using data query from xml source and the "gt" operator. + public void test_filterexpressionhc1() throws Exception { + String inputFile = "/TestSources/works.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression returning a sequence of integers between 1 and 25 divisible by 2. + public void test_filterexpressionhc2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression returning a single number. + public void test_filterexpressionhc3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression that queris xml source and uses a "|" operator. + public void test_filterexpressionhc4() throws Exception { + String inputFile = "/TestSources/works.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression as a stept in aptah expression. It uses the "last" function. + public void test_filterexpressionhc5() throws Exception { + String inputFile = "/TestSources/works.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the "ge" operator. + public void test_filterexpressionhc6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the "lt" operator. + public void test_filterexpressionhc7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the "le" operator. + public void test_filterexpressionhc8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the "eq" operator. + public void test_filterexpressionhc9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the "ne" operator. + public void test_filterexpressionhc10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving a boolean "and" expression. + public void test_filterexpressionhc11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving a boolean "or" expression. + public void test_filterexpressionhc12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving a division expression. + public void test_filterexpressionhc13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving a multiplication expression. + public void test_filterexpressionhc14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving an addition expression. + public void test_filterexpressionhc15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving a subtraction expression. + public void test_filterexpressionhc16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving an integer division (idiv) expression. + public void test_filterexpressionhc17() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the use of and "xs:string" function. + public void test_filterexpressionhc18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving two simple predicates. + public void test_filterexpressionhc19() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving two complex predicates. + public void test_filterexpressionhc20() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the "fn:true" function. + public void test_filterexpressionhc21() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Simple filter expression involving the "fn:false" function. + public void test_filterexpressionhc22() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc22.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/RangeExprTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/RangeExprTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/RangeExprTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/RangeExprTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1025 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class RangeExprTest extends AbstractPsychoPathTest { + + //Simple range expression using positive integers. + public void test_rangeExpr_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression of length one containing the single integer 10. + public void test_rangeExpr_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression that results in the sequence of length zero. + public void test_rangeExpr_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //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(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression that uses the empty sequence. + public void test_rangeExpr_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where both operands are addition operations. + public void test_rangeExpr_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where the first operand are negative numbers. + public void test_rangeExpr_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where both operands are negative integers. + public void test_rangeExpr_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //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(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //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(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where both operands are "xs:integer" functions. + public void test_rangeExpr_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, using the "fn:min" function. + public void test_rangeExpr_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, using the "fn:max" function. + public void test_rangeExpr_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, using the "fn:min" and "fn:max" functions. + public void test_rangeExpr_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression as an argument to the "fn:min" function. + public void test_rangeExpr_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression as an argument to the "fn:max" function. + public void test_rangeExpr_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression as an argument to the "fn:avg" function. + public void test_rangeExpr_17() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression as an argument to the "fn:count" function. + public void test_rangeExpr_18() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where the first operand is a multiplication operation. + public void test_rangeExpr_19() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where the second operand is a multiplication operation. + public void test_rangeExpr_20() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where both operands are multiplication operations. + public void test_rangeExpr_21() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where the first operand is a subtraction operation. + public void test_rangeExpr_22() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-22.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where the second operand is a subtraction operation. + public void test_rangeExpr_23() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-23.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-23.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where both operands are subtraction operations. + public void test_rangeExpr_24() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-24.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-24.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where the first operand is a division operation. + public void test_rangeExpr_25() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-25.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-25.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where the second operand is a division operation. + public void test_rangeExpr_26() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-26.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-26.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluation of a range expression, where both operands are division operations. + public void test_rangeExpr_27() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/SeqExpr/RangeExpr/rangeExpr-27.xq"; + String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/RangeExpr/rangeExpr-27.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationAddTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationAddTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationAddTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationAddTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class YearMonthDurationAddTest extends AbstractPsychoPathTest { + + //Evaluates the "op:add-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_add_yearMonthDurations2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(mid range) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_add_yearMonthDurations2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(upper bound) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_add_yearMonthDurations2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(mid range). + public void test_op_add_yearMonthDurations2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(upper bound). + public void test_op_add_yearMonthDurations2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_add_yearMonthDurations_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_add_yearMonthDurations_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_add_yearMonthDurations_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator used in conjunction with the "fn:not" function. + public void test_op_add_yearMonthDurations_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator as an argument to the "fn:boolean" function. + public void test_op_add_yearMonthDurations_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator as an argument to the "fn:number" function. + public void test_op_add_yearMonthDurations_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator as an argument to the "fn:string" function. + public void test_op_add_yearMonthDurations_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator that returns a negative value. + public void test_op_add_yearMonthDurations_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator, which is part of an "and" expression. + public void test_op_add_yearMonthDurations_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" operator as part of an "or" expression. + public void test_op_add_yearMonthDurations_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" function, which is part of a div expression. + public void test_op_add_yearMonthDurations_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_add_yearMonthDurations_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" function, which is part of a numeric-equal expression (eq operator). + public void test_op_add_yearMonthDurations_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" function, which is part of a numeric-equal expression (ne operator). + public void test_op_add_yearMonthDurations_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" function, which is part of a numeric-equal expression (le operator). + public void test_op_add_yearMonthDurations_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:add-yearMonthDurations" function, which is part of a numeric-equal expression (ge operator). + public void test_op_add_yearMonthDurations_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationAdd/op-add-yearMonthDurations-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideYMDTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideYMDTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideYMDTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/YearMonthDurationDivideYMDTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,803 @@ + +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology in Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver - STAR - initial api and implementation bug 262765 + *******************************************************************************/ +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class YearMonthDurationDivideYMDTest extends AbstractPsychoPathTest { + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_divide_yearMonthDuration_by_yearMonthDuration2args_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(mid range) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_divide_yearMonthDuration_by_yearMonthDuration2args_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(upper bound) $arg2 = xs:yearMonthDuration(lower bound). + public void test_op_divide_yearMonthDuration_by_yearMonthDuration2args_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(mid range). + public void test_op_divide_yearMonthDuration_by_yearMonthDuration2args_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator with the arguments set as follows: $arg1 = xs:yearMonthDuration(lower bound) $arg2 = xs:yearMonthDuration(upper bound). + public void test_op_divide_yearMonthDuration_by_yearMonthDuration2args_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yearMonthDuration2args-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator as per example 1 (for this function) of the Functions and Operators spec. + public void test_op_divide_yearMonthDuration_by_yMD_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-1.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator as part of a boolean expression (and operator) and the "fn:false" function. + public void test_op_divide_yearMonthDuration_by_yMD_2() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" opeartor as part of a boolean expression (or operator) and the "fn:false" function. + public void test_op_divide_yearMonthDuration_by_yMD_3() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator used in conjunction with the "fn:not" function. + public void test_op_divide_yearMonthDuration_by_yMD_4() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator as an argument to the "fn:boolean" function. + public void test_op_divide_yearMonthDuration_by_yMD_5() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator as an argument to the "fn:number" function. + public void test_op_divide_yearMonthDuration_by_yMD_6() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator as an argument to the "fn:string" function. + public void test_op_divide_yearMonthDuration_by_yMD_7() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator that returns a negative value. + public void test_op_divide_yearMonthDuration_by_yMD_8() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator, which is part of an "and" expression. + public void test_op_divide_yearMonthDuration_by_yMD_9() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" operator as part of an "or" expression. + public void test_op_divide_yearMonthDuration_by_yMD_10() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" function, which is part of a div expression. + public void test_op_divide_yearMonthDuration_by_yMD_11() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" function used in conjunction with a boolean expression and the "fn:true" function. + public void test_op_divide_yearMonthDuration_by_yMD_12() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" function, which is part of a numeric-equal expression (eq operator). + public void test_op_divide_yearMonthDuration_by_yMD_13() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" function, which is part of a numeric-equal expression (ne operator). + public void test_op_divide_yearMonthDuration_by_yMD_14() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" function, which is part of a numeric-equal expression (le operator). + public void test_op_divide_yearMonthDuration_by_yMD_15() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + + //Evaluates the "op:divide-yearMonthDuration-by-yearMonthDuration" function, which is part of a numeric-equal expression (ge operator). + public void test_op_divide_yearMonthDuration_by_yMD_16() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/Operators/ArithExpr/DurationArith/YearMonthDurationDivideYMD/op-divide-yearMonthDuration-by-yMD-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/ExternalContextExprTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/ExternalContextExprTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/ExternalContextExprTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/ExternalContextExprTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,938 @@ +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology for Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver (STAR) - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.*; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; + + +public class ExternalContextExprTest extends AbstractPsychoPathTest { + + //Context Item expression that just uses the "name" element and no context item defined. + public void test_externalcontextitem_1() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-1.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used as a string. + public void test_externalcontextitem_2() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-2.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-2.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used as an integer. + public void test_externalcontextitem_3() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-3.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-3.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used as a decimal. + public void test_externalcontextitem_4() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-4.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-4.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used a float. + public void test_externalcontextitem_5() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-5.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-5.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used as a double. + public void test_externalcontextitem_6() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-6.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-6.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used as a boolean value. + public void test_externalcontextitem_7() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-7.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-7.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used as a boolean with fn:not. + public void test_externalcontextitem_8() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-8.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-8.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item is used as argument to sum function. + public void test_externalcontextitem_9() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-9.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-9.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of addition operation. + public void test_externalcontextitem_10() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-10.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-10.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of a subtraction operation. + public void test_externalcontextitem_11() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-11.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-11.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of a multiplication operation. + public void test_externalcontextitem_12() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-12.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-12.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of a modulus operation. + public void test_externalcontextitem_13() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-13.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-13.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of a divison (div operator) operation. + public void test_externalcontextitem_14() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-14.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-14.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of a divison (idiv operator) operation. + public void test_externalcontextitem_15() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-15.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-15.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of a boolean expression (and operator). + public void test_externalcontextitem_16() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-16.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-16.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as part of a boolean expression (or operator). + public void test_externalcontextitem_17() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-17.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-17.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as argument to string-length function. + public void test_externalcontextitem_18() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-18.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-18.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as argument to "avg" function. + public void test_externalcontextitem_19() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-19.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-19.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as argument to "min" function. + public void test_externalcontextitem_20() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-20.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-20.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as argument to "max" function. + public void test_externalcontextitem_21() throws Exception { + String inputFile = "/TestSources/works-mod.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-21.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-21.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as argument to "max" function. + public void test_externalcontextitem_22() throws Exception { + String inputFile = "/TestSources/.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-22.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Reference to a context item that has not been bound. + public void test_externalcontextitem_23() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-23.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + + //Evaluation of external context item expression where context item used as argument to "max" function. + public void test_externalcontextitem_24() throws Exception { + String inputFile = "/TestSources/.xml"; + String xqFile = "/Queries/XQuery/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-24.xq"; + String resultFile = "/ExpectedTestResults/Expressions/ContextExpr/ExternalContextExpr/externalcontextitem-22.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } 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); + + + } + +} + \ No newline at end of file Index: src/org/eclipse/wst/xml/xpath2/processor/testsuite/LiteralsTest.java =================================================================== RCS file: src/org/eclipse/wst/xml/xpath2/processor/testsuite/LiteralsTest.java diff -N src/org/eclipse/wst/xml/xpath2/processor/testsuite/LiteralsTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/wst/xml/xpath2/processor/testsuite/LiteralsTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,2372 @@ +/******************************************************************************* + * Copyright (c) 2009 Standards for Technology for Automotive Retail and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Carver (STAR) - initial API and implementation + *******************************************************************************/ + +package org.eclipse.wst.xml.xpath2.processor.testsuite; + +import java.net.URL; + +import org.apache.xerces.xs.XSModel; +import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator; +import org.eclipse.wst.xml.xpath2.processor.DynamicContext; +import org.eclipse.wst.xml.xpath2.processor.Evaluator; +import org.eclipse.wst.xml.xpath2.processor.ResultSequence; +import org.eclipse.wst.xml.xpath2.processor.ast.XPath; +import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; +import org.eclipse.wst.xml.xpath2.processor.XPathParserException; +import org.eclipse.wst.xml.xpath2.processor.test.AbstractPsychoPathTest; +import org.eclipse.wst.xml.xpath2.processor.StaticError; + + +public class LiteralsTest extends AbstractPsychoPathTest { + + //Simple use case for string literals. + public void test_Literals001() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals001.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals001.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Simple use case for string literals. + public void test_Literals002() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals002.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals002.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test case where string literal contains a new line. + public void test_Literals003() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals003.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals003.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test case where string literal contains a new line. + public void test_Literals004() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals004.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals004.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + + //Unterminated string literal. + public void test_Literals006() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals006.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Unterminated string literal. + public void test_Literals007() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals007.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Incorrectly terminated string literal. + public void test_Literals008() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals008.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Incorrectly terminated string literal. + public void test_Literals009() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals009.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid interger literal. + public void test_Literals010() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals010.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals010.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid interger literal. + public void test_Literals011() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals011.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals011.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid decimal literal. + public void test_Literals012() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals012.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals012.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid decimal literal. + public void test_Literals013() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals013.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals013.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid decimal literal. + public void test_Literals014() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals014.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals014.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid decimal literal. + public void test_Literals015() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals015.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals015.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //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(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals017() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals017.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals017.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals018() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals018.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals018.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals019() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals019.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals019.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals020() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals020.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals020.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals021() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals021.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals021.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //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(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals023() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals023.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals023.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals024() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals024.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals024.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals025() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals025.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals025.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals026() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals026.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals026.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals027() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals027.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals027.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals028() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals028.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals028.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals029() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals029.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals029.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals030() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals030.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals030.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals031() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals031.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals031.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals032() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals032.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals032.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals033() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals033.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals033.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals034() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals034.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals034.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for valid double literal. + public void test_Literals035() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals035.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals035.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid decimal literal. + public void test_Literals036() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals036.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid decimal literal. + public void test_Literals037() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals037.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid decimal literal. + public void test_Literals038() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals038.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid decimal literal. + public void test_Literals039() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals039.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid decimal literal. + public void test_Literals040() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals040.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals041() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals041.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals042() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals042.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals043() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals043.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals044() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals044.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals045() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals045.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //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 resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals047() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals047.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals048() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals048.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals049() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals049.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals050() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals050.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals051() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals051.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //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 resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals053() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals053.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for invalid double literal. + public void test_Literals054() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals054.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //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 resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for string literal containing the predefined entity reference '&'. + public void test_Literals056() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals056.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals056.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for string literal containing the predefined entity reference '"'. + public void test_Literals057() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals057.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals057.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for string literal containing the predefined entity reference '''. + public void test_Literals058() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals058.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals058.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for string literal containing the predefined entity reference '<'. + public void test_Literals059() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals059.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals059.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test for string literal containing the predefined entity reference '>'. + public void test_Literals060() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals060.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals060.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test the escaping of the " (quotation) character in XQuery. + public void test_Literals062() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals062.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals062.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test the escaping of the ' (apostrophe) character in XQuery. + public void test_Literals063() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals063.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals063.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test the escaping of the ' (apostrophe) and " (quotation) characters in XQuery. + public void test_Literals064() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals064.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals064.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test the escaping of the ' (apostrophe) and " (quotation) characters in XQuery. + public void test_Literals065() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals065.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals065.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + } + + + //Test the escaping of the ' (apostrophe) and " (quotation) characters as part of an XML text node constructor. + public void test_Literals068() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals068.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals068.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + + //Test the escaping of the ' (apostrophe) and " (quotation) characters as part of an XML text node constructor. + public void test_Literals069() throws Exception { + String inputFile = "/TestSources/emptydoc.xml"; + String xqFile = "/Queries/XQuery/Expressions/PrimaryExpr/Literals/Literals069.xq"; + String resultFile = "/ExpectedTestResults/Expressions/PrimaryExpr/Literals/Literals069.txt"; + String expectedResult = getExpectedResult(resultFile); + URL fileURL = bundle.getEntry(inputFile); + loadDOMDocument(fileURL); + + // Get XML Schema Information for the Document + XSModel schema = getGrammar(); + + DynamicContext dc = setupDynamicContext(schema); + + String xpath = extractXPathExpression(xqFile, inputFile); + String actual = null; + try { + XPath path = compileXPath(dc, xpath); + + Evaluator eval = new DefaultEvaluator(dc, domDoc); + ResultSequence rs = eval.evaluate(path); + + AnyType result = rs.first(); + + actual = result.string_value(); + } catch (XPathParserException ex) { + actual = ex.code(); + } catch (StaticError ex) { + actual = ex.code(); + } + + assertEquals("XPath Result Error:", expectedResult, actual); + + + } + +} + \ No newline at end of file