Added a few single query tests and fixed the maven test to run the XQuery test suite.
Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/6ded3150 Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/6ded3150 Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/6ded3150 Branch: refs/heads/site Commit: 6ded3150f39df3b223adcda4f1b329e9b4819c1f Parents: 1ac6b40 Author: Preston Carman <[email protected]> Authored: Mon Aug 18 16:41:41 2014 -0700 Committer: Preston Carman <[email protected]> Committed: Mon Aug 18 16:41:41 2014 -0700 ---------------------------------------------------------------------- .../org/apache/vxquery/xtest/TestRunner.java | 1 + .../org/apache/vxquery/xtest/VXQueryTest.java | 8 +- .../src/test/resources/VXQueryCatalog.xml | 23 +++++ .../resources/VXQuerySingleAlternateCatalog.xml | 96 ++++++++++++++++++++ .../src/test/resources/VXQuerySingleCatalog.xml | 3 +- .../test/resources/cat/SingleAlternateQuery.xml | 28 ++++++ 6 files changed, 152 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/vxquery/blob/6ded3150/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java index 9c0bc64..daba8ca 100644 --- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java +++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java @@ -133,6 +133,7 @@ public class TestRunner { res.result.trim(); hcc.waitForCompletion(jobId); } catch (HyracksException e) { + e.printStackTrace(); Throwable t = e; while (t.getCause() != null) { t = t.getCause(); http://git-wip-us.apache.org/repos/asf/vxquery/blob/6ded3150/vxquery-xtest/src/test/java/org/apache/vxquery/xtest/VXQueryTest.java ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/java/org/apache/vxquery/xtest/VXQueryTest.java b/vxquery-xtest/src/test/java/org/apache/vxquery/xtest/VXQueryTest.java index b9dc37d..a759819 100644 --- a/vxquery-xtest/src/test/java/org/apache/vxquery/xtest/VXQueryTest.java +++ b/vxquery-xtest/src/test/java/org/apache/vxquery/xtest/VXQueryTest.java @@ -32,13 +32,13 @@ public class VXQueryTest { private TestCase tc; private TestRunner tr; - // private final String CATALOG = "VXQueryCatalog.xml"; - private static String CATALOG = "VXQuerySingleCatalog.xml"; + private static String CATALOG = "VXQueryCatalog.xml"; private static XTestOptions getOptions() { XTestOptions opts = new XTestOptions(); opts.catalog = StringUtils.join(new String[] { "src", "test", "resources", CATALOG }, File.separator); opts.verbose = true; + opts.threads = 1; return opts; } @@ -50,7 +50,6 @@ public class VXQueryTest { public VXQueryTest(TestCase tc) throws Exception { this.tc = tc; - System.err.println("Query: " + tc.getXQueryFile()); tr = new TestRunner(getOptions()); } @@ -58,9 +57,6 @@ public class VXQueryTest { public void test() throws Exception { tr.open(); TestCaseResult result = tr.run(tc); - System.err.println("result.result: " + result.result); - System.err.println("result.report: " + result.report); - System.err.println("result.state: " + result.state); switch (result.state) { case EXPECTED_ERROR_GOT_DIFFERENT_ERROR: case EXPECTED_ERROR_GOT_FAILURE: http://git-wip-us.apache.org/repos/asf/vxquery/blob/6ded3150/vxquery-xtest/src/test/resources/VXQueryCatalog.xml ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml index 014005a..30ebdc5 100644 --- a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml +++ b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml @@ -34,6 +34,9 @@ <!ENTITY GhcndCountPartition2Queries SYSTEM "cat/GhcndCountPartition2Queries.xml"> <!ENTITY GhcndCountPartition4Queries SYSTEM "cat/GhcndCountPartition4Queries.xml"> +<!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml"> +<!ENTITY SingleAlternateQuery SYSTEM "cat/SingleAlternateQuery.xml"> + ]> <test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -78,6 +81,26 @@ <description last-mod="2014-04-02">Collection of files</description> </source> </sources> + <test-group name="SingleQuery" featureOwner="Preston Carman"> + <GroupInfo> + <title>Single Query</title> + <description/> + </GroupInfo> + <test-group name="SingleTestAdd" featureOwner="Preston Carman"> + <GroupInfo> + <title>Single Test Add</title> + <description/> + </GroupInfo> + &SingleQuery; + </test-group> + <test-group name="SingleTestList" featureOwner="Preston Carman"> + <GroupInfo> + <title>Single Test List</title> + <description/> + </GroupInfo> + &SingleAlternateQuery; + </test-group> + </test-group> <test-group name="AggregatePartitionQueries" featureOwner="Preston Carman"> <GroupInfo> <title>Aggregate Partition Queries</title> http://git-wip-us.apache.org/repos/asf/vxquery/blob/6ded3150/vxquery-xtest/src/test/resources/VXQuerySingleAlternateCatalog.xml ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/VXQuerySingleAlternateCatalog.xml b/vxquery-xtest/src/test/resources/VXQuerySingleAlternateCatalog.xml new file mode 100644 index 0000000..c0fe358 --- /dev/null +++ b/vxquery-xtest/src/test/resources/VXQuerySingleAlternateCatalog.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!DOCTYPE test-suite [ + +<!ENTITY AggregatePartition1Queries SYSTEM "cat/AggregatePartition1Queries.xml"> +<!ENTITY AggregatePartition2Queries SYSTEM "cat/AggregatePartition2Queries.xml"> +<!ENTITY AggregatePartition4Queries SYSTEM "cat/AggregatePartition4Queries.xml"> + +<!ENTITY GhcndPartition1Queries SYSTEM "cat/GhcndPartition1Queries.xml"> +<!ENTITY GhcndPartition2Queries SYSTEM "cat/GhcndPartition2Queries.xml"> +<!ENTITY GhcndPartition4Queries SYSTEM "cat/GhcndPartition4Queries.xml"> + +<!ENTITY GhcndRecordsPartition1Queries SYSTEM "cat/GhcndRecordsPartition1Queries.xml"> +<!ENTITY GhcndRecordsPartition2Queries SYSTEM "cat/GhcndRecordsPartition2Queries.xml"> +<!ENTITY GhcndRecordsPartition4Queries SYSTEM "cat/GhcndRecordsPartition4Queries.xml"> + +<!ENTITY GhcndCountPartition1Queries SYSTEM "cat/GhcndCountPartition1Queries.xml"> +<!ENTITY GhcndCountPartition2Queries SYSTEM "cat/GhcndCountPartition2Queries.xml"> +<!ENTITY GhcndCountPartition4Queries SYSTEM "cat/GhcndCountPartition4Queries.xml"> + +<!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml"> + +]> +<test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + CatalogDesignDate="2014-04-01" + version="0.0.1" + SourceOffsetPath="./" + ResultOffsetPath="ExpectedTestResults/" + XQueryQueryOffsetPath="Queries/XQuery/" + XQueryXQueryOffsetPath="Queries/XQueryX/" + XQueryFileExtension=".xq" + XQueryXFileExtension=".xqx" + xsi:schemaLocation="http://www.w3.org/2005/02/query-test-XQTSCatalog XQTSCatalog.xsd"> + <test-suite-info> + <title>VXQuery Test Suite</title> + <description> + Test Suite for VXQuery. + </description> + </test-suite-info> + <sources> + <source ID="VXQueryCatalog" FileName="VXQueryCatalog.xml" Creator="VXQuery team"> + <description last-mod="2014-04-02">VXQuery Test Suite Catalog</description> + </source> + <source ID="ghcnd" FileName="TestSources/ghcnd" Creator="Preston Carman"> + <description last-mod="2014-04-02">Collection of files</description> + </source> + <source ID="ghcnd_half_1" FileName="TestSources/ghcnd/half_1" Creator="Preston Carman"> + <description last-mod="2014-04-02">Collection of files</description> + </source> + <source ID="ghcnd_half_2" FileName="TestSources/ghcnd/half_2" Creator="Preston Carman"> + <description last-mod="2014-04-02">Collection of files</description> + </source> + <source ID="ghcnd_quarter_1" FileName="TestSources/ghcnd/half_1/quarter_1" Creator="Preston Carman"> + <description last-mod="2014-04-02">Collection of files</description> + </source> + <source ID="ghcnd_quarter_2" FileName="TestSources/ghcnd/half_1/quarter_2" Creator="Preston Carman"> + <description last-mod="2014-04-02">Collection of files</description> + </source> + <source ID="ghcnd_quarter_3" FileName="TestSources/ghcnd/half_2/quarter_3" Creator="Preston Carman"> + <description last-mod="2014-04-02">Collection of files</description> + </source> + <source ID="ghcnd_quarter_4" FileName="TestSources/ghcnd/half_2/quarter_4" Creator="Preston Carman"> + <description last-mod="2014-04-02">Collection of files</description> + </source> + </sources> + <test-group name="SingleQuery" featureOwner="Preston Carman"> + <GroupInfo> + <title>Single Query</title> + <description/> + </GroupInfo> + <test-group name="SingleTest" featureOwner="Preston Carman"> + <GroupInfo> + <title>Single Test</title> + <description/> + </GroupInfo> + &SingleQuery; + </test-group> + </test-group> +</test-suite> http://git-wip-us.apache.org/repos/asf/vxquery/blob/6ded3150/vxquery-xtest/src/test/resources/VXQuerySingleCatalog.xml ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/VXQuerySingleCatalog.xml b/vxquery-xtest/src/test/resources/VXQuerySingleCatalog.xml index c0fe358..7be226f 100644 --- a/vxquery-xtest/src/test/resources/VXQuerySingleCatalog.xml +++ b/vxquery-xtest/src/test/resources/VXQuerySingleCatalog.xml @@ -35,6 +35,7 @@ <!ENTITY GhcndCountPartition4Queries SYSTEM "cat/GhcndCountPartition4Queries.xml"> <!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml"> +<!ENTITY SingleAlternateQuery SYSTEM "cat/SingleAlternateQuery.xml"> ]> <test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" @@ -90,7 +91,7 @@ <title>Single Test</title> <description/> </GroupInfo> - &SingleQuery; + &SingleAlternateQuery; </test-group> </test-group> </test-suite> http://git-wip-us.apache.org/repos/asf/vxquery/blob/6ded3150/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml b/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml new file mode 100644 index 0000000..ea444d8 --- /dev/null +++ b/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml @@ -0,0 +1,28 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="AggregatePartition1Queries" featureOwner="VXQuery"> + <GroupInfo> + <title>Single Test</title> + <description/> + </GroupInfo> + <test-case name="simple-list" FilePath="Simple/" Creator="Preston Carman"> + <description>Adds two numbers.</description> + <query name="list" date="2014-08-18"/> + <output-file compare="Text">list.txt</output-file> + </test-case> +</test-group> \ No newline at end of file
