Skip to content

Commit

Permalink
Merge pull request #126 from KyleAure/extend-tck-using-weld
Browse files Browse the repository at this point in the history
Use weld-junit5 as CDI container
  • Loading branch information
otaviojava authored Jun 4, 2024
2 parents cae83e2 + 0e5bbb4 commit b06bdca
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 107 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/tck-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
schedule:
- cron: '0 0 * * 1,3,5' #Monday, Wednesday, Friday at Midnight

#TODO update to run on pull request/merge
#on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -18,4 +25,5 @@ jobs:
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
# TODO start and stop mongo container
run: mvn test --file jnosql-data-tck-runner/pom.xml -Djnosql.document.database=mongodb -Djnosql.mongodb.host=localhost:27017
4 changes: 2 additions & 2 deletions jnosql-data-tck-runner/logging.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ handlers=java.util.logging.FileHandler,java.util.logging.ConsoleHandler
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
org.jboss.level=ALL
org.eclipse.jnosql.level=ALL

#Formatting for the simple formatter
java.util.logging.SimpleFormatter.class.log=true
Expand Down
20 changes: 9 additions & 11 deletions jnosql-data-tck-runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@
<junit.version>5.10.2</junit.version>
<shrinkwrap.version>1.2.6</shrinkwrap.version>
<sigtest.version>2.3</sigtest.version>
<weld.junit5.version>4.0.3.Final</weld.junit5.version>

<!-- Pointer to logging.properties file that has the java.util.logging
configuration -->
<logging.config>${project.basedir}/logging.properties</logging.config>
<org.jboss.logging.provider>jdk</org.jboss.logging.provider>

<!-- TCK settings -->
<included.groups><![CDATA[standalone & nosql]]></included.groups>
Expand Down Expand Up @@ -109,13 +111,12 @@
<artifactId>sigtest-maven-plugin</artifactId>
<version>${sigtest.version}</version>
</dependency>
<!-- CDI for resource injection -->
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>5.1.0.Final</version>
<scope>test</scope>
</dependency>
<!-- CDI for resource injection - managed by Junit -->
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-junit5</artifactId>
<version>${weld.junit5.version}</version>
</dependency>
<!-- APIs referenced by TCK that do not require implementations for standalone tests -->
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
Expand All @@ -141,7 +142,7 @@
</dependencies>

<build>
<directory>data-tck-runner/target</directory>
<directory>${targetDirectory}</directory>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -160,7 +161,6 @@
<configuration>
<trimStackTrace>false</trimStackTrace>
<failIfNoTests>true</failIfNoTests>
<dependenciesToScan>jakarta.data:jakarta.data-tck</dependenciesToScan>
<statelessTestsetReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
Expand All @@ -176,8 +176,6 @@
</systemPropertyVariables>
<groups>${included.groups}</groups>
<reportNameSuffix>standalone</reportNameSuffix>
<testSourceDirectory>
${basedir}${file.separarator}src${file.separarator}main${file.separarator}java${file.separarator}</testSourceDirectory>
</configuration>
</plugin>
</plugins>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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:
*
* Kyle Aure
*/
package org.eclipse.jnosql.tck;

import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.core.Converters;
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
import org.eclipse.jnosql.mapping.document.DocumentTemplateProducer;
import org.eclipse.jnosql.mapping.document.spi.DocumentExtension;
import org.eclipse.jnosql.mapping.reflection.Reflections;
import org.eclipse.jnosql.mapping.semistructured.EntityConverter;
import org.jboss.weld.junit5.auto.AddExtensions;
import org.jboss.weld.junit5.auto.AddPackages;
import org.jboss.weld.junit5.auto.EnableAutoWeld;

import ee.jakarta.tck.data.standalone.entity.EntityTests;

@EnableAutoWeld
@AddPackages(value = {Converters.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(DocumentTemplateProducer.class)
@AddPackages(Reflections.class)
@AddExtensions({EntityMetadataExtension.class, DocumentExtension.class})
public class MyEntityTests extends EntityTests {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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:
*
* Kyle Aure
*/
package org.eclipse.jnosql.tck;

import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.core.Converters;
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
import org.eclipse.jnosql.mapping.document.DocumentTemplateProducer;
import org.eclipse.jnosql.mapping.document.spi.DocumentExtension;
import org.eclipse.jnosql.mapping.reflection.Reflections;
import org.eclipse.jnosql.mapping.semistructured.EntityConverter;
import org.jboss.weld.junit5.auto.AddExtensions;
import org.jboss.weld.junit5.auto.AddPackages;
import org.jboss.weld.junit5.auto.EnableAutoWeld;

import ee.jakarta.tck.data.standalone.nosql.example.NoSQLEntityTests;

@EnableAutoWeld
@AddPackages(value = {Converters.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(DocumentTemplateProducer.class)
@AddPackages(Reflections.class)
@AddExtensions({EntityMetadataExtension.class, DocumentExtension.class})
public class MyNoSQLEntityTests extends NoSQLEntityTests {
}
31 changes: 0 additions & 31 deletions jnosql-data-tck-runner/src/test/resources/arquillian.xml

This file was deleted.

0 comments on commit b06bdca

Please sign in to comment.