Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start of adding XSuite tests to Maven for XQSuite #291

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
812 changes: 0 additions & 812 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "5.4.1-SNAPSHOT",
"description": "Documentation package for eXist-db",
"scripts": {
"test": "mocha src/test/mocha/ --recursive --exit",
"cypress": "cypress run"
},
"repository": {
Expand All @@ -23,11 +22,6 @@
"url": "https://github.com/eXist-db/documentation/issues"
},
"homepage": "https://github.com/eXist-db/documentation#readme",
"standard": {
"env": [
"mocha"
]
},
"devDependencies": {
"acorn": "^8.8.1",
"chai": "^4.3.7",
Expand All @@ -48,7 +42,6 @@
"gulp-svgmin": "^4.1.0",
"gulp-uglify": "^3.0.2",
"lazypipe": "^1.0.2",
"mocha": "^10.2.0",
"sass": "^1.57.1",
"supertest": "^6.3.3"
},
Expand Down
69 changes: 54 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@
</plugins>
</reporting>

<dependencies>
<!-- test dependencies -->
<dependency>
<groupId>org.exist-db</groupId>
<artifactId>exist-core</artifactId>
<version>${exist.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<!--
Needed by the documentation app under test
-->
<groupId>org.exist-db</groupId>
<artifactId>exist-index-lucene</artifactId>
<version>${exist.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<resources>
<resource>
Expand All @@ -98,8 +122,24 @@
</resource>
</resources>

<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>false</filtering>
</testResource>
<testResource>
<directory>src/test/resources-filtered</directory>
<filtering>true</filtering>
</testResource>
</testResources>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down Expand Up @@ -151,17 +191,6 @@
</goals>
<phase>compile</phase>
</execution>
<!-- Mocha is used for integration tests of xqsuite -->
<execution>
<id>mocha tests</id>
<goals>
<goal>npm</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<arguments>test</arguments>
</configuration>
</execution>
</executions>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
Expand Down Expand Up @@ -246,7 +275,7 @@
<plugin>
<groupId>com.helger.maven</groupId>
<artifactId>ph-schematron-maven-plugin</artifactId>
<version>6.3.3</version>
<version>6.3.4</version>
<executions>
<execution>
<goals>
Expand All @@ -262,6 +291,16 @@
<xmlIncludes>*/*.xml</xmlIncludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
<plugin>
<groupId>ro.kuberam.maven.plugins</groupId>
<artifactId>kuberam-expath-plugin</artifactId>
Expand Down Expand Up @@ -309,7 +348,7 @@
<executions>
<execution>
<id>prepare-autodeploy-deps</id>
<phase>pre-integration-test</phase>
<phase>generate-test-resources</phase>
<goals>
<goal>resolve</goal>
</goals>
Expand All @@ -330,7 +369,7 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.40.2</version>
<version>0.40.3</version>
<configuration>
<verbose>true</verbose>
<images>
Expand Down Expand Up @@ -471,7 +510,7 @@
<pluginRepositories>
<pluginRepository>
<id>clojars.org</id>
<url>http://clojars.org/repo</url>
<url>https://clojars.org/repo</url>
</pluginRepository>
</pluginRepositories>

Expand Down
19 changes: 0 additions & 19 deletions src/main/xar-resources/modules/test-runner.xql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 {
}
48 changes: 0 additions & 48 deletions src/test/mocha/xqSuite.js

This file was deleted.

107 changes: 107 additions & 0 deletions src/test/resources-filtered/conf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<exist>

<db-connection cacheSize="256M" checkMaxCacheSize="true" collectionCache="64M" database="native"
files="${basedir}/target/test-data" pageSize="4096" nodesBuffer="1000" cacheShrinkThreshold="10000"
doc-ids="default" minDiskSpace="128M" posix-chown-restricted="true" preserve-on-copy="false">
<startup>
<triggers>
<trigger class="org.exist.security.BouncyCastleJceProviderStartupTrigger"/>

<!--
AutoDeploymentTrigger will install any .xar application package it finds
in the autodeploy directory unless the application has already been installed
in the db.
-->
<trigger class="org.exist.repo.AutoDeploymentTrigger">
<parameter name="ignore-autodeploy-system-property" value="true"/>
<parameter name="dir" value="${basedir}/target/autodeploy"/>
</trigger>
</triggers>
</startup>
<pool max="20" min="1" sync-period="120000" wait-before-shutdown="120000"/>
<query-pool max-stack-size="64" size="128" timeout="120000"/>
<recovery enabled="yes" group-commit="no" journal-dir="${basedir}/target/test-data"
size="100M" sync-on-commit="no" force-restart="no" consistency-check="yes"/>
<watchdog output-size-limit="1000000" query-timeout="-1"/>
</db-connection>

<repository root="/db/apps"/>

<binary-manager>
<cache class="org.exist.util.io.FileFilterInputStreamCache"/>
</binary-manager>

<indexer caseSensitive="yes" index-depth="5" preserve-whitespace-mixed-content="no"
suppress-whitespace="none">
<modules>

<!--
Needed by the documentation app under test
-->
<module id="lucene-index" buffer="32" class="org.exist.indexing.lucene.LuceneIndex" />

</modules>
<index/>
</indexer>

<scheduler/>

<parser>
<xml>
<features>
<feature name="http://xml.org/sax/features/external-general-entities" value="false"/>
<feature name="http://xml.org/sax/features/external-parameter-entities" value="false"/>
<feature name="http://javax.xml.XMLConstants/feature/secure-processing" value="true"/>
</features>
</xml>
<html-to-xml class="org.cyberneko.html.parsers.SAXParser">
<properties>
<property name="http://cyberneko.org/html/properties/names/elems" value="match"/>
<property name="http://cyberneko.org/html/properties/names/attrs" value="no-change"/>
</properties>
</html-to-xml>
</parser>

<serializer add-exist-id="none" compress-output="no" enable-xinclude="yes"
enable-xsl="no" indent="yes" match-tagging-attributes="no"
match-tagging-elements="no"/>

<transformer class="net.sf.saxon.TransformerFactoryImpl" caching="yes">
<attribute name="http://saxon.sf.net/feature/version-warning" value="false" type="boolean"/>
</transformer>

<validation mode="no">
<entity-resolver>
<catalog uri="${project.build.testOutputDirectory}/org/exist/validation/catalog.xml"/>
</entity-resolver>
</validation>

<xquery enable-java-binding="no" disable-deprecated-functions="no"
enable-query-rewriting="yes" backwardCompatible="no"
enforce-index-use="always"
raise-error-on-failed-retrieval="no">

<builtin-modules>
<!--
Needed by the documentation app under test
-->
<module uri="http://exist-db.org/xquery/lucene" class="org.exist.xquery.modules.lucene.LuceneModule" />

<!-- Needed for XQSuite! -->
<module uri="http://www.w3.org/2005/xpath-functions/map" class="org.exist.xquery.functions.map.MapModule" />
<module uri="http://www.w3.org/2005/xpath-functions/array" class="org.exist.xquery.functions.array.ArrayModule" />
<module uri="http://exist-db.org/xquery/inspection" class="org.exist.xquery.functions.inspect.InspectionModule"/>
<module uri="http://exist-db.org/xquery/response" class="org.exist.xquery.functions.response.ResponseModule" />
<module uri="http://exist-db.org/xquery/system" class="org.exist.xquery.functions.system.SystemModule" />
<module uri="http://exist-db.org/xquery/util" class="org.exist.xquery.functions.util.UtilModule">
<parameter name="evalDisabled" value="false"/>
</module>
<module uri="http://exist-db.org/xquery/xmldb" class="org.exist.xquery.functions.xmldb.XMLDBModule"/>

</builtin-modules>
</xquery>

<xupdate allowed-fragmentation="50000" enable-consistency-checks="no"/>

</exist>
Original file line number Diff line number Diff line change
Expand Up @@ -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:modules/docbook.xql";
import module namespace config = "http://exist-db.org/xquery/apps/config"
at "resource:modules/config.xql";
import module namespace diag = "http://exist-db.org/xquery/diagnostics"
at "resource:modules/diagnostics.xql";

declare namespace test = "http://exist-db.org/xquery/xqsuite";
declare namespace db5 = "http://docbook.org/ns/docbook";
Expand Down