From 2145a5e2293e15d1c34191b7d9245561c3b4e3e7 Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Fri, 14 Mar 2014 14:23:20 +0100 Subject: [PATCH] Port regression/randomized testing to JUnit --- Makefile | 7 - docs/.gitignore | 14 -- docs/Makefile | 22 --- mkdist | 21 --- src/main/java/org/z3950/zing/cql/CQLParser.java | 2 +- src/main/java/org/z3950/zing/cql/Makefile | 33 ---- .../java/org/z3950/zing/cql/CQLParserTest.java | 182 ++++++++++++++++++++ src/test/resources/generate.properties | 10 ++ src/test/resources/regression/01/01.cql | 1 + src/test/resources/regression/01/01.xcql | 7 + src/test/resources/regression/01/02.cql | 1 + src/test/resources/regression/01/02.xcql | 7 + src/test/resources/regression/01/03.cql | 1 + src/test/resources/regression/01/03.xcql | 7 + src/test/resources/regression/01/04.cql | 1 + src/test/resources/regression/01/04.xcql | 7 + src/test/resources/regression/01/05.cql | 1 + src/test/resources/regression/01/05.xcql | 7 + src/test/resources/regression/01/06.cql | 1 + src/test/resources/regression/01/06.xcql | 7 + src/test/resources/regression/01/07.cql | 1 + src/test/resources/regression/01/07.xcql | 7 + src/test/resources/regression/01/08.cql | 1 + src/test/resources/regression/01/08.xcql | 7 + src/test/resources/regression/01/09.cql | 1 + src/test/resources/regression/01/09.xcql | 7 + src/test/resources/regression/01/10.cql | 1 + src/test/resources/regression/01/10.xcql | 7 + src/test/resources/regression/01/11.cql | 1 + src/test/resources/regression/01/11.xcql | 7 + src/test/resources/regression/01/name | 1 + src/test/resources/regression/02/01.cql | 1 + src/test/resources/regression/02/01.xcql | 7 + src/test/resources/regression/02/02.cql | 1 + src/test/resources/regression/02/02.xcql | 7 + src/test/resources/regression/02/03.cql | 1 + src/test/resources/regression/02/03.xcql | 7 + src/test/resources/regression/02/04.cql | 1 + src/test/resources/regression/02/04.xcql | 7 + src/test/resources/regression/02/05.cql | 1 + src/test/resources/regression/02/05.xcql | 7 + src/test/resources/regression/02/06.cql | 1 + src/test/resources/regression/02/06.xcql | 7 + src/test/resources/regression/02/07.cql | 1 + src/test/resources/regression/02/07.xcql | 7 + src/test/resources/regression/02/08.cql | 1 + src/test/resources/regression/02/08.xcql | 12 ++ src/test/resources/regression/02/09.cql | 1 + src/test/resources/regression/02/09.xcql | 15 ++ src/test/resources/regression/02/10.cql | 1 + src/test/resources/regression/02/10.xcql | 7 + src/test/resources/regression/02/11.cql | 1 + src/test/resources/regression/02/11.xcql | 12 ++ src/test/resources/regression/02/12.cql | 1 + src/test/resources/regression/02/12.xcql | 7 + src/test/resources/regression/02/13.cql | 1 + src/test/resources/regression/02/13.xcql | 14 ++ src/test/resources/regression/02/14.cql | 1 + src/test/resources/regression/02/14.xcql | 17 ++ src/test/resources/regression/02/15.cql | 1 + src/test/resources/regression/02/15.xcql | 7 + src/test/resources/regression/02/16.cql | 1 + src/test/resources/regression/02/16.xcql | 7 + src/test/resources/regression/02/17.cql | 1 + src/test/resources/regression/02/17.xcql | 7 + src/test/resources/regression/02/name | 1 + src/test/resources/regression/03/01.cql | 1 + src/test/resources/regression/03/01.xcql | 23 +++ src/test/resources/regression/03/02.cql | 1 + src/test/resources/regression/03/02.xcql | 23 +++ src/test/resources/regression/03/03.cql | 1 + src/test/resources/regression/03/03.xcql | 23 +++ src/test/resources/regression/03/04.cql | 1 + src/test/resources/regression/03/04.xcql | 23 +++ src/test/resources/regression/03/05.cql | 1 + src/test/resources/regression/03/05.xcql | 23 +++ src/test/resources/regression/03/06.cql | 1 + src/test/resources/regression/03/06.xcql | 23 +++ src/test/resources/regression/03/07.cql | 1 + src/test/resources/regression/03/07.xcql | 23 +++ src/test/resources/regression/03/08.cql | 1 + src/test/resources/regression/03/08.xcql | 23 +++ src/test/resources/regression/03/09.cql | 1 + src/test/resources/regression/03/09.xcql | 55 ++++++ src/test/resources/regression/03/name | 1 + src/test/resources/regression/04/01.cql | 1 + src/test/resources/regression/04/01.xcql | 23 +++ src/test/resources/regression/04/02.cql | 1 + src/test/resources/regression/04/02.xcql | 28 +++ src/test/resources/regression/04/name | 1 + src/test/resources/regression/05/01.cql | 1 + src/test/resources/regression/05/01.xcql | 23 +++ src/test/resources/regression/05/02.cql | 1 + src/test/resources/regression/05/02.xcql | 38 ++++ src/test/resources/regression/05/03.cql | 1 + src/test/resources/regression/05/03.xcql | 30 ++++ src/test/resources/regression/05/04.cql | 1 + src/test/resources/regression/05/04.xcql | 30 ++++ src/test/resources/regression/05/05.cql | 1 + src/test/resources/regression/05/05.xcql | 30 ++++ src/test/resources/regression/05/06.cql | 1 + src/test/resources/regression/05/06.xcql | 35 ++++ src/test/resources/regression/05/07.cql | 1 + src/test/resources/regression/05/07.xcql | 23 +++ src/test/resources/regression/05/08.cql | 1 + src/test/resources/regression/05/08.xcql | 28 +++ src/test/resources/regression/05/09.cql | 1 + src/test/resources/regression/05/09.xcql | 30 ++++ src/test/resources/regression/05/name | 1 + src/test/resources/regression/06/01.cql | 1 + src/test/resources/regression/06/01.xcql | 7 + src/test/resources/regression/06/02.cql | 1 + src/test/resources/regression/06/02.xcql | 7 + src/test/resources/regression/06/03.cql | 1 + src/test/resources/regression/06/03.xcql | 7 + src/test/resources/regression/06/04.cql | 1 + src/test/resources/regression/06/04.xcql | 7 + src/test/resources/regression/06/05.cql | 1 + src/test/resources/regression/06/05.xcql | 7 + src/test/resources/regression/06/06.cql | 1 + src/test/resources/regression/06/06.xcql | 7 + src/test/resources/regression/06/name | 1 + src/test/resources/regression/07/01.cql | 1 + src/test/resources/regression/07/01.xcql | 55 ++++++ src/test/resources/regression/07/02.cql | 1 + src/test/resources/regression/07/02.xcql | 55 ++++++ src/test/resources/regression/07/03.cql | 1 + src/test/resources/regression/07/03.xcql | 55 ++++++ src/test/resources/regression/07/name | 1 + src/test/resources/regression/08/01.cql | 1 + src/test/resources/regression/08/01.xcql | 13 ++ src/test/resources/regression/08/02.cql | 1 + src/test/resources/regression/08/02.xcql | 12 ++ src/test/resources/regression/08/03.cql | 1 + src/test/resources/regression/08/03.xcql | 33 ++++ src/test/resources/regression/08/name | 1 + src/test/resources/regression/09/01.cql | 1 + src/test/resources/regression/09/01.xcql | 39 +++++ src/test/resources/regression/09/02.cql | 1 + src/test/resources/regression/09/02.xcql | 7 + src/test/resources/regression/09/03.cql | 1 + src/test/resources/regression/09/03.xcql | 7 + src/test/resources/regression/09/04.cql | 1 + src/test/resources/regression/09/04.xcql | 16 ++ src/test/resources/regression/09/05.cql | 1 + src/test/resources/regression/09/05.xcql | 12 ++ src/test/resources/regression/09/06.cql | 1 + src/test/resources/regression/09/06.xcql | 18 ++ src/test/resources/regression/09/name | 1 + src/test/resources/regression/10/01.cql | 1 + src/test/resources/regression/10/01.xcql | 12 ++ src/test/resources/regression/10/02.cql | 1 + src/test/resources/regression/10/02.xcql | 28 +++ src/test/resources/regression/10/03.cql | 1 + src/test/resources/regression/10/03.xcql | 12 ++ src/test/resources/regression/10/04.cql | 1 + src/test/resources/regression/10/04.xcql | 17 ++ src/test/resources/regression/10/05.cql | 1 + src/test/resources/regression/10/05.xcql | 17 ++ src/test/resources/regression/10/06.cql | 1 + src/test/resources/regression/10/06.xcql | 20 +++ src/test/resources/regression/10/07.cql | 1 + src/test/resources/regression/10/07.xcql | 15 ++ src/test/resources/regression/10/08.cql | 1 + src/test/resources/regression/10/08.xcql | 17 ++ src/test/resources/regression/10/09.cql | 1 + src/test/resources/regression/10/09.xcql | 19 ++ src/test/resources/regression/10/10.cql | 1 + src/test/resources/regression/10/10.xcql | 18 ++ src/test/resources/regression/10/11.cql | 1 + src/test/resources/regression/10/11.xcql | 38 ++++ src/test/resources/regression/10/12.cql | 1 + src/test/resources/regression/10/12.xcql | 18 ++ src/test/resources/regression/10/13.cql | 1 + src/test/resources/regression/10/13.xcql | 18 ++ src/test/resources/regression/10/14.cql | 1 + src/test/resources/regression/10/14.xcql | 34 ++++ src/test/resources/regression/10/15.cql | 1 + src/test/resources/regression/10/15.xcql | 22 +++ src/test/resources/regression/10/16.cql | 1 + src/test/resources/regression/10/16.xcql | 40 +++++ src/test/resources/regression/10/name | 1 + 182 files changed, 1782 insertions(+), 98 deletions(-) delete mode 100644 Makefile delete mode 100644 docs/.gitignore delete mode 100644 docs/Makefile delete mode 100755 mkdist delete mode 100644 src/main/java/org/z3950/zing/cql/Makefile create mode 100644 src/test/java/org/z3950/zing/cql/CQLParserTest.java create mode 100644 src/test/resources/generate.properties create mode 100644 src/test/resources/regression/01/01.cql create mode 100644 src/test/resources/regression/01/01.xcql create mode 100644 src/test/resources/regression/01/02.cql create mode 100644 src/test/resources/regression/01/02.xcql create mode 100644 src/test/resources/regression/01/03.cql create mode 100644 src/test/resources/regression/01/03.xcql create mode 100644 src/test/resources/regression/01/04.cql create mode 100644 src/test/resources/regression/01/04.xcql create mode 100644 src/test/resources/regression/01/05.cql create mode 100644 src/test/resources/regression/01/05.xcql create mode 100644 src/test/resources/regression/01/06.cql create mode 100644 src/test/resources/regression/01/06.xcql create mode 100644 src/test/resources/regression/01/07.cql create mode 100644 src/test/resources/regression/01/07.xcql create mode 100644 src/test/resources/regression/01/08.cql create mode 100644 src/test/resources/regression/01/08.xcql create mode 100644 src/test/resources/regression/01/09.cql create mode 100644 src/test/resources/regression/01/09.xcql create mode 100644 src/test/resources/regression/01/10.cql create mode 100644 src/test/resources/regression/01/10.xcql create mode 100644 src/test/resources/regression/01/11.cql create mode 100644 src/test/resources/regression/01/11.xcql create mode 100644 src/test/resources/regression/01/name create mode 100644 src/test/resources/regression/02/01.cql create mode 100644 src/test/resources/regression/02/01.xcql create mode 100644 src/test/resources/regression/02/02.cql create mode 100644 src/test/resources/regression/02/02.xcql create mode 100644 src/test/resources/regression/02/03.cql create mode 100644 src/test/resources/regression/02/03.xcql create mode 100644 src/test/resources/regression/02/04.cql create mode 100644 src/test/resources/regression/02/04.xcql create mode 100644 src/test/resources/regression/02/05.cql create mode 100644 src/test/resources/regression/02/05.xcql create mode 100644 src/test/resources/regression/02/06.cql create mode 100644 src/test/resources/regression/02/06.xcql create mode 100644 src/test/resources/regression/02/07.cql create mode 100644 src/test/resources/regression/02/07.xcql create mode 100644 src/test/resources/regression/02/08.cql create mode 100644 src/test/resources/regression/02/08.xcql create mode 100644 src/test/resources/regression/02/09.cql create mode 100644 src/test/resources/regression/02/09.xcql create mode 100644 src/test/resources/regression/02/10.cql create mode 100644 src/test/resources/regression/02/10.xcql create mode 100644 src/test/resources/regression/02/11.cql create mode 100644 src/test/resources/regression/02/11.xcql create mode 100644 src/test/resources/regression/02/12.cql create mode 100644 src/test/resources/regression/02/12.xcql create mode 100644 src/test/resources/regression/02/13.cql create mode 100644 src/test/resources/regression/02/13.xcql create mode 100644 src/test/resources/regression/02/14.cql create mode 100644 src/test/resources/regression/02/14.xcql create mode 100644 src/test/resources/regression/02/15.cql create mode 100644 src/test/resources/regression/02/15.xcql create mode 100644 src/test/resources/regression/02/16.cql create mode 100644 src/test/resources/regression/02/16.xcql create mode 100644 src/test/resources/regression/02/17.cql create mode 100644 src/test/resources/regression/02/17.xcql create mode 100644 src/test/resources/regression/02/name create mode 100644 src/test/resources/regression/03/01.cql create mode 100644 src/test/resources/regression/03/01.xcql create mode 100644 src/test/resources/regression/03/02.cql create mode 100644 src/test/resources/regression/03/02.xcql create mode 100644 src/test/resources/regression/03/03.cql create mode 100644 src/test/resources/regression/03/03.xcql create mode 100644 src/test/resources/regression/03/04.cql create mode 100644 src/test/resources/regression/03/04.xcql create mode 100644 src/test/resources/regression/03/05.cql create mode 100644 src/test/resources/regression/03/05.xcql create mode 100644 src/test/resources/regression/03/06.cql create mode 100644 src/test/resources/regression/03/06.xcql create mode 100644 src/test/resources/regression/03/07.cql create mode 100644 src/test/resources/regression/03/07.xcql create mode 100644 src/test/resources/regression/03/08.cql create mode 100644 src/test/resources/regression/03/08.xcql create mode 100644 src/test/resources/regression/03/09.cql create mode 100644 src/test/resources/regression/03/09.xcql create mode 100644 src/test/resources/regression/03/name create mode 100644 src/test/resources/regression/04/01.cql create mode 100644 src/test/resources/regression/04/01.xcql create mode 100644 src/test/resources/regression/04/02.cql create mode 100644 src/test/resources/regression/04/02.xcql create mode 100644 src/test/resources/regression/04/name create mode 100644 src/test/resources/regression/05/01.cql create mode 100644 src/test/resources/regression/05/01.xcql create mode 100644 src/test/resources/regression/05/02.cql create mode 100644 src/test/resources/regression/05/02.xcql create mode 100644 src/test/resources/regression/05/03.cql create mode 100644 src/test/resources/regression/05/03.xcql create mode 100644 src/test/resources/regression/05/04.cql create mode 100644 src/test/resources/regression/05/04.xcql create mode 100644 src/test/resources/regression/05/05.cql create mode 100644 src/test/resources/regression/05/05.xcql create mode 100644 src/test/resources/regression/05/06.cql create mode 100644 src/test/resources/regression/05/06.xcql create mode 100644 src/test/resources/regression/05/07.cql create mode 100644 src/test/resources/regression/05/07.xcql create mode 100644 src/test/resources/regression/05/08.cql create mode 100644 src/test/resources/regression/05/08.xcql create mode 100644 src/test/resources/regression/05/09.cql create mode 100644 src/test/resources/regression/05/09.xcql create mode 100644 src/test/resources/regression/05/name create mode 100644 src/test/resources/regression/06/01.cql create mode 100644 src/test/resources/regression/06/01.xcql create mode 100644 src/test/resources/regression/06/02.cql create mode 100644 src/test/resources/regression/06/02.xcql create mode 100644 src/test/resources/regression/06/03.cql create mode 100644 src/test/resources/regression/06/03.xcql create mode 100644 src/test/resources/regression/06/04.cql create mode 100644 src/test/resources/regression/06/04.xcql create mode 100644 src/test/resources/regression/06/05.cql create mode 100644 src/test/resources/regression/06/05.xcql create mode 100644 src/test/resources/regression/06/06.cql create mode 100644 src/test/resources/regression/06/06.xcql create mode 100644 src/test/resources/regression/06/name create mode 100644 src/test/resources/regression/07/01.cql create mode 100644 src/test/resources/regression/07/01.xcql create mode 100644 src/test/resources/regression/07/02.cql create mode 100644 src/test/resources/regression/07/02.xcql create mode 100644 src/test/resources/regression/07/03.cql create mode 100644 src/test/resources/regression/07/03.xcql create mode 100644 src/test/resources/regression/07/name create mode 100644 src/test/resources/regression/08/01.cql create mode 100644 src/test/resources/regression/08/01.xcql create mode 100644 src/test/resources/regression/08/02.cql create mode 100644 src/test/resources/regression/08/02.xcql create mode 100644 src/test/resources/regression/08/03.cql create mode 100644 src/test/resources/regression/08/03.xcql create mode 100644 src/test/resources/regression/08/name create mode 100644 src/test/resources/regression/09/01.cql create mode 100644 src/test/resources/regression/09/01.xcql create mode 100644 src/test/resources/regression/09/02.cql create mode 100644 src/test/resources/regression/09/02.xcql create mode 100644 src/test/resources/regression/09/03.cql create mode 100644 src/test/resources/regression/09/03.xcql create mode 100644 src/test/resources/regression/09/04.cql create mode 100644 src/test/resources/regression/09/04.xcql create mode 100644 src/test/resources/regression/09/05.cql create mode 100644 src/test/resources/regression/09/05.xcql create mode 100644 src/test/resources/regression/09/06.cql create mode 100644 src/test/resources/regression/09/06.xcql create mode 100644 src/test/resources/regression/09/name create mode 100644 src/test/resources/regression/10/01.cql create mode 100644 src/test/resources/regression/10/01.xcql create mode 100644 src/test/resources/regression/10/02.cql create mode 100644 src/test/resources/regression/10/02.xcql create mode 100644 src/test/resources/regression/10/03.cql create mode 100644 src/test/resources/regression/10/03.xcql create mode 100644 src/test/resources/regression/10/04.cql create mode 100644 src/test/resources/regression/10/04.xcql create mode 100644 src/test/resources/regression/10/05.cql create mode 100644 src/test/resources/regression/10/05.xcql create mode 100644 src/test/resources/regression/10/06.cql create mode 100644 src/test/resources/regression/10/06.xcql create mode 100644 src/test/resources/regression/10/07.cql create mode 100644 src/test/resources/regression/10/07.xcql create mode 100644 src/test/resources/regression/10/08.cql create mode 100644 src/test/resources/regression/10/08.xcql create mode 100644 src/test/resources/regression/10/09.cql create mode 100644 src/test/resources/regression/10/09.xcql create mode 100644 src/test/resources/regression/10/10.cql create mode 100644 src/test/resources/regression/10/10.xcql create mode 100644 src/test/resources/regression/10/11.cql create mode 100644 src/test/resources/regression/10/11.xcql create mode 100644 src/test/resources/regression/10/12.cql create mode 100644 src/test/resources/regression/10/12.xcql create mode 100644 src/test/resources/regression/10/13.cql create mode 100644 src/test/resources/regression/10/13.xcql create mode 100644 src/test/resources/regression/10/14.cql create mode 100644 src/test/resources/regression/10/14.xcql create mode 100644 src/test/resources/regression/10/15.cql create mode 100644 src/test/resources/regression/10/15.xcql create mode 100644 src/test/resources/regression/10/16.cql create mode 100644 src/test/resources/regression/10/16.xcql create mode 100644 src/test/resources/regression/10/name diff --git a/Makefile b/Makefile deleted file mode 100644 index 0308585..0000000 --- a/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -**make-default**: - ./Build - -clean: - ./Build clean - diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index c796f0b..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -allclasses-frame.html -allclasses-noframe.html -constant-values.html -deprecated-list.html -help-doc.html -index-all.html -index.html -org -overview-tree.html -package-list -packages.html -serialized-form.html -stylesheet.css -resources diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 36ce6b8..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,22 +0,0 @@ - -all: overview-tree.html - -overview-tree.html: ../src/main/java/org/z3950/zing/cql/*.java - nice javadoc -classpath ../src/main/java \ - -author -version -windowtitle cql-java org.z3950.zing.cql - -clean: - rm -rf allclasses-frame.html \ - allclasses-noframe.html \ - deprecated-list.html \ - help-doc.html \ - index-all.html \ - index.html \ - org \ - overview-tree.html \ - package-list \ - packages.html \ - serialized-form.html \ - constant-values.html \ - stylesheet.css \ - resources diff --git a/mkdist b/mkdist deleted file mode 100755 index fb065f8..0000000 --- a/mkdist +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# mkdist - make a distribution of the CQL-Java software - -version=`cat VERSION` -distdir=cql-java-$version -distfile=$distdir.tar.gz -tmpdir=/tmp/$distdir -echo "Building $distdir" -trap "rm -rf $tmpdir" 1 2 15 # 0 -cp -rp . $tmpdir -cd $tmpdir -find . \( -name CVS -o -name .cvsignore \) -print | xargs rm -rf -rm -rf archive mkdist etc/xslt .git target -( cd src/main/java/org/z3950/zing/cql && make && make clean ) -( cd docs && make ) -( cd test/regression && make distclean ) -cd .. -tar cf - $distdir | gzip -9v > $distfile -rm -rf $tmpdir -echo "Made /tmp/$distfile" diff --git a/src/main/java/org/z3950/zing/cql/CQLParser.java b/src/main/java/org/z3950/zing/cql/CQLParser.java index d577cd9..72a39a3 100644 --- a/src/main/java/org/z3950/zing/cql/CQLParser.java +++ b/src/main/java/org/z3950/zing/cql/CQLParser.java @@ -59,7 +59,7 @@ public class CQLParser { * @param allowKeywordTerms when false registered keywords are disallowed in unquoted terms */ public CQLParser(int compat, boolean allowKeywordTerms) { - this.compat = V1POINT2; + this.compat = compat; this.allowKeywordTerms = allowKeywordTerms; } diff --git a/src/main/java/org/z3950/zing/cql/Makefile b/src/main/java/org/z3950/zing/cql/Makefile deleted file mode 100644 index 9470de2..0000000 --- a/src/main/java/org/z3950/zing/cql/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# Your Java compiler will require that this source directory is on the -# classpath. The best way to do that is just to add the CQL-Java -# distribution's "src" subdirectory to your CLASSPATH environment -# variable, like this: -# CLASSPATH=$CLASSPATH:/where/ever/you/unpacked/it/cql-java-VERSION/src - -OBJ = Utils.class \ - CQLNode.class CQLTermNode.class CQLBooleanNode.class \ - CQLAndNode.class CQLOrNode.class CQLNotNode.class \ - CQLProxNode.class CQLPrefixNode.class CQLSortNode.class \ - CQLPrefix.class \ - CQLRelation.class Modifier.class ModifierSet.class \ - CQLParser.class CQLLexer.class CQLGenerator.class \ - CQLParseException.class MissingParameterException.class \ - PQFTranslationException.class \ - UnknownIndexException.class UnknownRelationException.class \ - UnknownRelationModifierException.class UnknownPositionException.class - -JARPATH = ../../../lib/cql-java.jar -JAR = ../../../../../../$(JARPATH) -$(JAR): $(OBJ) - cd ../../../..; jar cf $(JARPATH) org/z3950/zing/cql/*.class - -%.class: %.java - javac -Xlint:unchecked *.java - -test: $(JAR) - cd ../../../../../../../test/regression && make - -clean: - rm -f $(OBJ) 'CQLLexer$$Keyword.class' - diff --git a/src/test/java/org/z3950/zing/cql/CQLParserTest.java b/src/test/java/org/z3950/zing/cql/CQLParserTest.java new file mode 100644 index 0000000..7e258e0 --- /dev/null +++ b/src/test/java/org/z3950/zing/cql/CQLParserTest.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) 1995-2014, Index Datassss + * All rights reserved. + * See the file LICENSE for details. + */ +package org.z3950.zing.cql; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringReader; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLDecoder; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +import static java.lang.System.out; +import java.util.Properties; + +/** + * + * @author jakub + */ +public class CQLParserTest { + public CQLParserTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + /** + * Test of main method, of class CQLParser. + */ + @Test + public void testRegressionQueries() throws IOException { + System.out.println("Testing the parser using pre-canned regression queries..."); + //we might be running the test from within the jar + //list all resource dirs, then traverse them + String[] dirs = getResourceListing(this.getClass(), "regression"); + for (String dir : dirs) { + String files[] = getResourceListing(this.getClass(), "regression/" + dir); + for (String file : files) { + if (!file.endsWith(".cql")) continue; + out.println("Parsing "+dir+"/"+file); + InputStream is = this.getClass().getResourceAsStream("/regression/"+dir+"/"+file); + BufferedReader reader = null, reader2 = null; + try { + reader = new BufferedReader(new InputStreamReader(is)); + String input = reader.readLine(); + out.println("Query: "+input); + CQLParser parser = new CQLParser(); + CQLNode parsed = parser.parse(input); + String xcql = parsed.toXCQL(); + out.println("Parsed:"); + out.println(xcql); + //read the expected xcql output + String prefix = file.substring(0, file.length()-4); + reader2 = new BufferedReader(new InputStreamReader( + this.getClass().getResourceAsStream("/regression/"+dir+"/"+prefix+".xcql"))); + StringBuilder sb = new StringBuilder(); + String line; + while ((line = reader2.readLine()) != null) { + sb.append(line).append("\n"); + } + String expected = sb.toString(); + out.println("Expected: "); + out.println(expected); + assertEquals("Assertion failure for "+dir+"/"+file, expected, xcql); + } catch (CQLParseException pe) { + fail("Parsing failed with: "+pe.toString()); + } finally { + if (reader != null) reader.close(); + if (reader2 != null) reader2.close(); + } + } + } + } + + @Test + public void testRandomQueries() throws IOException, MissingParameterException { + out.println("Testing the parser using 100 randomly generated queries..."); + Properties params = new Properties(); + InputStream is = getClass().getResourceAsStream("/generate.properties"); + if (is == null) + fail("Cannot locate generate.properties"); + params.load(is); + is.close(); + CQLGenerator generator = new CQLGenerator(params); + for (int i=0; i<100; i++) { + CQLNode random = generator.generate(); + String expected = random.toCQL(); + out.println("Generated query: "+expected); + CQLParser parser = new CQLParser(); + try { + CQLNode parsed = parser.parse(expected); + String result = parsed.toCQL(); + assertEquals(expected, result); + } catch (CQLParseException pe) { + fail("Generated query failed to parse: "+pe.getMessage()); + } + } + } + + + //helper methods follow + //TODO move to masterkey-common + + @SuppressWarnings("rawtypes") + public static String[] getResourceListing(Class clazz, String path) throws + IOException { + URL dirURL = clazz.getClassLoader().getResource(path); + if (dirURL != null && dirURL.getProtocol().equals("file")) { + /* A file path: easy enough */ + try { + return new File(dirURL.toURI()).list(); + } catch (URISyntaxException use) { + throw new UnsupportedOperationException(use); + } + } + + if (dirURL == null) { + /* + * In case of a jar file, we can't actually find a directory. + * Have to assume the same jar as clazz. + */ + String me = clazz.getName().replace(".", "/") + ".class"; + dirURL = clazz.getClassLoader().getResource(me); + } + + if (dirURL.getProtocol().equals("jar")) { + /* A JAR path */ + String jarPath = dirURL.getPath().substring(5, dirURL.getPath().indexOf( + "!")); //strip out only the JAR file + JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8")); + Enumeration entries = jar.entries(); //gives ALL entries in jar + Set result = new HashSet(); //avoid duplicates in case it is a subdirectory + while (entries.hasMoreElements()) { + String name = entries.nextElement().getName(); + if (name.startsWith(path)) { //filter according to the path + String entry = name.substring(path.length()); + int checkSubdir = entry.indexOf("/"); + if (checkSubdir >= 0) { + // if it is a subdirectory, we just return the directory name + entry = entry.substring(0, checkSubdir); + } + result.add(entry); + } + } + return result.toArray(new String[result.size()]); + } + + throw new UnsupportedOperationException("Cannot list files for URL " + + dirURL); + } +} \ No newline at end of file diff --git a/src/test/resources/generate.properties b/src/test/resources/generate.properties new file mode 100644 index 0000000..409f872 --- /dev/null +++ b/src/test/resources/generate.properties @@ -0,0 +1,10 @@ +# +# Propeties file to drive the org.z3950.zing.cql.CQLGenerator +# test-harness. See that class's documentation for the semantics of +# these properties. +# +complexQuery=0.4 +complexClause=0.4 +equalsRelation=0.5 +numericRelation=0.7 +proxOp=0.0 diff --git a/src/test/resources/regression/01/01.cql b/src/test/resources/regression/01/01.cql new file mode 100644 index 0000000..5d5b306 --- /dev/null +++ b/src/test/resources/regression/01/01.cql @@ -0,0 +1 @@ +cat \ No newline at end of file diff --git a/src/test/resources/regression/01/01.xcql b/src/test/resources/regression/01/01.xcql new file mode 100644 index 0000000..48aee99 --- /dev/null +++ b/src/test/resources/regression/01/01.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + cat + diff --git a/src/test/resources/regression/01/02.cql b/src/test/resources/regression/01/02.cql new file mode 100644 index 0000000..d579091 --- /dev/null +++ b/src/test/resources/regression/01/02.cql @@ -0,0 +1 @@ +"cat" \ No newline at end of file diff --git a/src/test/resources/regression/01/02.xcql b/src/test/resources/regression/01/02.xcql new file mode 100644 index 0000000..48aee99 --- /dev/null +++ b/src/test/resources/regression/01/02.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + cat + diff --git a/src/test/resources/regression/01/03.cql b/src/test/resources/regression/01/03.cql new file mode 100644 index 0000000..dac67a1 --- /dev/null +++ b/src/test/resources/regression/01/03.cql @@ -0,0 +1 @@ +comp.os.linux \ No newline at end of file diff --git a/src/test/resources/regression/01/03.xcql b/src/test/resources/regression/01/03.xcql new file mode 100644 index 0000000..af191d3 --- /dev/null +++ b/src/test/resources/regression/01/03.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + comp.os.linux + diff --git a/src/test/resources/regression/01/04.cql b/src/test/resources/regression/01/04.cql new file mode 100644 index 0000000..b665f17 --- /dev/null +++ b/src/test/resources/regression/01/04.cql @@ -0,0 +1 @@ +xml:element \ No newline at end of file diff --git a/src/test/resources/regression/01/04.xcql b/src/test/resources/regression/01/04.xcql new file mode 100644 index 0000000..4141430 --- /dev/null +++ b/src/test/resources/regression/01/04.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + xml:element + diff --git a/src/test/resources/regression/01/05.cql b/src/test/resources/regression/01/05.cql new file mode 100644 index 0000000..c9b128e --- /dev/null +++ b/src/test/resources/regression/01/05.cql @@ -0,0 +1 @@ +"" \ No newline at end of file diff --git a/src/test/resources/regression/01/05.xcql b/src/test/resources/regression/01/05.xcql new file mode 100644 index 0000000..6ec410e --- /dev/null +++ b/src/test/resources/regression/01/05.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + <xml:element> + diff --git a/src/test/resources/regression/01/06.cql b/src/test/resources/regression/01/06.cql new file mode 100644 index 0000000..79b87e7 --- /dev/null +++ b/src/test/resources/regression/01/06.cql @@ -0,0 +1 @@ +"=" \ No newline at end of file diff --git a/src/test/resources/regression/01/06.xcql b/src/test/resources/regression/01/06.xcql new file mode 100644 index 0000000..da69755 --- /dev/null +++ b/src/test/resources/regression/01/06.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + = + diff --git a/src/test/resources/regression/01/07.cql b/src/test/resources/regression/01/07.cql new file mode 100644 index 0000000..34442aa --- /dev/null +++ b/src/test/resources/regression/01/07.cql @@ -0,0 +1 @@ +"prox/distance<3/unit=word" \ No newline at end of file diff --git a/src/test/resources/regression/01/07.xcql b/src/test/resources/regression/01/07.xcql new file mode 100644 index 0000000..851a5c1 --- /dev/null +++ b/src/test/resources/regression/01/07.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + prox/distance<3/unit=word + diff --git a/src/test/resources/regression/01/08.cql b/src/test/resources/regression/01/08.cql new file mode 100644 index 0000000..f6f67a9 --- /dev/null +++ b/src/test/resources/regression/01/08.cql @@ -0,0 +1 @@ +("cat") \ No newline at end of file diff --git a/src/test/resources/regression/01/08.xcql b/src/test/resources/regression/01/08.xcql new file mode 100644 index 0000000..48aee99 --- /dev/null +++ b/src/test/resources/regression/01/08.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + cat + diff --git a/src/test/resources/regression/01/09.cql b/src/test/resources/regression/01/09.cql new file mode 100644 index 0000000..ab149fc --- /dev/null +++ b/src/test/resources/regression/01/09.cql @@ -0,0 +1 @@ +((dog)) \ No newline at end of file diff --git a/src/test/resources/regression/01/09.xcql b/src/test/resources/regression/01/09.xcql new file mode 100644 index 0000000..d41b39e --- /dev/null +++ b/src/test/resources/regression/01/09.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + dog + diff --git a/src/test/resources/regression/01/10.cql b/src/test/resources/regression/01/10.cql new file mode 100644 index 0000000..baa6044 --- /dev/null +++ b/src/test/resources/regression/01/10.cql @@ -0,0 +1 @@ +all \ No newline at end of file diff --git a/src/test/resources/regression/01/10.xcql b/src/test/resources/regression/01/10.xcql new file mode 100644 index 0000000..c5ac7f6 --- /dev/null +++ b/src/test/resources/regression/01/10.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + all + diff --git a/src/test/resources/regression/01/11.cql b/src/test/resources/regression/01/11.cql new file mode 100644 index 0000000..91c2bee --- /dev/null +++ b/src/test/resources/regression/01/11.cql @@ -0,0 +1 @@ +prox \ No newline at end of file diff --git a/src/test/resources/regression/01/11.xcql b/src/test/resources/regression/01/11.xcql new file mode 100644 index 0000000..88da9eb --- /dev/null +++ b/src/test/resources/regression/01/11.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + prox + diff --git a/src/test/resources/regression/01/name b/src/test/resources/regression/01/name new file mode 100644 index 0000000..dc563f2 --- /dev/null +++ b/src/test/resources/regression/01/name @@ -0,0 +1 @@ +Simple \ No newline at end of file diff --git a/src/test/resources/regression/02/01.cql b/src/test/resources/regression/02/01.cql new file mode 100644 index 0000000..fea9bed --- /dev/null +++ b/src/test/resources/regression/02/01.cql @@ -0,0 +1 @@ +title = "fish" \ No newline at end of file diff --git a/src/test/resources/regression/02/01.xcql b/src/test/resources/regression/02/01.xcql new file mode 100644 index 0000000..be3c9c1 --- /dev/null +++ b/src/test/resources/regression/02/01.xcql @@ -0,0 +1,7 @@ + + title + + = + + fish + diff --git a/src/test/resources/regression/02/02.cql b/src/test/resources/regression/02/02.cql new file mode 100644 index 0000000..2ae47ba --- /dev/null +++ b/src/test/resources/regression/02/02.cql @@ -0,0 +1 @@ +title == fish diff --git a/src/test/resources/regression/02/02.xcql b/src/test/resources/regression/02/02.xcql new file mode 100644 index 0000000..fd085e3 --- /dev/null +++ b/src/test/resources/regression/02/02.xcql @@ -0,0 +1,7 @@ + + title + + == + + fish + diff --git a/src/test/resources/regression/02/03.cql b/src/test/resources/regression/02/03.cql new file mode 100644 index 0000000..553d2b8 --- /dev/null +++ b/src/test/resources/regression/02/03.cql @@ -0,0 +1 @@ +title any fish \ No newline at end of file diff --git a/src/test/resources/regression/02/03.xcql b/src/test/resources/regression/02/03.xcql new file mode 100644 index 0000000..62521be --- /dev/null +++ b/src/test/resources/regression/02/03.xcql @@ -0,0 +1,7 @@ + + title + + any + + fish + diff --git a/src/test/resources/regression/02/04.cql b/src/test/resources/regression/02/04.cql new file mode 100644 index 0000000..f0f4f19 --- /dev/null +++ b/src/test/resources/regression/02/04.cql @@ -0,0 +1 @@ +title all fish \ No newline at end of file diff --git a/src/test/resources/regression/02/04.xcql b/src/test/resources/regression/02/04.xcql new file mode 100644 index 0000000..646c973 --- /dev/null +++ b/src/test/resources/regression/02/04.xcql @@ -0,0 +1,7 @@ + + title + + all + + fish + diff --git a/src/test/resources/regression/02/05.cql b/src/test/resources/regression/02/05.cql new file mode 100644 index 0000000..f20b1df --- /dev/null +++ b/src/test/resources/regression/02/05.cql @@ -0,0 +1 @@ +title > 9 \ No newline at end of file diff --git a/src/test/resources/regression/02/05.xcql b/src/test/resources/regression/02/05.xcql new file mode 100644 index 0000000..92411c4 --- /dev/null +++ b/src/test/resources/regression/02/05.xcql @@ -0,0 +1,7 @@ + + title + + > + + 9 + diff --git a/src/test/resources/regression/02/06.cql b/src/test/resources/regression/02/06.cql new file mode 100644 index 0000000..e081346 --- /dev/null +++ b/src/test/resources/regression/02/06.cql @@ -0,0 +1 @@ +title >= 23 \ No newline at end of file diff --git a/src/test/resources/regression/02/06.xcql b/src/test/resources/regression/02/06.xcql new file mode 100644 index 0000000..6702471 --- /dev/null +++ b/src/test/resources/regression/02/06.xcql @@ -0,0 +1,7 @@ + + title + + >= + + 23 + diff --git a/src/test/resources/regression/02/07.cql b/src/test/resources/regression/02/07.cql new file mode 100644 index 0000000..2c774e0 --- /dev/null +++ b/src/test/resources/regression/02/07.cql @@ -0,0 +1 @@ +dc.title any "fish chips" \ No newline at end of file diff --git a/src/test/resources/regression/02/07.xcql b/src/test/resources/regression/02/07.xcql new file mode 100644 index 0000000..ba4ac78 --- /dev/null +++ b/src/test/resources/regression/02/07.xcql @@ -0,0 +1,7 @@ + + dc.title + + any + + fish chips + diff --git a/src/test/resources/regression/02/08.cql b/src/test/resources/regression/02/08.cql new file mode 100644 index 0000000..acc6a7d --- /dev/null +++ b/src/test/resources/regression/02/08.cql @@ -0,0 +1 @@ +dc.title any/stem fish \ No newline at end of file diff --git a/src/test/resources/regression/02/08.xcql b/src/test/resources/regression/02/08.xcql new file mode 100644 index 0000000..1576778 --- /dev/null +++ b/src/test/resources/regression/02/08.xcql @@ -0,0 +1,12 @@ + + dc.title + + any + + + stem + + + + fish + diff --git a/src/test/resources/regression/02/09.cql b/src/test/resources/regression/02/09.cql new file mode 100644 index 0000000..fff4f2a --- /dev/null +++ b/src/test/resources/regression/02/09.cql @@ -0,0 +1 @@ +dc.fish all/stem/fuzzy "fish chips" \ No newline at end of file diff --git a/src/test/resources/regression/02/09.xcql b/src/test/resources/regression/02/09.xcql new file mode 100644 index 0000000..9f8abff --- /dev/null +++ b/src/test/resources/regression/02/09.xcql @@ -0,0 +1,15 @@ + + dc.fish + + all + + + stem + + + fuzzy + + + + fish chips + diff --git a/src/test/resources/regression/02/10.cql b/src/test/resources/regression/02/10.cql new file mode 100644 index 0000000..2723119 --- /dev/null +++ b/src/test/resources/regression/02/10.cql @@ -0,0 +1 @@ +(title any frog) \ No newline at end of file diff --git a/src/test/resources/regression/02/10.xcql b/src/test/resources/regression/02/10.xcql new file mode 100644 index 0000000..d7dfe7a --- /dev/null +++ b/src/test/resources/regression/02/10.xcql @@ -0,0 +1,7 @@ + + title + + any + + frog + diff --git a/src/test/resources/regression/02/11.cql b/src/test/resources/regression/02/11.cql new file mode 100644 index 0000000..7c42dc6 --- /dev/null +++ b/src/test/resources/regression/02/11.cql @@ -0,0 +1 @@ +((dc.title any/stem "frog pond")) \ No newline at end of file diff --git a/src/test/resources/regression/02/11.xcql b/src/test/resources/regression/02/11.xcql new file mode 100644 index 0000000..726a36e --- /dev/null +++ b/src/test/resources/regression/02/11.xcql @@ -0,0 +1,12 @@ + + dc.title + + any + + + stem + + + + frog pond + diff --git a/src/test/resources/regression/02/12.cql b/src/test/resources/regression/02/12.cql new file mode 100644 index 0000000..dd8106c --- /dev/null +++ b/src/test/resources/regression/02/12.cql @@ -0,0 +1 @@ +dc.title any "fish frog chicken" \ No newline at end of file diff --git a/src/test/resources/regression/02/12.xcql b/src/test/resources/regression/02/12.xcql new file mode 100644 index 0000000..b4bcf3b --- /dev/null +++ b/src/test/resources/regression/02/12.xcql @@ -0,0 +1,7 @@ + + dc.title + + any + + fish frog chicken + diff --git a/src/test/resources/regression/02/13.cql b/src/test/resources/regression/02/13.cql new file mode 100644 index 0000000..d290d65 --- /dev/null +++ b/src/test/resources/regression/02/13.cql @@ -0,0 +1 @@ +dc.title =/rel.algorithm=CORI squid \ No newline at end of file diff --git a/src/test/resources/regression/02/13.xcql b/src/test/resources/regression/02/13.xcql new file mode 100644 index 0000000..6f3c011 --- /dev/null +++ b/src/test/resources/regression/02/13.xcql @@ -0,0 +1,14 @@ + + dc.title + + = + + + rel.algorithm + = + CORI + + + + squid + diff --git a/src/test/resources/regression/02/14.cql b/src/test/resources/regression/02/14.cql new file mode 100644 index 0000000..58d2b9b --- /dev/null +++ b/src/test/resources/regression/02/14.cql @@ -0,0 +1 @@ +author any/f.foo/b.bar>1 "sanderson taylor" \ No newline at end of file diff --git a/src/test/resources/regression/02/14.xcql b/src/test/resources/regression/02/14.xcql new file mode 100644 index 0000000..c833d26 --- /dev/null +++ b/src/test/resources/regression/02/14.xcql @@ -0,0 +1,17 @@ + + author + + any + + + f.foo + + + b.bar + > + 1 + + + + sanderson taylor + diff --git a/src/test/resources/regression/02/15.cql b/src/test/resources/regression/02/15.cql new file mode 100644 index 0000000..c427e26 --- /dev/null +++ b/src/test/resources/regression/02/15.cql @@ -0,0 +1 @@ +numberOfLegs <= 4 \ No newline at end of file diff --git a/src/test/resources/regression/02/15.xcql b/src/test/resources/regression/02/15.xcql new file mode 100644 index 0000000..3a23abe --- /dev/null +++ b/src/test/resources/regression/02/15.xcql @@ -0,0 +1,7 @@ + + numberOfLegs + + <= + + 4 + diff --git a/src/test/resources/regression/02/16.cql b/src/test/resources/regression/02/16.cql new file mode 100644 index 0000000..eb65cd2 --- /dev/null +++ b/src/test/resources/regression/02/16.cql @@ -0,0 +1 @@ +numberOfLegs <> 4 \ No newline at end of file diff --git a/src/test/resources/regression/02/16.xcql b/src/test/resources/regression/02/16.xcql new file mode 100644 index 0000000..0e8eccd --- /dev/null +++ b/src/test/resources/regression/02/16.xcql @@ -0,0 +1,7 @@ + + numberOfLegs + + <> + + 4 + diff --git a/src/test/resources/regression/02/17.cql b/src/test/resources/regression/02/17.cql new file mode 100644 index 0000000..2249148 --- /dev/null +++ b/src/test/resources/regression/02/17.cql @@ -0,0 +1 @@ +title == jaws \ No newline at end of file diff --git a/src/test/resources/regression/02/17.xcql b/src/test/resources/regression/02/17.xcql new file mode 100644 index 0000000..b2587ff --- /dev/null +++ b/src/test/resources/regression/02/17.xcql @@ -0,0 +1,7 @@ + + title + + == + + jaws + diff --git a/src/test/resources/regression/02/name b/src/test/resources/regression/02/name new file mode 100644 index 0000000..d9e175e --- /dev/null +++ b/src/test/resources/regression/02/name @@ -0,0 +1 @@ +Index Relation Term \ No newline at end of file diff --git a/src/test/resources/regression/03/01.cql b/src/test/resources/regression/03/01.cql new file mode 100644 index 0000000..a47d816 --- /dev/null +++ b/src/test/resources/regression/03/01.cql @@ -0,0 +1 @@ +cat or dog \ No newline at end of file diff --git a/src/test/resources/regression/03/01.xcql b/src/test/resources/regression/03/01.xcql new file mode 100644 index 0000000..fc1b678 --- /dev/null +++ b/src/test/resources/regression/03/01.xcql @@ -0,0 +1,23 @@ + + + or + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + dog + + + diff --git a/src/test/resources/regression/03/02.cql b/src/test/resources/regression/03/02.cql new file mode 100644 index 0000000..7bfe969 --- /dev/null +++ b/src/test/resources/regression/03/02.cql @@ -0,0 +1 @@ +cat and fish \ No newline at end of file diff --git a/src/test/resources/regression/03/02.xcql b/src/test/resources/regression/03/02.xcql new file mode 100644 index 0000000..55ae66a --- /dev/null +++ b/src/test/resources/regression/03/02.xcql @@ -0,0 +1,23 @@ + + + and + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + fish + + + diff --git a/src/test/resources/regression/03/03.cql b/src/test/resources/regression/03/03.cql new file mode 100644 index 0000000..28e500a --- /dev/null +++ b/src/test/resources/regression/03/03.cql @@ -0,0 +1 @@ +cat not frog \ No newline at end of file diff --git a/src/test/resources/regression/03/03.xcql b/src/test/resources/regression/03/03.xcql new file mode 100644 index 0000000..2f4f6c0 --- /dev/null +++ b/src/test/resources/regression/03/03.xcql @@ -0,0 +1,23 @@ + + + not + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + frog + + + diff --git a/src/test/resources/regression/03/04.cql b/src/test/resources/regression/03/04.cql new file mode 100644 index 0000000..eb88011 --- /dev/null +++ b/src/test/resources/regression/03/04.cql @@ -0,0 +1 @@ +(cat not frog) \ No newline at end of file diff --git a/src/test/resources/regression/03/04.xcql b/src/test/resources/regression/03/04.xcql new file mode 100644 index 0000000..2f4f6c0 --- /dev/null +++ b/src/test/resources/regression/03/04.xcql @@ -0,0 +1,23 @@ + + + not + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + frog + + + diff --git a/src/test/resources/regression/03/05.cql b/src/test/resources/regression/03/05.cql new file mode 100644 index 0000000..436176b --- /dev/null +++ b/src/test/resources/regression/03/05.cql @@ -0,0 +1 @@ +"cat" not "fish food" \ No newline at end of file diff --git a/src/test/resources/regression/03/05.xcql b/src/test/resources/regression/03/05.xcql new file mode 100644 index 0000000..9ad0700 --- /dev/null +++ b/src/test/resources/regression/03/05.xcql @@ -0,0 +1,23 @@ + + + not + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + fish food + + + diff --git a/src/test/resources/regression/03/06.cql b/src/test/resources/regression/03/06.cql new file mode 100644 index 0000000..9c30208 --- /dev/null +++ b/src/test/resources/regression/03/06.cql @@ -0,0 +1 @@ +xml and "prox///" \ No newline at end of file diff --git a/src/test/resources/regression/03/06.xcql b/src/test/resources/regression/03/06.xcql new file mode 100644 index 0000000..7b8dae8 --- /dev/null +++ b/src/test/resources/regression/03/06.xcql @@ -0,0 +1,23 @@ + + + and + + + + cql.serverChoice + + = + + xml + + + + + cql.serverChoice + + = + + prox/// + + + diff --git a/src/test/resources/regression/03/07.cql b/src/test/resources/regression/03/07.cql new file mode 100644 index 0000000..1c01ad9 --- /dev/null +++ b/src/test/resources/regression/03/07.cql @@ -0,0 +1 @@ +fred and any \ No newline at end of file diff --git a/src/test/resources/regression/03/07.xcql b/src/test/resources/regression/03/07.xcql new file mode 100644 index 0000000..5e0076e --- /dev/null +++ b/src/test/resources/regression/03/07.xcql @@ -0,0 +1,23 @@ + + + and + + + + cql.serverChoice + + = + + fred + + + + + cql.serverChoice + + = + + any + + + diff --git a/src/test/resources/regression/03/08.cql b/src/test/resources/regression/03/08.cql new file mode 100644 index 0000000..f37768b --- /dev/null +++ b/src/test/resources/regression/03/08.cql @@ -0,0 +1 @@ +((fred or all)) \ No newline at end of file diff --git a/src/test/resources/regression/03/08.xcql b/src/test/resources/regression/03/08.xcql new file mode 100644 index 0000000..f080d4b --- /dev/null +++ b/src/test/resources/regression/03/08.xcql @@ -0,0 +1,23 @@ + + + or + + + + cql.serverChoice + + = + + fred + + + + + cql.serverChoice + + = + + all + + + diff --git a/src/test/resources/regression/03/09.cql b/src/test/resources/regression/03/09.cql new file mode 100644 index 0000000..545400b --- /dev/null +++ b/src/test/resources/regression/03/09.cql @@ -0,0 +1 @@ +a or b and c not d \ No newline at end of file diff --git a/src/test/resources/regression/03/09.xcql b/src/test/resources/regression/03/09.xcql new file mode 100644 index 0000000..4f3ade7 --- /dev/null +++ b/src/test/resources/regression/03/09.xcql @@ -0,0 +1,55 @@ + + + not + + + + + and + + + + + or + + + + cql.serverChoice + + = + + a + + + + + cql.serverChoice + + = + + b + + + + + + + cql.serverChoice + + = + + c + + + + + + + cql.serverChoice + + = + + d + + + diff --git a/src/test/resources/regression/03/name b/src/test/resources/regression/03/name new file mode 100644 index 0000000..7dd2e3d --- /dev/null +++ b/src/test/resources/regression/03/name @@ -0,0 +1 @@ +Simple Boolean \ No newline at end of file diff --git a/src/test/resources/regression/04/01.cql b/src/test/resources/regression/04/01.cql new file mode 100644 index 0000000..046c5e4 --- /dev/null +++ b/src/test/resources/regression/04/01.cql @@ -0,0 +1 @@ +bath.author any fish and dc.title all "cat dog" \ No newline at end of file diff --git a/src/test/resources/regression/04/01.xcql b/src/test/resources/regression/04/01.xcql new file mode 100644 index 0000000..6f3ec27 --- /dev/null +++ b/src/test/resources/regression/04/01.xcql @@ -0,0 +1,23 @@ + + + and + + + + bath.author + + any + + fish + + + + + dc.title + + all + + cat dog + + + diff --git a/src/test/resources/regression/04/02.cql b/src/test/resources/regression/04/02.cql new file mode 100644 index 0000000..f8372df --- /dev/null +++ b/src/test/resources/regression/04/02.cql @@ -0,0 +1 @@ +(title any/stem "fish dog" or and) \ No newline at end of file diff --git a/src/test/resources/regression/04/02.xcql b/src/test/resources/regression/04/02.xcql new file mode 100644 index 0000000..0dcb869 --- /dev/null +++ b/src/test/resources/regression/04/02.xcql @@ -0,0 +1,28 @@ + + + or + + + + title + + any + + + stem + + + + fish dog + + + + + cql.serverChoice + + = + + and + + + diff --git a/src/test/resources/regression/04/name b/src/test/resources/regression/04/name new file mode 100644 index 0000000..9bafd2c --- /dev/null +++ b/src/test/resources/regression/04/name @@ -0,0 +1 @@ +I/R/T plus Boolean \ No newline at end of file diff --git a/src/test/resources/regression/05/01.cql b/src/test/resources/regression/05/01.cql new file mode 100644 index 0000000..18c09ef --- /dev/null +++ b/src/test/resources/regression/05/01.cql @@ -0,0 +1 @@ +cat prox hat \ No newline at end of file diff --git a/src/test/resources/regression/05/01.xcql b/src/test/resources/regression/05/01.xcql new file mode 100644 index 0000000..406d103 --- /dev/null +++ b/src/test/resources/regression/05/01.xcql @@ -0,0 +1,23 @@ + + + prox + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + hat + + + diff --git a/src/test/resources/regression/05/02.cql b/src/test/resources/regression/05/02.cql new file mode 100644 index 0000000..aa05edd --- /dev/null +++ b/src/test/resources/regression/05/02.cql @@ -0,0 +1 @@ +cat prox/distance=3/unit=word/ordered hat \ No newline at end of file diff --git a/src/test/resources/regression/05/02.xcql b/src/test/resources/regression/05/02.xcql new file mode 100644 index 0000000..f09ab0b --- /dev/null +++ b/src/test/resources/regression/05/02.xcql @@ -0,0 +1,38 @@ + + + prox + + + distance + = + 3 + + + unit + = + word + + + ordered + + + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + hat + + + diff --git a/src/test/resources/regression/05/03.cql b/src/test/resources/regression/05/03.cql new file mode 100644 index 0000000..13a0574 --- /dev/null +++ b/src/test/resources/regression/05/03.cql @@ -0,0 +1 @@ +cat prox/distance<3 hat \ No newline at end of file diff --git a/src/test/resources/regression/05/03.xcql b/src/test/resources/regression/05/03.xcql new file mode 100644 index 0000000..25c5377 --- /dev/null +++ b/src/test/resources/regression/05/03.xcql @@ -0,0 +1,30 @@ + + + prox + + + distance + < + 3 + + + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + hat + + + diff --git a/src/test/resources/regression/05/04.cql b/src/test/resources/regression/05/04.cql new file mode 100644 index 0000000..53ca6c8 --- /dev/null +++ b/src/test/resources/regression/05/04.cql @@ -0,0 +1 @@ +"fish food" prox/unit=sentence and \ No newline at end of file diff --git a/src/test/resources/regression/05/04.xcql b/src/test/resources/regression/05/04.xcql new file mode 100644 index 0000000..a6e2198 --- /dev/null +++ b/src/test/resources/regression/05/04.xcql @@ -0,0 +1,30 @@ + + + prox + + + unit + = + sentence + + + + + + cql.serverChoice + + = + + fish food + + + + + cql.serverChoice + + = + + and + + + diff --git a/src/test/resources/regression/05/05.cql b/src/test/resources/regression/05/05.cql new file mode 100644 index 0000000..18d574d --- /dev/null +++ b/src/test/resources/regression/05/05.cql @@ -0,0 +1 @@ +title all "chips frog" prox/distance<=5 exact \ No newline at end of file diff --git a/src/test/resources/regression/05/05.xcql b/src/test/resources/regression/05/05.xcql new file mode 100644 index 0000000..a59341f --- /dev/null +++ b/src/test/resources/regression/05/05.xcql @@ -0,0 +1,30 @@ + + + prox + + + distance + <= + 5 + + + + + + title + + all + + chips frog + + + + + cql.serverChoice + + = + + exact + + + diff --git a/src/test/resources/regression/05/06.cql b/src/test/resources/regression/05/06.cql new file mode 100644 index 0000000..e9ae9fd --- /dev/null +++ b/src/test/resources/regression/05/06.cql @@ -0,0 +1 @@ +(dc.author == "jones" prox/distance>5/unit=element title >= "smith") \ No newline at end of file diff --git a/src/test/resources/regression/05/06.xcql b/src/test/resources/regression/05/06.xcql new file mode 100644 index 0000000..4ffea29 --- /dev/null +++ b/src/test/resources/regression/05/06.xcql @@ -0,0 +1,35 @@ + + + prox + + + distance + > + 5 + + + unit + = + element + + + + + + dc.author + + == + + jones + + + + + title + + >= + + smith + + + diff --git a/src/test/resources/regression/05/07.cql b/src/test/resources/regression/05/07.cql new file mode 100644 index 0000000..fb65e0f --- /dev/null +++ b/src/test/resources/regression/05/07.cql @@ -0,0 +1 @@ +((cat prox hat)) \ No newline at end of file diff --git a/src/test/resources/regression/05/07.xcql b/src/test/resources/regression/05/07.xcql new file mode 100644 index 0000000..406d103 --- /dev/null +++ b/src/test/resources/regression/05/07.xcql @@ -0,0 +1,23 @@ + + + prox + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + hat + + + diff --git a/src/test/resources/regression/05/08.cql b/src/test/resources/regression/05/08.cql new file mode 100644 index 0000000..24a51b2 --- /dev/null +++ b/src/test/resources/regression/05/08.cql @@ -0,0 +1 @@ +a and/rel.SumOfScores b \ No newline at end of file diff --git a/src/test/resources/regression/05/08.xcql b/src/test/resources/regression/05/08.xcql new file mode 100644 index 0000000..b46dcfd --- /dev/null +++ b/src/test/resources/regression/05/08.xcql @@ -0,0 +1,28 @@ + + + and + + + rel.sumofscores + + + + + + cql.serverChoice + + = + + a + + + + + cql.serverChoice + + = + + b + + + diff --git a/src/test/resources/regression/05/09.cql b/src/test/resources/regression/05/09.cql new file mode 100644 index 0000000..2cd14ce --- /dev/null +++ b/src/test/resources/regression/05/09.cql @@ -0,0 +1 @@ +a and/rel.algorithm=CORI b \ No newline at end of file diff --git a/src/test/resources/regression/05/09.xcql b/src/test/resources/regression/05/09.xcql new file mode 100644 index 0000000..1dc3602 --- /dev/null +++ b/src/test/resources/regression/05/09.xcql @@ -0,0 +1,30 @@ + + + and + + + rel.algorithm + = + CORI + + + + + + cql.serverChoice + + = + + a + + + + + cql.serverChoice + + = + + b + + + diff --git a/src/test/resources/regression/05/name b/src/test/resources/regression/05/name new file mode 100644 index 0000000..4c6e65c --- /dev/null +++ b/src/test/resources/regression/05/name @@ -0,0 +1 @@ +Prox \ No newline at end of file diff --git a/src/test/resources/regression/06/01.cql b/src/test/resources/regression/06/01.cql new file mode 100644 index 0000000..b428b8f --- /dev/null +++ b/src/test/resources/regression/06/01.cql @@ -0,0 +1 @@ +(cat^) \ No newline at end of file diff --git a/src/test/resources/regression/06/01.xcql b/src/test/resources/regression/06/01.xcql new file mode 100644 index 0000000..0dcc5fb --- /dev/null +++ b/src/test/resources/regression/06/01.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + cat^ + diff --git a/src/test/resources/regression/06/02.cql b/src/test/resources/regression/06/02.cql new file mode 100644 index 0000000..d579091 --- /dev/null +++ b/src/test/resources/regression/06/02.cql @@ -0,0 +1 @@ +"cat" \ No newline at end of file diff --git a/src/test/resources/regression/06/02.xcql b/src/test/resources/regression/06/02.xcql new file mode 100644 index 0000000..48aee99 --- /dev/null +++ b/src/test/resources/regression/06/02.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + cat + diff --git a/src/test/resources/regression/06/03.cql b/src/test/resources/regression/06/03.cql new file mode 100644 index 0000000..d482955 --- /dev/null +++ b/src/test/resources/regression/06/03.cql @@ -0,0 +1 @@ +"^cat says \"fish\"" \ No newline at end of file diff --git a/src/test/resources/regression/06/03.xcql b/src/test/resources/regression/06/03.xcql new file mode 100644 index 0000000..9db40ae --- /dev/null +++ b/src/test/resources/regression/06/03.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + ^cat says "fish" + diff --git a/src/test/resources/regression/06/04.cql b/src/test/resources/regression/06/04.cql new file mode 100644 index 0000000..ce842d2 --- /dev/null +++ b/src/test/resources/regression/06/04.cql @@ -0,0 +1 @@ +"cat*fish" \ No newline at end of file diff --git a/src/test/resources/regression/06/04.xcql b/src/test/resources/regression/06/04.xcql new file mode 100644 index 0000000..ee38b0e --- /dev/null +++ b/src/test/resources/regression/06/04.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + cat*fish + diff --git a/src/test/resources/regression/06/05.cql b/src/test/resources/regression/06/05.cql new file mode 100644 index 0000000..21ad338 --- /dev/null +++ b/src/test/resources/regression/06/05.cql @@ -0,0 +1 @@ +cat?dog \ No newline at end of file diff --git a/src/test/resources/regression/06/05.xcql b/src/test/resources/regression/06/05.xcql new file mode 100644 index 0000000..dc59539 --- /dev/null +++ b/src/test/resources/regression/06/05.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + cat?dog + diff --git a/src/test/resources/regression/06/06.cql b/src/test/resources/regression/06/06.cql new file mode 100644 index 0000000..0cfced3 --- /dev/null +++ b/src/test/resources/regression/06/06.cql @@ -0,0 +1 @@ +(("^cat*fishdog\"horse?")) \ No newline at end of file diff --git a/src/test/resources/regression/06/06.xcql b/src/test/resources/regression/06/06.xcql new file mode 100644 index 0000000..9d38695 --- /dev/null +++ b/src/test/resources/regression/06/06.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + ^cat*fishdog"horse? + diff --git a/src/test/resources/regression/06/name b/src/test/resources/regression/06/name new file mode 100644 index 0000000..6e12768 --- /dev/null +++ b/src/test/resources/regression/06/name @@ -0,0 +1 @@ +Special Characters \ No newline at end of file diff --git a/src/test/resources/regression/07/01.cql b/src/test/resources/regression/07/01.cql new file mode 100644 index 0000000..2e2ea08 --- /dev/null +++ b/src/test/resources/regression/07/01.cql @@ -0,0 +1 @@ +(((cat or dog) or horse) and frog) \ No newline at end of file diff --git a/src/test/resources/regression/07/01.xcql b/src/test/resources/regression/07/01.xcql new file mode 100644 index 0000000..3338a9f --- /dev/null +++ b/src/test/resources/regression/07/01.xcql @@ -0,0 +1,55 @@ + + + and + + + + + or + + + + + or + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + dog + + + + + + + cql.serverChoice + + = + + horse + + + + + + + cql.serverChoice + + = + + frog + + + diff --git a/src/test/resources/regression/07/02.cql b/src/test/resources/regression/07/02.cql new file mode 100644 index 0000000..ce2ba87 --- /dev/null +++ b/src/test/resources/regression/07/02.cql @@ -0,0 +1 @@ +(cat and dog) or (horse and frog) \ No newline at end of file diff --git a/src/test/resources/regression/07/02.xcql b/src/test/resources/regression/07/02.xcql new file mode 100644 index 0000000..1324889 --- /dev/null +++ b/src/test/resources/regression/07/02.xcql @@ -0,0 +1,55 @@ + + + or + + + + + and + + + + cql.serverChoice + + = + + cat + + + + + cql.serverChoice + + = + + dog + + + + + + + + and + + + + cql.serverChoice + + = + + horse + + + + + cql.serverChoice + + = + + frog + + + + + diff --git a/src/test/resources/regression/07/03.cql b/src/test/resources/regression/07/03.cql new file mode 100644 index 0000000..99d3e25 --- /dev/null +++ b/src/test/resources/regression/07/03.cql @@ -0,0 +1 @@ +(cat and (horse or frog)) and chips \ No newline at end of file diff --git a/src/test/resources/regression/07/03.xcql b/src/test/resources/regression/07/03.xcql new file mode 100644 index 0000000..202af98 --- /dev/null +++ b/src/test/resources/regression/07/03.xcql @@ -0,0 +1,55 @@ + + + and + + + + + and + + + + cql.serverChoice + + = + + cat + + + + + + or + + + + cql.serverChoice + + = + + horse + + + + + cql.serverChoice + + = + + frog + + + + + + + + + cql.serverChoice + + = + + chips + + + diff --git a/src/test/resources/regression/07/name b/src/test/resources/regression/07/name new file mode 100644 index 0000000..b8a913e --- /dev/null +++ b/src/test/resources/regression/07/name @@ -0,0 +1 @@ +Nesting Parentheses \ No newline at end of file diff --git a/src/test/resources/regression/08/01.cql b/src/test/resources/regression/08/01.cql new file mode 100644 index 0000000..665568f --- /dev/null +++ b/src/test/resources/regression/08/01.cql @@ -0,0 +1 @@ +> foo="http://www.loc.gov/zing/cql/dc-indexes/" dc.title="fish" \ No newline at end of file diff --git a/src/test/resources/regression/08/01.xcql b/src/test/resources/regression/08/01.xcql new file mode 100644 index 0000000..4e2d548 --- /dev/null +++ b/src/test/resources/regression/08/01.xcql @@ -0,0 +1,13 @@ + + + + foo + http://www.loc.gov/zing/cql/dc-indexes/ + + + dc.title + + = + + fish + diff --git a/src/test/resources/regression/08/02.cql b/src/test/resources/regression/08/02.cql new file mode 100644 index 0000000..f5bf9b0 --- /dev/null +++ b/src/test/resources/regression/08/02.cql @@ -0,0 +1 @@ +> "http://www.loc.gov/zing/cql/dc-indexes/" title="fish" \ No newline at end of file diff --git a/src/test/resources/regression/08/02.xcql b/src/test/resources/regression/08/02.xcql new file mode 100644 index 0000000..63ce6ad --- /dev/null +++ b/src/test/resources/regression/08/02.xcql @@ -0,0 +1,12 @@ + + + + http://www.loc.gov/zing/cql/dc-indexes/ + + + title + + = + + fish + diff --git a/src/test/resources/regression/08/03.cql b/src/test/resources/regression/08/03.cql new file mode 100644 index 0000000..f75c2fc --- /dev/null +++ b/src/test/resources/regression/08/03.cql @@ -0,0 +1 @@ +> foo="http://www.loc.gov/zing/cql/dc-indexes" > ccg = "http://srw.o-r-g.org/cql/indexSets/ccg/" foo.title="fish" and ccg.force=3 \ No newline at end of file diff --git a/src/test/resources/regression/08/03.xcql b/src/test/resources/regression/08/03.xcql new file mode 100644 index 0000000..025c7c9 --- /dev/null +++ b/src/test/resources/regression/08/03.xcql @@ -0,0 +1,33 @@ + + + + foo + http://www.loc.gov/zing/cql/dc-indexes + + + ccg + http://srw.o-r-g.org/cql/indexSets/ccg/ + + + + and + + + + foo.title + + = + + fish + + + + + ccg.force + + = + + 3 + + + diff --git a/src/test/resources/regression/08/name b/src/test/resources/regression/08/name new file mode 100644 index 0000000..d37a456 --- /dev/null +++ b/src/test/resources/regression/08/name @@ -0,0 +1 @@ +Prefix Maps \ No newline at end of file diff --git a/src/test/resources/regression/09/01.cql b/src/test/resources/regression/09/01.cql new file mode 100644 index 0000000..cda5565 --- /dev/null +++ b/src/test/resources/regression/09/01.cql @@ -0,0 +1 @@ +any or all:stem and all contains any prox proxfuzzy \ No newline at end of file diff --git a/src/test/resources/regression/09/01.xcql b/src/test/resources/regression/09/01.xcql new file mode 100644 index 0000000..f721ed0 --- /dev/null +++ b/src/test/resources/regression/09/01.xcql @@ -0,0 +1,39 @@ + + + and + + + + + or + + + + cql.serverChoice + + = + + any + + + + + cql.serverChoice + + = + + all:stem + + + + + + + all contains + + any + + prox proxfuzzy + + + diff --git a/src/test/resources/regression/09/02.cql b/src/test/resources/regression/09/02.cql new file mode 100644 index 0000000..3026808 --- /dev/null +++ b/src/test/resources/regression/09/02.cql @@ -0,0 +1 @@ +(((((((((any))))))))) \ No newline at end of file diff --git a/src/test/resources/regression/09/02.xcql b/src/test/resources/regression/09/02.xcql new file mode 100644 index 0000000..dd7c8f0 --- /dev/null +++ b/src/test/resources/regression/09/02.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + any + diff --git a/src/test/resources/regression/09/03.cql b/src/test/resources/regression/09/03.cql new file mode 100644 index 0000000..3cc762b --- /dev/null +++ b/src/test/resources/regression/09/03.cql @@ -0,0 +1 @@ +"" \ No newline at end of file diff --git a/src/test/resources/regression/09/03.xcql b/src/test/resources/regression/09/03.xcql new file mode 100644 index 0000000..1eeff16 --- /dev/null +++ b/src/test/resources/regression/09/03.xcql @@ -0,0 +1,7 @@ + + cql.serverChoice + + = + + + diff --git a/src/test/resources/regression/09/04.cql b/src/test/resources/regression/09/04.cql new file mode 100644 index 0000000..d2fba11 --- /dev/null +++ b/src/test/resources/regression/09/04.cql @@ -0,0 +1 @@ +> any > any = exact any > any \ No newline at end of file diff --git a/src/test/resources/regression/09/04.xcql b/src/test/resources/regression/09/04.xcql new file mode 100644 index 0000000..aed8eca --- /dev/null +++ b/src/test/resources/regression/09/04.xcql @@ -0,0 +1,16 @@ + + + + any + + + any + exact + + + any + + > + + any + diff --git a/src/test/resources/regression/09/05.cql b/src/test/resources/regression/09/05.cql new file mode 100644 index 0000000..9fbc491 --- /dev/null +++ b/src/test/resources/regression/09/05.cql @@ -0,0 +1 @@ +sortby sortby sortby \ No newline at end of file diff --git a/src/test/resources/regression/09/05.xcql b/src/test/resources/regression/09/05.xcql new file mode 100644 index 0000000..578af0f --- /dev/null +++ b/src/test/resources/regression/09/05.xcql @@ -0,0 +1,12 @@ + + cql.serverChoice + + = + + sortby + + + sortby + + + diff --git a/src/test/resources/regression/09/06.cql b/src/test/resources/regression/09/06.cql new file mode 100644 index 0000000..c1c8282 --- /dev/null +++ b/src/test/resources/regression/09/06.cql @@ -0,0 +1 @@ +sortby sortby sortby sortby sortby \ No newline at end of file diff --git a/src/test/resources/regression/09/06.xcql b/src/test/resources/regression/09/06.xcql new file mode 100644 index 0000000..2e136b5 --- /dev/null +++ b/src/test/resources/regression/09/06.xcql @@ -0,0 +1,18 @@ + + cql.serverChoice + + = + + sortby + + + sortby + + + sortby + + + sortby + + + diff --git a/src/test/resources/regression/09/name b/src/test/resources/regression/09/name new file mode 100644 index 0000000..ed65cdb --- /dev/null +++ b/src/test/resources/regression/09/name @@ -0,0 +1 @@ +Lame Searches \ No newline at end of file diff --git a/src/test/resources/regression/10/01.cql b/src/test/resources/regression/10/01.cql new file mode 100644 index 0000000..c45d250 --- /dev/null +++ b/src/test/resources/regression/10/01.cql @@ -0,0 +1 @@ +kernighan sortby title \ No newline at end of file diff --git a/src/test/resources/regression/10/01.xcql b/src/test/resources/regression/10/01.xcql new file mode 100644 index 0000000..0c8cc74 --- /dev/null +++ b/src/test/resources/regression/10/01.xcql @@ -0,0 +1,12 @@ + + cql.serverChoice + + = + + kernighan + + + title + + + diff --git a/src/test/resources/regression/10/02.cql b/src/test/resources/regression/10/02.cql new file mode 100644 index 0000000..606ba50 --- /dev/null +++ b/src/test/resources/regression/10/02.cql @@ -0,0 +1 @@ +kernighan and ritchie sortby title \ No newline at end of file diff --git a/src/test/resources/regression/10/02.xcql b/src/test/resources/regression/10/02.xcql new file mode 100644 index 0000000..dbd6407 --- /dev/null +++ b/src/test/resources/regression/10/02.xcql @@ -0,0 +1,28 @@ + + + and + + + + cql.serverChoice + + = + + kernighan + + + + + cql.serverChoice + + = + + ritchie + + + + + title + + + diff --git a/src/test/resources/regression/10/03.cql b/src/test/resources/regression/10/03.cql new file mode 100644 index 0000000..beae0f5 --- /dev/null +++ b/src/test/resources/regression/10/03.cql @@ -0,0 +1 @@ +dc.creator=kernighan sortby dc.title \ No newline at end of file diff --git a/src/test/resources/regression/10/03.xcql b/src/test/resources/regression/10/03.xcql new file mode 100644 index 0000000..eaef782 --- /dev/null +++ b/src/test/resources/regression/10/03.xcql @@ -0,0 +1,12 @@ + + dc.creator + + = + + kernighan + + + dc.title + + + diff --git a/src/test/resources/regression/10/04.cql b/src/test/resources/regression/10/04.cql new file mode 100644 index 0000000..28ef4c4 --- /dev/null +++ b/src/test/resources/regression/10/04.cql @@ -0,0 +1 @@ +dc.creator=kernighan sortby numberOfLegs/cql.number \ No newline at end of file diff --git a/src/test/resources/regression/10/04.xcql b/src/test/resources/regression/10/04.xcql new file mode 100644 index 0000000..3a32884 --- /dev/null +++ b/src/test/resources/regression/10/04.xcql @@ -0,0 +1,17 @@ + + dc.creator + + = + + kernighan + + + numberOfLegs + + + cql.number + + + + + diff --git a/src/test/resources/regression/10/05.cql b/src/test/resources/regression/10/05.cql new file mode 100644 index 0000000..d263a12 --- /dev/null +++ b/src/test/resources/regression/10/05.cql @@ -0,0 +1 @@ +dc.creator=kernighan sortby dc.title/sort.respectCase \ No newline at end of file diff --git a/src/test/resources/regression/10/05.xcql b/src/test/resources/regression/10/05.xcql new file mode 100644 index 0000000..5821b04 --- /dev/null +++ b/src/test/resources/regression/10/05.xcql @@ -0,0 +1,17 @@ + + dc.creator + + = + + kernighan + + + dc.title + + + sort.respectcase + + + + + diff --git a/src/test/resources/regression/10/06.cql b/src/test/resources/regression/10/06.cql new file mode 100644 index 0000000..ead9f79 --- /dev/null +++ b/src/test/resources/regression/10/06.cql @@ -0,0 +1 @@ +dc.creator=kernighan sortby dc.title/sort.respectCase/sort.descending \ No newline at end of file diff --git a/src/test/resources/regression/10/06.xcql b/src/test/resources/regression/10/06.xcql new file mode 100644 index 0000000..8d232b2 --- /dev/null +++ b/src/test/resources/regression/10/06.xcql @@ -0,0 +1,20 @@ + + dc.creator + + = + + kernighan + + + dc.title + + + sort.respectcase + + + sort.descending + + + + + diff --git a/src/test/resources/regression/10/07.cql b/src/test/resources/regression/10/07.cql new file mode 100644 index 0000000..3495ee0 --- /dev/null +++ b/src/test/resources/regression/10/07.cql @@ -0,0 +1 @@ +dc.creator=kernighan sortby dc.date dc.title \ No newline at end of file diff --git a/src/test/resources/regression/10/07.xcql b/src/test/resources/regression/10/07.xcql new file mode 100644 index 0000000..13737ee --- /dev/null +++ b/src/test/resources/regression/10/07.xcql @@ -0,0 +1,15 @@ + + dc.creator + + = + + kernighan + + + dc.date + + + dc.title + + + diff --git a/src/test/resources/regression/10/08.cql b/src/test/resources/regression/10/08.cql new file mode 100644 index 0000000..27e5a1c --- /dev/null +++ b/src/test/resources/regression/10/08.cql @@ -0,0 +1 @@ +dc.creator=kernighan sortby dc.date/sort.missingOmit \ No newline at end of file diff --git a/src/test/resources/regression/10/08.xcql b/src/test/resources/regression/10/08.xcql new file mode 100644 index 0000000..bcf2a8f --- /dev/null +++ b/src/test/resources/regression/10/08.xcql @@ -0,0 +1,17 @@ + + dc.creator + + = + + kernighan + + + dc.date + + + sort.missingomit + + + + + diff --git a/src/test/resources/regression/10/09.cql b/src/test/resources/regression/10/09.cql new file mode 100644 index 0000000..fc41d84 --- /dev/null +++ b/src/test/resources/regression/10/09.cql @@ -0,0 +1 @@ +dc.creator=kernighan sortby dc.date/sort.missingValue=1970 \ No newline at end of file diff --git a/src/test/resources/regression/10/09.xcql b/src/test/resources/regression/10/09.xcql new file mode 100644 index 0000000..8a60d51 --- /dev/null +++ b/src/test/resources/regression/10/09.xcql @@ -0,0 +1,19 @@ + + dc.creator + + = + + kernighan + + + dc.date + + + sort.missingvalue + = + 1970 + + + + + diff --git a/src/test/resources/regression/10/10.cql b/src/test/resources/regression/10/10.cql new file mode 100644 index 0000000..1f9b830 --- /dev/null +++ b/src/test/resources/regression/10/10.cql @@ -0,0 +1 @@ +>dc="http://deepcustard.org/1.0" blah sortby dc.custardDepth \ No newline at end of file diff --git a/src/test/resources/regression/10/10.xcql b/src/test/resources/regression/10/10.xcql new file mode 100644 index 0000000..cb97df6 --- /dev/null +++ b/src/test/resources/regression/10/10.xcql @@ -0,0 +1,18 @@ + + + + dc + http://deepcustard.org/1.0 + + + cql.serverChoice + + = + + blah + + + dc.custardDepth + + + diff --git a/src/test/resources/regression/10/11.cql b/src/test/resources/regression/10/11.cql new file mode 100644 index 0000000..216ec56 --- /dev/null +++ b/src/test/resources/regression/10/11.cql @@ -0,0 +1 @@ +>ns1="http://uri1" >ns2="http://uri2" whatever sortby ns1.key/a/b/c=1 ns2.key2 \ No newline at end of file diff --git a/src/test/resources/regression/10/11.xcql b/src/test/resources/regression/10/11.xcql new file mode 100644 index 0000000..ba2abe7 --- /dev/null +++ b/src/test/resources/regression/10/11.xcql @@ -0,0 +1,38 @@ + + + + ns1 + http://uri1 + + + ns2 + http://uri2 + + + cql.serverChoice + + = + + whatever + + + ns1.key + + + a + + + b + + + c + = + 1 + + + + + ns2.key2 + + + diff --git a/src/test/resources/regression/10/12.cql b/src/test/resources/regression/10/12.cql new file mode 100644 index 0000000..e73b2f7 --- /dev/null +++ b/src/test/resources/regression/10/12.cql @@ -0,0 +1 @@ +(>dc=x b=c) sortby d \ No newline at end of file diff --git a/src/test/resources/regression/10/12.xcql b/src/test/resources/regression/10/12.xcql new file mode 100644 index 0000000..06b0ac2 --- /dev/null +++ b/src/test/resources/regression/10/12.xcql @@ -0,0 +1,18 @@ + + + + dc + x + + + b + + = + + c + + + d + + + diff --git a/src/test/resources/regression/10/13.cql b/src/test/resources/regression/10/13.cql new file mode 100644 index 0000000..60694b0 --- /dev/null +++ b/src/test/resources/regression/10/13.cql @@ -0,0 +1 @@ +b=(>dc=x c) sortby d \ No newline at end of file diff --git a/src/test/resources/regression/10/13.xcql b/src/test/resources/regression/10/13.xcql new file mode 100644 index 0000000..06b0ac2 --- /dev/null +++ b/src/test/resources/regression/10/13.xcql @@ -0,0 +1,18 @@ + + + + dc + x + + + b + + = + + c + + + d + + + diff --git a/src/test/resources/regression/10/14.cql b/src/test/resources/regression/10/14.cql new file mode 100644 index 0000000..5a6f6c5 --- /dev/null +++ b/src/test/resources/regression/10/14.cql @@ -0,0 +1 @@ +(>dc=x c1 and c2) sortby d \ No newline at end of file diff --git a/src/test/resources/regression/10/14.xcql b/src/test/resources/regression/10/14.xcql new file mode 100644 index 0000000..4f9f6d2 --- /dev/null +++ b/src/test/resources/regression/10/14.xcql @@ -0,0 +1,34 @@ + + + + dc + x + + + + and + + + + cql.serverChoice + + = + + c1 + + + + + cql.serverChoice + + = + + c2 + + + + + d + + + diff --git a/src/test/resources/regression/10/15.cql b/src/test/resources/regression/10/15.cql new file mode 100644 index 0000000..9931696 --- /dev/null +++ b/src/test/resources/regression/10/15.cql @@ -0,0 +1 @@ +>dc="http://deepcustard.org" (>dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth \ No newline at end of file diff --git a/src/test/resources/regression/10/15.xcql b/src/test/resources/regression/10/15.xcql new file mode 100644 index 0000000..fb278bc --- /dev/null +++ b/src/test/resources/regression/10/15.xcql @@ -0,0 +1,22 @@ + + + + dc + http://deepcustard.org + + + dc + http://dublincore.org + + + dc.title + + = + + jaws + + + dc.custardDepth + + + diff --git a/src/test/resources/regression/10/16.cql b/src/test/resources/regression/10/16.cql new file mode 100644 index 0000000..eab4136 --- /dev/null +++ b/src/test/resources/regression/10/16.cql @@ -0,0 +1 @@ +>dc="http://deepcustard.org" (fish or >dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth \ No newline at end of file diff --git a/src/test/resources/regression/10/16.xcql b/src/test/resources/regression/10/16.xcql new file mode 100644 index 0000000..42b01d6 --- /dev/null +++ b/src/test/resources/regression/10/16.xcql @@ -0,0 +1,40 @@ + + + + dc + http://deepcustard.org + + + + or + + + + cql.serverChoice + + = + + fish + + + + + + + dc + http://dublincore.org + + + dc.title + + = + + jaws + + + + + dc.custardDepth + + + diff --git a/src/test/resources/regression/10/name b/src/test/resources/regression/10/name new file mode 100644 index 0000000..02e6bb6 --- /dev/null +++ b/src/test/resources/regression/10/name @@ -0,0 +1 @@ +Sorting \ No newline at end of file -- 1.7.10.4