Skip to content

Commit 9f813db

Browse files
committed
feat: include mongodb configuration to run tests
Signed-off-by: Otavio Santana <[email protected]>
1 parent 170c87b commit 9f813db

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* and Apache License v2.0 which accompanies this distribution.
6+
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7+
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
8+
*
9+
* You may elect to redistribute this code under either of these licenses.
10+
*
11+
* Contributors:
12+
*
13+
* Otavio Santana
14+
* Alessandro Moscatelli
15+
*/
16+
package org.eclipse.jnosql.databases.mongodb.tck;
17+
18+
import jakarta.enterprise.inject.se.SeContainer;
19+
import jakarta.enterprise.inject.se.SeContainerInitializer;
20+
import jakarta.nosql.Template;
21+
import jakarta.nosql.tck.TemplateSupplier;
22+
import org.eclipse.jnosql.databases.mongodb.communication.MongoDBDocumentConfigurations;
23+
import org.eclipse.jnosql.mapping.core.config.MappingConfigurations;
24+
25+
import static org.eclipse.jnosql.databases.mongodb.communication.DocumentDatabase.INSTANCE;
26+
27+
public class MongoDBTemplateSupplier implements TemplateSupplier {
28+
29+
static {
30+
INSTANCE.get("jakarta-nosql-tck");
31+
System.setProperty(MongoDBDocumentConfigurations.HOST.get() + ".1", INSTANCE.host());
32+
System.setProperty(MappingConfigurations.DOCUMENT_DATABASE.get(), "jakarta-nosql-tck");
33+
}
34+
35+
@Override
36+
public Template get() {
37+
SeContainer container = SeContainerInitializer.newInstance().initialize();
38+
return container.select(Template.class).get();
39+
}
40+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.eclipse.jnosql.databases.mongodb.tck.MongoDBTemplateSupplier

0 commit comments

Comments
 (0)