diff --git a/.github/workflows/tck-runner.yml b/.github/workflows/tck-runner.yml new file mode 100644 index 00000000..232f2bfc --- /dev/null +++ b/.github/workflows/tck-runner.yml @@ -0,0 +1,21 @@ +name: Run Jakarta Data TCK + +on: + schedule: + - cron: '0 0 * * 1,3,5' #Monday, Wednesday, Friday at Midnight + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java-version: [17, 21] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java-version }} + cache: maven + - name: Running Jakarta Data TCK tests + run: mvn test --file jnosql-data-tck-runner/pom.xml -Djakarta.tck.profile=standalone -Djnosql.document.database=jnosql -Djnosql.mongodb.host=localhost:27017 diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 52d61afd..4955dbf5 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -8,6 +8,8 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version == [Unreleased] +- Include Jakarta Data TCK Runner for Eclipse JNoSQL; + == [1.1.1] - 2023-05-25 === Added diff --git a/README.adoc b/README.adoc index 1afc92ac..506a45a5 100644 --- a/README.adoc +++ b/README.adoc @@ -359,6 +359,13 @@ The Criteria API can be used via CriteriaDocumentTemplate. ---- +== TCK Runners + +The Eclipse JNoSQL project provides Technology Compatibility Kit (TCK) runners for Jakarta Data. These runners allow you to run the TCK tests against the Eclipse JNoSQL implementation to verify its compatibility with the Jakarta Data specifications. + +=== Jakarta Data TCK Runner + +The Jakarta Data TCK Runner is a project that runs the Jakarta Data TCK tests against the Eclipse JNoSQL implementation. It provides a convenient way to verify the compatibility of a Jakarta Data implementation with the Jakarta Data specification. Learn more about it link:jnosql-data-tck-runner/README.adoc[here]. == Getting Help diff --git a/jnosql-data-tck-runner/README.adoc b/jnosql-data-tck-runner/README.adoc new file mode 100644 index 00000000..df93f02b --- /dev/null +++ b/jnosql-data-tck-runner/README.adoc @@ -0,0 +1,24 @@ += Jakarta Data TCK Eclipse JNoSQL Implementation +:toc: auto + +This project runs the Jakarta Data Technology Compatibility Kit (TCK) on standalone mode with Eclipse JNoSQL. Before running this project it is recommended to read the documentation located in the base link:https://github.com/jakartaee/data/blob/main/tck-dist/src/main/asciidoc/data-tck-reference-guide.adoc[TCK distribution project, _target=_blank]. + +== Overview + +In order to aid in the development of the `data-1.0` feature, this project is configured specifically to allow the feature developers to run the TCK against the Eclipse JNoSQL implementation. + +== Running the TCK for Verification + +First start up a Mongo DB instance. You can do this by running the following command: + +[source,shell] +---- +docker run -d -p 27017:27017 --name mongodb mongo +---- + +Then, run the following command to execute the TCK: + +[source,shell] +---- +mvn clean test -B -Djakarta.tck.profile=standalone -Djnosql.document.database=jnosql -Djnosql.mongodb.host=localhost:27017 +---- diff --git a/jnosql-data-tck-runner/logging.properties b/jnosql-data-tck-runner/logging.properties new file mode 100644 index 00000000..4b473527 --- /dev/null +++ b/jnosql-data-tck-runner/logging.properties @@ -0,0 +1,41 @@ +#Handlers we plan to use +handlers=java.util.logging.FileHandler,java.util.logging.ConsoleHandler + +#Global logger - By default only log warnings +.level=WARNING + +#Jakarta Data TCK logger - By default log everything for ee.jakarta.tck.data +ee.jakarta.tck.data.level=ALL + +# Arquillian and JNoSQL - By default log everything, might reduce after development is complete. +org.jbossl=ALL +org.eclipse.jnosql=all + +#Formatting for the simple formatter +java.util.logging.SimpleFormatter.class.log=true +java.util.logging.SimpleFormatter.class.full=false +java.util.logging.SimpleFormatter.class.length=10 + +java.util.logging.SimpleFormatter.level.log=true + +java.util.logging.SimpleFormatter.method.log=true +java.util.logging.SimpleFormatter.method.length=30 + +java.util.logging.SimpleFormatter.thread.log=true +java.util.logging.SimpleFormatter.thread.length=3 + +java.util.logging.SimpleFormatter.time.log=true +java.util.logging.SimpleFormatter.time.format=[MM/dd/yyyy HH:mm:ss:SSS z] + +java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] %4$.1s %3$s %5$s %n + +# Log warnings to console +java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter +java.util.logging.ConsoleHandler.level=WARNING + +# Log everything else to file +java.util.logging.FileHandler.pattern=target/DataTCK%g%u.log +java.util.logging.FileHandler.limit = 500000 +java.util.logging.FileHandler.count = 5 +java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter +java.util.logging.FileHandler.level=CONFIG \ No newline at end of file diff --git a/jnosql-data-tck-runner/pom.xml b/jnosql-data-tck-runner/pom.xml new file mode 100644 index 00000000..47f2d5fe --- /dev/null +++ b/jnosql-data-tck-runner/pom.xml @@ -0,0 +1,170 @@ + + + + 4.0.0 + + + org.eclipse.jnosql.mapping + jnosql-mapping-extensions + 1.1.2-SNAPSHOT + + + jnosql-data-tck-runner + Jakarta Data TCK Runner for Eclipse JNoSQL + + + + + sonatype-nexus-staging + Sonatype Nexus Staging + https://jakarta.oss.sonatype.org/content/repositories/staging/ + + true + + + true + + + + + + ${project.basedir}/target + + + 1.0.0-M4 + 1.6 + 1.7.0.Final + + + + + + + + + jakarta.data + jakarta.data-tck + ${jakarta.data.tck.version} + + + + jakarta.data + jakarta.data-api + ${jakarta.data.api.version} + + + + + org.eclipse.jnosql.databases + jnosql-mongodb + ${project.version} + + + + org.junit.jupiter + junit-jupiter + ${junit.version} + + + org.netbeans.tools + sigtest-maven-plugin + ${sigtest.version} + + + + org.jboss.weld.se + weld-se-core + 5.1.0.Final + test + + + + org.jboss.shrinkwrap + shrinkwrap-api + 1.2.6 + + + org.jboss.arquillian.junit5 + arquillian-junit5-core + ${arquillian.version} + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + + + jakarta.enterprise + jakarta.enterprise.cdi-api + 4.0.0 + + + + org.jboss.arquillian.container + arquillian-weld-embedded + 4.0.0.Final + test + + + + + + data-tck-runner/target + + + maven-dependency-plugin + + + compile + + copy-dependencies + + + + + + maven-surefire-plugin + 3.0.0 + + false + true + jakarta.data:jakarta.data-tck + + true + true + + + logging.properties + ${project.build.directory}/jdk17-bundle + + ${project.build.directory}/dependency/jakarta.data-api-${jakarta.data.api.version}.jar:${project.build.directory}/jdk11-bundle/java.base:${project.build.directory}/jdk11-bundle/java.rmi:${project.build.directory}/jdk11-bundle/java.sql:${project.build.directory}/jdk11-bundle/java.naming + true + + ${included.groups} + standalone + + ${basedir}${file.separarator}src${file.separarator}main${file.separarator}java${file.separarator} + + + + + \ No newline at end of file diff --git a/jnosql-data-tck-runner/src/main/java/ee/jakarta/tck/data/example/extension/MyApplicationArchiveProcessor.java b/jnosql-data-tck-runner/src/main/java/ee/jakarta/tck/data/example/extension/MyApplicationArchiveProcessor.java new file mode 100644 index 00000000..ee1cd5e1 --- /dev/null +++ b/jnosql-data-tck-runner/src/main/java/ee/jakarta/tck/data/example/extension/MyApplicationArchiveProcessor.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 Contributors to the Eclipse Foundation + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Apache License v2.0 which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. + * + * You may elect to redistribute this code under either of these licenses. + * + * Contributors: + * + * Maximillian Arruda + */ +package ee.jakarta.tck.data.example.extension; + +import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; +import org.jboss.arquillian.test.spi.TestClass; +import org.jboss.shrinkwrap.api.Archive; + +//tag::applicationProcessor[] +public class MyApplicationArchiveProcessor implements ApplicationArchiveProcessor { + + //List of test classes that deploy application that you need to customize +// List testClasses; + + @Override + public void process(Archive archive, TestClass testClass) { +// if(testClasses.contains(testClass.getClass().getCanonicalName())){ +// ((WebArchive) archive).addAsWebInfResource("my-custom-sun-web.xml", "sun-web.xml"); +// } + } +} +//end::applicationProcessor[] diff --git a/jnosql-data-tck-runner/src/main/java/ee/jakarta/tck/data/example/extension/MyLoadableExtension.java b/jnosql-data-tck-runner/src/main/java/ee/jakarta/tck/data/example/extension/MyLoadableExtension.java new file mode 100644 index 00000000..914c0210 --- /dev/null +++ b/jnosql-data-tck-runner/src/main/java/ee/jakarta/tck/data/example/extension/MyLoadableExtension.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Contributors to the Eclipse Foundation + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Apache License v2.0 which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. + * + * You may elect to redistribute this code under either of these licenses. + * + * Contributors: + * + * Maximillian Arruda + */ +package ee.jakarta.tck.data.example.extension; + +import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; +import org.jboss.arquillian.core.spi.LoadableExtension; + +//tag::loadableExtension[] +public class MyLoadableExtension implements LoadableExtension { + @Override + public void register(ExtensionBuilder extensionBuilder) { + extensionBuilder.service(ApplicationArchiveProcessor.class, MyApplicationArchiveProcessor.class); + } +} +//end::loadableExtension[] diff --git a/jnosql-data-tck-runner/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/jnosql-data-tck-runner/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 00000000..94f4ca5c --- /dev/null +++ b/jnosql-data-tck-runner/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1 @@ +ee.jakarta.tck.data.example.extension.MyLoadableExtension \ No newline at end of file diff --git a/jnosql-data-tck-runner/src/test/resources/arquillian.xml b/jnosql-data-tck-runner/src/test/resources/arquillian.xml new file mode 100644 index 00000000..deef47f8 --- /dev/null +++ b/jnosql-data-tck-runner/src/test/resources/arquillian.xml @@ -0,0 +1,31 @@ + + + + + + target/ + + + + true + SE + + + \ No newline at end of file diff --git a/jnosql-lite/mapping-lite-processor/src/main/java/org/eclipse/jnosql/lite/mapping/metadata/LiteClassScanner.java b/jnosql-lite/mapping-lite-processor/src/main/java/org/eclipse/jnosql/lite/mapping/metadata/LiteClassScanner.java index 8b59fef7..49ed1f68 100644 --- a/jnosql-lite/mapping-lite-processor/src/main/java/org/eclipse/jnosql/lite/mapping/metadata/LiteClassScanner.java +++ b/jnosql-lite/mapping-lite-processor/src/main/java/org/eclipse/jnosql/lite/mapping/metadata/LiteClassScanner.java @@ -49,4 +49,10 @@ public Set> embeddables() { public Set> repositoriesStandard() { return Collections.emptySet(); } + + @Override + public Set> customRepositories() { + return Collections.emptySet(); + } + }