Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/testsuite/dates/YearMonthDurationDivideTest.java')
-rw-r--r--tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/testsuite/dates/YearMonthDurationDivideTest.java783
1 files changed, 0 insertions, 783 deletions
diff --git a/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/testsuite/dates/YearMonthDurationDivideTest.java b/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/testsuite/dates/YearMonthDurationDivideTest.java
deleted file mode 100644
index a8147be1..00000000
--- a/tests/org.eclipse.wst.xml.xpath2.processor.tests/src/org/eclipse/wst/xml/xpath2/processor/testsuite/dates/YearMonthDurationDivideTest.java
+++ /dev/null
@@ -1,783 +0,0 @@
-
-/*******************************************************************************
- * 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.dates;
-
-import java.net.URL;
-
-import org.apache.xerces.xs.XSModel;
-import org.eclipse.wst.xml.xpath2.processor.DynamicError;
-import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
-import org.eclipse.wst.xml.xpath2.processor.StaticError;
-import org.eclipse.wst.xml.xpath2.processor.XPathParserException;
-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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
- //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();
-
- setupDynamicContext(schema);
-
- String xpath = extractXPathExpression(xqFile, inputFile);
- String actual = null;
- try {
- compileXPath(xpath);
- ResultSequence rs = evaluate(domDoc);
-
-
- actual = buildResultString(rs);
-
- } catch (XPathParserException ex) {
- actual = ex.code();
- } catch (StaticError ex) {
- actual = ex.code();
- } catch (DynamicError ex) {
- actual = ex.code();
- }
-
- assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
-
-
- }
-
-}
- \ No newline at end of file

Back to the top