Skip to content

Commit

Permalink
Merge pull request #186 from jamezp/ee11-core-profile
Browse files Browse the repository at this point in the history
Migrate the core-tck-runner for Jakarta EE 11 Core Profile.
  • Loading branch information
jamezp authored Oct 22, 2024
2 parents 732f9dd + e611b6e commit 325f2c2
Show file tree
Hide file tree
Showing 14 changed files with 469 additions and 355 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/core-profile-tck-ee11-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Jakarta EE 11 Core Profile with WildFly - Manual

on:
workflow_dispatch:
inputs:
wildfly-version:
description: WildFly Version
required: true
type: string
java-version:
description: Java Version
required: true
default: 17
type: string

# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
coreprofile-tck-manual:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Runner steps
steps:
- uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven Java ${{ inputs.java-version }} on WildFly
run: |
cd core-profile
mvn -B -V clean verify -Dversion.org.wildfly=${{ inputs.wildfly-version }} -fae -Pstaging
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports-${{ inputs.java-version }}
path: |
'**/surefire-reports/'
'**/failsafe-reports/'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow that is manually triggered

name: Jakarta EE Core Profile with WildFly
name: Jakarta EE 11 Core Profile with WildFly

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
Expand Down Expand Up @@ -38,8 +38,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: ['11', '17', '21']
java: ['17', '21']

# Runner steps
steps:
Expand Down
28 changes: 19 additions & 9 deletions core-profile/cdi-langmodel-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-lang-model</artifactId>
<version>${cdi.tck.version}</version>
<version>${version.jakarta.cdi.tck}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -63,7 +63,7 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-test-common</artifactId>
<version>${weld.version}</version>
<version>${version.org.jboss.weld}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -83,15 +83,13 @@
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>${version.org.jboss.arquillian}</version>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<scope>test</scope>
</dependency>

Expand All @@ -108,19 +106,24 @@
<goal>run</goal>
</goals>
<configuration>
<!-- Export the properties defined below so they can be used for the signature tests -->
<!-- Export the properties defined below so they can be used on the test class path -->
<exportAntProperties>true</exportAntProperties>
<target>
<fileset id="jakarta-api-jars"
dir="${jboss.home}${file.separator}modules/system/layers/base/jakarta/">
<!-- Jakarta API's needed on the test class path -->
<include name="**/annotation/api/main/*.jar"/>
<include name="**/enterprise/api/main/*.jar"/>
<include name="**/inject/api/main/*.jar"/>
<include name="**/interceptor/api/main/*.jar"/>
<!-- Required for the Weld Arquillian Container -->
<include name="**/el/api/main/*.jar"/>
<include name="**/ejb/api/main/*.jar"/>
</fileset>
<pathconvert pathsep="," property="jakarta.api.jars" refid="jakarta-api-jars"/>
<fileset id="weld-jars"
dir="${jboss.home}${file.separator}modules/system/layers/base/org/jboss/">
<!-- Implementations are required on the test class path -->
<include name="**/classfilewriter/main/*.jar"/>
<include name="**/logging/main/*.jar"/>
<include name="**/weld/**/weld*.jar"/>
Expand Down Expand Up @@ -157,13 +160,20 @@
</goals>
<configuration>
<skip>false</skip>
<!-- Include the libraries from the server on the test class path -->
<additionalClasspathElements>
<additionalClasspathElement>${weld.jars}</additionalClasspathElement>
<additionalClasspathElement>${jakarta.api.jars}</additionalClasspathElement>
</additionalClasspathElements>
<!-- Exclude transitive dependencies from the class we provide on the class path above from
the server.
-->
<classpathDependencyExcludes>
<exclude>jakarta.enterprise:jakarta.enterprise.cdi-api</exclude>
<exclude>jakarta.enterprise:jakarta.enterprise.lang-model</exclude>
<exclude>jakarta.ejb:*</exclude>
<exclude>jakarta.el:*</exclude>
<exclude>org.glassfish:*</exclude>
</classpathDependencyExcludes>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

import jakarta.enterprise.inject.build.compatible.spi.BuildCompatibleExtension;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit5.ArquillianExtension;
import org.jboss.cdi.lang.model.tck.LangModelVerifier;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.BeanDiscoveryMode;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.impl.BeansXml;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

/**
* <p>
Expand All @@ -33,7 +33,7 @@
* Actual test happens inside {@link LangModelExtension} by calling {@link LangModelVerifier#verify(ClassInfo)}.
* </p>
*/
@RunWith(Arquillian.class)
@ExtendWith(ArquillianExtension.class)
public class LangModelTckTest {

@Deployment
Expand All @@ -49,7 +49,7 @@ public static Archive<?> deploy() {
@Test
public void testLangModel() {
// test is executed in LangModelExtension; here we just assert that the relevant extension method was invoked
Assert.assertTrue(LangModelExtension.ENHANCEMENT_INVOKED == 1);
Assertions.assertEquals(1, LangModelExtension.ENHANCEMENT_INVOKED);
}
}

58 changes: 36 additions & 22 deletions core-profile/cdi-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<name>WildFly Jakarta CDI TCK Runner</name>

<properties>
<testng.version>7.4.0</testng.version>
<testng.version>7.9.0</testng.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -54,7 +54,7 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-core-impl</artifactId>
<version>${cdi.tck.version}</version>
<version>${version.jakarta.cdi.tck}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -90,9 +90,9 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-core-impl</artifactId>
<version>${cdi.tck.version}</version>
<version>${version.jakarta.cdi.tck}</version>
<type>sig</type>
<classifier>sigtest-jdk11</classifier>
<classifier>sigtest-jdk17</classifier>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -108,7 +108,7 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-porting-package-tck</artifactId>
<version>${weld.version}</version>
<version>${version.org.jboss.weld}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -128,23 +128,23 @@
<dependency>
<groupId>jakarta.ee.tck.coreprofile</groupId>
<artifactId>cdi-lite-tck-suite</artifactId>
<version>${core.profile.tck.version}</version>
<version>${version.jakarta.platform.core.profile.tck.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.ee.tck.coreprofile</groupId>
<artifactId>cdi-lite-tck-suite</artifactId>
<type>xml</type>
<version>${core.profile.tck.version}</version>
<version>${version.jakarta.platform.core.profile.tck.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>jakarta.ee.tck.coreprofile</groupId>
<artifactId>common-annotations</artifactId>
<version>${core.profile.tck.version}</version>
<version>${version.jakarta.platform.core.profile.tck.version}</version>
<type>sig</type>
<classifier>sigtest-jdk11</classifier>
<classifier>${core.profile.sigtest.classifier}</classifier>
<scope>test</scope>
</dependency>

Expand All @@ -162,7 +162,6 @@
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet-jakarta</artifactId>
<version>${version.org.jboss.arquillian}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -220,7 +219,7 @@
<includeGroupIds>jakarta.enterprise</includeGroupIds>
<includeArtifactIds>cdi-tck-core-impl</includeArtifactIds>
<type>sig</type>
<classifier>sigtest-jdk11</classifier>
<classifier>sigtest-jdk17</classifier>
<stripVersion>true</stripVersion>
<overWriteReleases>true</overWriteReleases>
<outputDirectory>${project.build.directory}/sigtest</outputDirectory>
Expand All @@ -237,7 +236,7 @@
<includeGroupIds>jakarta.ee.tck.coreprofile</includeGroupIds>
<includeArtifactIds>common-annotations</includeArtifactIds>
<type>sig</type>
<classifier>sigtest-jdk11</classifier>
<classifier>${core.profile.sigtest.classifier}</classifier>
<stripVersion>true</stripVersion>
<overWriteReleases>true</overWriteReleases>
<outputDirectory>${project.build.directory}/sigtest</outputDirectory>
Expand Down Expand Up @@ -269,8 +268,9 @@
</unzip>
<fileset id="jakarta-api-jars"
dir="${jboss.home}${file.separator}modules/system/layers/base/jakarta/">
<!-- Jakarta API's needed on the test class path -->
<include name="**/annotation/api/main/*.jar"/>
<include name="**/el/main/*.jar"/>
<include name="**/el/api/main/*.jar"/>
<include name="**/enterprise/api/main/*.jar"/>
<include name="**/inject/api/main/*.jar"/>
<include name="**/interceptor/api/main/*.jar"/>
Expand All @@ -279,6 +279,7 @@
property="jakarta.api.jars" refid="jakarta-api-jars"/>
<fileset id="weld-jars"
dir="${jboss.home}${file.separator}modules/system/layers/base/org//">
<!-- Implementations are required on the test class path -->
<include name="**/jboss/weld/**/weld*.jar"/>
<!-- Required by Weld -->
<include name="**/jboss/classfilewriter/main/*.jar"/>
Expand All @@ -291,6 +292,20 @@
</target>
</configuration>
</execution>
<execution>
<id>echo</id>
<phase>process-test-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="sigtest.classpath=${sigtest.classpath}"/>
<echo message="jakarta.api.jars=${jakarta.api.jars}"/>
<echo message="impl.jars=${impl.jars}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>

Expand All @@ -313,7 +328,6 @@
<value>false</value>
</property>
</properties>
<forkMode>once</forkMode>
<dependenciesToScan>
<dependency>jakarta.enterprise:cdi-tck-core-impl</dependency>
</dependenciesToScan>
Expand Down Expand Up @@ -353,28 +367,28 @@
</goals>
<configuration>
<additionalClasspathElements>
<!-- Include the libraries from the server on the test class path -->
<additionalClasspathElement>${weld.jars}</additionalClasspathElement>
<additionalClasspathElement>${jakarta.api.jars}</additionalClasspathElement>
</additionalClasspathElements>
<!-- Exclude transitive dependencies from the class we provide on the class path above from
the server.
-->
<classpathDependencyExcludes>
<exclude>jakarta.annotation:jakarta.annotation-api</exclude>
<exclude>jakarta.enterprise:jakarta.enterprise.cdi-api</exclude>
<exclude>jakarta.inject:jakarta.inject-api</exclude>
<exclude>jakarta.interceptor:jakarta.interceptor-api</exclude>
<exclude>org.jboss.spec.javax.servlet:*</exclude>
</classpathDependencyExcludes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.netbeans.tools</groupId>
<groupId>jakarta.tck</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<!-- Avoids an NPE fixed upstream -->
<ignoreJDKClasses/>
</configuration>
<executions>
<execution>
<id>sigtest</id>
Expand All @@ -383,7 +397,7 @@
<goal>check</goal>
</goals>
<configuration>
<sigfile>${project.build.directory}/sigtest/cdi-tck-core-impl-sigtest-jdk11.sig</sigfile>
<sigfile>${project.build.directory}/sigtest/cdi-tck-core-impl-sigtest-jdk17.sig</sigfile>
<packages>jakarta.decorator,jakarta.enterprise,jakarta.interceptor</packages>
<classes>${project.build.directory}/sig-classes/</classes>
<report>${project.build.directory}/cdi-sig-report.txt</report>
Expand All @@ -396,7 +410,7 @@
<goal>check</goal>
</goals>
<configuration>
<sigfile>${project.build.directory}/sigtest/common-annotations-sigtest-jdk11.sig</sigfile>
<sigfile>${project.build.directory}/sigtest/common-annotations-${core.profile.sigtest.classifier}.sig</sigfile>
<packages>jakarta.annotation</packages>
<classes>${project.build.directory}/sig-classes/</classes>
<report>${project.build.directory}/ca-sig-report.txt</report>
Expand Down
Loading

0 comments on commit 325f2c2

Please sign in to comment.