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

Include Jakarta NoSQL TCK at mongodb databases #277

Draft
wants to merge 2 commits into
base: main
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
22 changes: 22 additions & 0 deletions jnosql-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

<properties>
<monbodb.driver>5.1.0</monbodb.driver>
<jakarta.nosql.version>1.0.0-SNAPSHOT</jakarta.nosql.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -44,6 +45,27 @@
<artifactId>mongodb-driver-sync</artifactId>
<version>${monbodb.driver}</version>
</dependency>
<dependency>
<groupId>jakarta.nosql</groupId>
<artifactId>jakarta.nosql-tck</artifactId>
<version>${jakarta.nosql.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<dependenciesToScan>
<dependency>jakarta.nosql:jakarta.nosql-tck</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.jnosql.databases.mongodb.tck.MongoDBTemplateSupplier
Loading