From 170c87bf0d9a8220a2a293a199275a281438e7ec Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Sun, 2 Jun 2024 18:03:01 +0100 Subject: [PATCH 1/2] chore: include mongodb tck driver Signed-off-by: Otavio Santana --- jnosql-mongodb/pom.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/jnosql-mongodb/pom.xml b/jnosql-mongodb/pom.xml index f690e761d..9805eda80 100644 --- a/jnosql-mongodb/pom.xml +++ b/jnosql-mongodb/pom.xml @@ -28,6 +28,7 @@ 5.1.0 + 1.0.0-SNAPSHOT @@ -44,6 +45,27 @@ mongodb-driver-sync ${monbodb.driver} + + jakarta.nosql + jakarta.nosql-tck + ${jakarta.nosql.version} + test + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql:jakarta.nosql-tck + + + + + + From 9f813db17ebb677f0577e63c217dd947629054df Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Sun, 2 Jun 2024 18:07:54 +0100 Subject: [PATCH 2/2] feat: include mongodb configuration to run tests Signed-off-by: Otavio Santana --- .../mongodb/tck/MongoDBTemplateSupplier.java | 40 +++++++++++++++++++ .../jakarta.nosql.tck.TemplateSupplier | 1 + 2 files changed, 41 insertions(+) create mode 100644 jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/tck/MongoDBTemplateSupplier.java create mode 100644 jnosql-mongodb/src/test/resources/META-INF/services/jakarta.nosql.tck.TemplateSupplier diff --git a/jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/tck/MongoDBTemplateSupplier.java b/jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/tck/MongoDBTemplateSupplier.java new file mode 100644 index 000000000..133ae050c --- /dev/null +++ b/jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/tck/MongoDBTemplateSupplier.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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: + * + * Otavio Santana + * Alessandro Moscatelli + */ +package org.eclipse.jnosql.databases.mongodb.tck; + +import jakarta.enterprise.inject.se.SeContainer; +import jakarta.enterprise.inject.se.SeContainerInitializer; +import jakarta.nosql.Template; +import jakarta.nosql.tck.TemplateSupplier; +import org.eclipse.jnosql.databases.mongodb.communication.MongoDBDocumentConfigurations; +import org.eclipse.jnosql.mapping.core.config.MappingConfigurations; + +import static org.eclipse.jnosql.databases.mongodb.communication.DocumentDatabase.INSTANCE; + +public class MongoDBTemplateSupplier implements TemplateSupplier { + + static { + INSTANCE.get("jakarta-nosql-tck"); + System.setProperty(MongoDBDocumentConfigurations.HOST.get() + ".1", INSTANCE.host()); + System.setProperty(MappingConfigurations.DOCUMENT_DATABASE.get(), "jakarta-nosql-tck"); + } + + @Override + public Template get() { + SeContainer container = SeContainerInitializer.newInstance().initialize(); + return container.select(Template.class).get(); + } +} diff --git a/jnosql-mongodb/src/test/resources/META-INF/services/jakarta.nosql.tck.TemplateSupplier b/jnosql-mongodb/src/test/resources/META-INF/services/jakarta.nosql.tck.TemplateSupplier new file mode 100644 index 000000000..e9974f729 --- /dev/null +++ b/jnosql-mongodb/src/test/resources/META-INF/services/jakarta.nosql.tck.TemplateSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.databases.mongodb.tck.MongoDBTemplateSupplier \ No newline at end of file