From 07b6f6798434a0fa1d1d5d4e7e90ee76232ad9d3 Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Fri, 14 Mar 2014 14:26:50 +0100 Subject: [PATCH] Clean-up, docs --- Build | 8 -------- bin/CQLGenerator | 5 ----- bin/CQLLexer | 5 ----- bin/CQLParser | 5 ----- etc/generate.properties | 10 ---------- src/test/java/org/z3950/zing/cql/CQLParserTest.java | 14 +++++++++++++- 6 files changed, 13 insertions(+), 34 deletions(-) delete mode 100755 Build delete mode 100755 bin/CQLGenerator delete mode 100755 bin/CQLLexer delete mode 100755 bin/CQLParser delete mode 100644 etc/generate.properties diff --git a/Build b/Build deleted file mode 100755 index 87facee..0000000 --- a/Build +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - - -: ${MAKE=make} -for dir in src/main/java/org/z3950/zing/cql test/regression docs; do - echo "=== Building in $dir ===" - ( cd $dir; $MAKE ${@+"$@"} ) -done diff --git a/bin/CQLGenerator b/bin/CQLGenerator deleted file mode 100755 index 55de086..0000000 --- a/bin/CQLGenerator +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Trivial script to invoke the CQLGenerator test-harness - -java org.z3950.zing.cql.CQLGenerator ${@+"$@"} diff --git a/bin/CQLLexer b/bin/CQLLexer deleted file mode 100755 index c07e566..0000000 --- a/bin/CQLLexer +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Trivial script to invoke the CQLLexer test-harness - -java org.z3950.zing.cql.CQLLexer ${@+"$@"} diff --git a/bin/CQLParser b/bin/CQLParser deleted file mode 100755 index 26a52b1..0000000 --- a/bin/CQLParser +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Trivial script to invoke the CQLParser test-harness - -java org.z3950.zing.cql.CQLParser ${@+"$@"} diff --git a/etc/generate.properties b/etc/generate.properties deleted file mode 100644 index 409f872..0000000 --- a/etc/generate.properties +++ /dev/null @@ -1,10 +0,0 @@ -# -# 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/java/org/z3950/zing/cql/CQLParserTest.java b/src/test/java/org/z3950/zing/cql/CQLParserTest.java index 7e258e0..61b112b 100644 --- a/src/test/java/org/z3950/zing/cql/CQLParserTest.java +++ b/src/test/java/org/z3950/zing/cql/CQLParserTest.java @@ -103,6 +103,19 @@ public class CQLParserTest { } } + /** + * Test the integrity of the parser as follows: + * - Generate a random tree with CQLGenerator + * - Serialize it + * - Canonicalise it by running through the parser + * - Compare the before-and-after versions. + * Since the CQLGenerator output is in canonical form anyway, the + * before-and-after versions should be identical. This process exercises + * the comprehensiveness and bullet-proofing of the parser, as well as + * the accuracy of the rendering. + * @throws IOException + * @throws MissingParameterException + */ @Test public void testRandomQueries() throws IOException, MissingParameterException { out.println("Testing the parser using 100 randomly generated queries..."); @@ -128,7 +141,6 @@ public class CQLParserTest { } } - //helper methods follow //TODO move to masterkey-common -- 1.7.10.4