Skip to content

Commit

Permalink
Fixes #4597 - Add Jakarta Core Profile TCK certification for Piranha …
Browse files Browse the repository at this point in the history
…Core Profile (#4598)
  • Loading branch information
mnriem authored Feb 17, 2025
1 parent 991e56c commit 84afdba
Show file tree
Hide file tree
Showing 9 changed files with 293 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: experimental
on:
push:
branches:
- 'current'
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
build:
Expand Down
30 changes: 26 additions & 4 deletions .github/workflows/tck-coreprofile.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: tck-coreprofile
on:
push:
branches:
- 'current'
schedule:
- cron: "0 0 * * 0"
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
branch:
Expand Down Expand Up @@ -37,6 +34,31 @@ jobs:
with:
paths: "test/tck/coreprofile/annotations/runner/target/failsafe-reports/*IT.xml"
if: always()
coreprofile:
if: ${{ always() }} && github.repository == 'piranhacloud/piranha'
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Run TCK
run: |
mvn -B -DskipTests=true -DskipITs=true -ntp install
cd test/tck/coreprofile/coreprofile
mvn -B -ntp install
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "test/tck/coreprofile/coreprofile/runner/target/failsafe-reports/**/TEST-*.xml"
if: always()
inject:
if: ${{ always() }} && github.repository == 'piranhacloud/piranha'
runs-on: ${{ matrix.os }}
Expand Down
54 changes: 54 additions & 0 deletions test/tck/coreprofile/coreprofile/installer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cloud.piranha.test.tck.coreprofile.coreprofile</groupId>
<artifactId>project</artifactId>
<version>25.3.0-SNAPSHOT</version>
</parent>
<artifactId>installer</artifactId>
<packaging>pom</packaging>
<name>Piranha - Test - TCK - Core Profile - Core Profile TCK - Installer</name>
<properties>
<tck.home>${project.build.directory}/tck</tck.home>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Download, unzip and rename TCK -->
<get src="https://download.eclipse.org/ee4j/jakartaee-tck/jakartaee11/staged/eftl/jakarta-core-profile-tck-${coreprofile.tck.version}.zip"
dest="${project.build.directory}/tck.zip"
skipexisting="true"/>
<unzip src="${project.build.directory}/tck.zip"
dest="${project.build.directory}"/>
<move file="${project.build.directory}/core-profile-tck-${coreprofile.tck.version}"
tofile="${project.build.directory}/tck"/>

<!-- Install the TCK artifacts into local repository -->
<exec dir="${project.build.directory}/tck/artifacts"
executable="mvn">
<arg value="install"/>
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
21 changes: 21 additions & 0 deletions test/tck/coreprofile/coreprofile/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cloud.piranha.test.tck.coreprofile</groupId>
<artifactId>project</artifactId>
<version>25.3.0-SNAPSHOT</version>
</parent>
<groupId>cloud.piranha.test.tck.coreprofile.coreprofile</groupId>
<artifactId>project</artifactId>
<packaging>pom</packaging>
<name>Piranha - Test - TCK - Core Profile - Core Profile TCK - Project</name>
<modules>
<module>installer</module>
<module>runner</module>
</modules>
</project>
125 changes: 125 additions & 0 deletions test/tck/coreprofile/coreprofile/runner/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cloud.piranha.test.tck.coreprofile.coreprofile</groupId>
<artifactId>project</artifactId>
<version>25.3.0-SNAPSHOT</version>
</parent>
<artifactId>runner</artifactId>
<packaging>jar</packaging>
<name>Piranha - Test - TCK - Core Profile - Core Profile TCK - Runner</name>
<properties>
<commons-httpclient.version>3.1</commons-httpclient.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian.version}</version>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>cloud.piranha.test.tck.coreprofile.coreprofile</groupId>
<artifactId>installer</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<!--
The actual TCK jar containing the tests
-->
<dependency>
<groupId>jakarta.tck.coreprofile</groupId>
<artifactId>core-profile-tck-impl</artifactId>
<version>${coreprofile.tck.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.omnifaces.arquillian</groupId>
<artifactId>glassfish-client-ee11</artifactId>
<version>${glassfish-client-ee11.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>${commons-httpclient.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
<!--
The Arquillian connector that starts Piranha and deploys archives
to it.
-->
<dependency>
<groupId>cloud.piranha.arquillian</groupId>
<artifactId>piranha-arquillian-managed</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>verify</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<dependenciesToScan>
<dependency>jakarta.tck.coreprofile:core-profile-tck-impl</dependency>
</dependenciesToScan>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package cloud.piranha.tck.core;

import org.jboss.arquillian.container.spi.event.container.BeforeDeploy;
import org.jboss.arquillian.core.api.annotation.Observes;
import org.jboss.arquillian.core.spi.LoadableExtension;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;

public class CustomJsonbSerializationITFix implements LoadableExtension {

@Override
public void register(ExtensionBuilder builder) {
builder.observer(CustomJsonbSerializationITFix.class);
}

public void removeService(@Observes BeforeDeploy event) {
Archive<?> archive = event.getDeployment().getArchive();
if (archive instanceof WebArchive webArchive) {
if (webArchive.getName().equals("CustomJsonbSerializationIT.war")) {
webArchive.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cloud.piranha.tck.core.CustomJsonbSerializationITFix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<arquillian
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<defaultProtocol type="Servlet 5.0" />
<container qualifier="piranha" default="true"/>
</arquillian>
2 changes: 2 additions & 0 deletions test/tck/coreprofile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<properties>
<!-- TCK versions -->
<annotations.tck.version>3.0.0</annotations.tck.version>
<coreprofile.tck.version>11.0.0</coreprofile.tck.version>
<inject.tck.version>2.0.2</inject.tck.version>
<jsonb.tck.version>3.0.0</jsonb.tck.version>
<jsonp.tck.version>2.1.1</jsonp.tck.version>
Expand All @@ -41,6 +42,7 @@
</dependencyManagement>
<modules>
<module>annotations</module>
<module>coreprofile</module>
<module>inject</module>
<module>jsonb</module>
<module>jsonp</module>
Expand Down

0 comments on commit 84afdba

Please sign in to comment.