Skip to content

Commit

Permalink
Fixes #4033 - Add Inject TCK for Piranha Web Profile (#4034)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Sep 28, 2024
1 parent 71451ee commit 63b448b
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/tck-webprofile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ on:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
atinject:
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: Setup for TCK
run: mvn -B -DskipTests=true -ntp install
- name: Run TCK
run: |
cd external/webprofile-tck/atinject
mvn -B -ntp verify
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "external/webprofile-tck/atinject/target/tck/example/target/surefire-reports/TEST-*.xml"
if: always()
jsonb:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
93 changes: 93 additions & 0 deletions external/webprofile-tck/atinject/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?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.external.webprofiletck</groupId>
<artifactId>project</artifactId>
<version>24.10.0-SNAPSHOT</version>
</parent>

<artifactId>inject-tck</artifactId>
<packaging>pom</packaging>

<name>Piranha Web Profile - Inject TCK</name>

<properties>
<tck.home>${project.build.directory}/tck</tck.home>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>cloud.piranha</groupId>
<artifactId>bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Executing UNIX profile</echo>

<!-- Download, unzip and rename TCK -->
<get src="https://download.eclipse.org/jakartaee/dependency-injection/2.0/jakarta.inject-tck-${inject.tck.version}-bin.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}/jakarta.inject-tck-${inject.tck.version}"
tofile="${project.build.directory}/tck"/>

<!-- Install the TCK into local Maven repository -->
<exec executable="mvn">
<arg value="install:install-file"/>
<arg value="-Dfile=${project.build.directory}/tck/jakarta.inject-tck-${inject.tck.version}.jar"/>
</exec>

<!-- Setup example/pom.xml for correct Weld version -->
<replaceregexp file="${tck.home}/example/pom.xml"
match="&lt;weld.version>(.*)&lt;/weld.version>"
replace="&lt;weld.version>${weld.version}&lt;/weld.version>"
byline="true"/>
</target>
</configuration>
</execution>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Run the tests -->
<exec dir="${project.build.directory}/tck/example"
executable="mvn"
failonerror="true">
<arg value="verify"/>
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 4 additions & 0 deletions external/webprofile-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
<artifactId>project</artifactId>
<packaging>pom</packaging>
<name>Piranha - External - Web Profile TCK - Project</name>
<properties>
<inject.tck.version>2.0.2</inject.tck.version>
</properties>
<modules>
<module>atinject</module>
<module>jsonb</module>
<module>jsonp</module>
</modules>
Expand Down

0 comments on commit 63b448b

Please sign in to comment.