From 85a225151b253f4541ebaef2960e02de3a441f16 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Thu, 3 Jan 2019 09:46:12 +0800 Subject: [PATCH] Start of adding XSuite tests to Maven for XQSuite --- pom.xml | 38 +++++- .../xar-resources/modules/test-runner.xql | 19 --- .../xquery/DocumentationTests.java | 11 ++ src/test/resources/conf.xml | 113 ++++++++++++++++++ .../xquery/documentation}/test-suite.xql | 9 +- 5 files changed, 167 insertions(+), 23 deletions(-) delete mode 100644 src/main/xar-resources/modules/test-runner.xql create mode 100644 src/test/java/org/exist/documentation/xquery/DocumentationTests.java create mode 100644 src/test/resources/conf.xml rename src/{main/xar-resources/modules => test/xquery/documentation}/test-suite.xql (97%) diff --git a/pom.xml b/pom.xml index 48d56225f..048df49a6 100644 --- a/pom.xml +++ b/pom.xml @@ -78,6 +78,27 @@ + + + + org.exist-db + exist-testkit + ${exist.version} + test + + + org.exist-db + exist-optional + ${exist.version} + test + + + junit + junit + test + + + @@ -98,6 +119,21 @@ + + + + src/main/xar-resources + false + xquery/ + + modules/** + + + + @@ -471,7 +507,7 @@ clojars.org - http://clojars.org/repo + https://clojars.org/repo diff --git a/src/main/xar-resources/modules/test-runner.xql b/src/main/xar-resources/modules/test-runner.xql deleted file mode 100644 index 1fedf32b3..000000000 --- a/src/main/xar-resources/modules/test-runner.xql +++ /dev/null @@ -1,19 +0,0 @@ -xquery version "3.1"; - -(:~ This library runs the XQSuite unit tests for the documentation app. - : - : @author eXist-db - : @version 1.0.0 - : @see http://www.exist-db.org/exist/apps/doc/xqsuite - :) - -import module namespace test = "http://exist-db.org/xquery/xqsuite" at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql"; -import module namespace tests = "http://exist-db.org/xquery/documentation/tests" at "test-suite.xql"; - -declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; -declare option output:method "json"; -declare option output:media-type "application/json"; - -test:suite( -inspect:module-functions(xs:anyURI("test-suite.xql")) -) diff --git a/src/test/java/org/exist/documentation/xquery/DocumentationTests.java b/src/test/java/org/exist/documentation/xquery/DocumentationTests.java new file mode 100644 index 000000000..cdf35520b --- /dev/null +++ b/src/test/java/org/exist/documentation/xquery/DocumentationTests.java @@ -0,0 +1,11 @@ +package org.exist.documentation.xquery; + +import org.exist.test.runner.XSuite; +import org.junit.runner.RunWith; + +@RunWith(XSuite.class) +@XSuite.XSuiteFiles({ + "src/test/xquery/documentation" +}) +public class DocumentationTests { +} diff --git a/src/test/resources/conf.xml b/src/test/resources/conf.xml new file mode 100644 index 000000000..bead82a69 --- /dev/null +++ b/src/test/resources/conf.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/xar-resources/modules/test-suite.xql b/src/test/xquery/documentation/test-suite.xql similarity index 97% rename from src/main/xar-resources/modules/test-suite.xql rename to src/test/xquery/documentation/test-suite.xql index 79ce5fab0..3acf6c0e4 100644 --- a/src/main/xar-resources/modules/test-suite.xql +++ b/src/test/xquery/documentation/test-suite.xql @@ -8,9 +8,12 @@ xquery version "3.1"; module namespace tests = "http://exist-db.org/xquery/documentation/tests"; -import module namespace docbook = "http://docbook.org/ns/docbook" at "docbook.xql"; -import module namespace config = "http://exist-db.org/xquery/apps/config" at "config.xqm"; -import module namespace diag = "http://exist-db.org/xquery/diagnostics" at "diagnostics.xql"; +import module namespace docbook = "http://docbook.org/ns/docbook" + at "resource:xquery/modules/docbook.xql"; +import module namespace config = "http://exist-db.org/xquery/apps/config" + at "resource:xquery/modules/config.xql"; +import module namespace diag = "http://exist-db.org/xquery/diagnostics" + at "resource:xquery/modules/diagnostics.xql"; declare namespace test = "http://exist-db.org/xquery/xqsuite"; declare namespace db5 = "http://docbook.org/ns/docbook";