Skip to content

Commit

Permalink
[JBEAP-22930] Mojarra -- test branch used for EAP 7.4 using SE 17
Browse files Browse the repository at this point in the history
Modify version in POM to add support for Java 17
Minor test update to work around minor data change in testing
Add GH Action workflow
  • Loading branch information
jasondlee committed Mar 28, 2024
1 parent aa9f9a0 commit 802ef2b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 33 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/test-2.3.14.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Test Mojarra 2.3.14.SP

on:
workflow_dispatch:
branches:
- 2.3.14.SP
push:
branches:
- 2.3.14.SP
pull_request:
branches:
- 2.3.14.SP

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
java-version: [ 8, 17, 21 ]

steps:
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
cache: 'maven'

- name: Restore cached Maven packages
id: cache-maven-packages
uses: actions/cache/restore@v3
with:
path: |
~/.m2
~/.local/share/containers
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

- name: Clean and build
run: mvn -B -fae clean package -Dgithub=true

- name: Cache Maven packages
uses: actions/cache/save@v3
with:
path: |
~/.m2
~/.local/share/containers
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
16 changes: 8 additions & 8 deletions impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,32 +168,32 @@
<version>2.2.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymockclassextension</artifactId>
<version>3.1</version>
<artifactId>easymock</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>1.4.11</version>
<version>2.0.9</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.4.11</version>
<version>2.0.9</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
<version>1.9.4</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -302,7 +302,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.0.0</version>
<version>5.1.9</version>
<extensions>true</extensions>
<executions>
<execution>
Expand Down
4 changes: 3 additions & 1 deletion impl/src/test/java/com/sun/faces/mock/MockResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@ public Object getObject(String columnName) throws SQLException {
if (columnName.equals("writeOnlyProperty")
&& (beans[row - 1] instanceof BeanTestImpl)) {
return (((BeanTestImpl) beans[row - 1]).getWriteOnlyPropertyValue());
} else {
} else if (!columnName.equals("class")) {
return (PropertyUtils.getSimpleProperty(beans[row - 1],
columnName));
} else {
return null;
}
} catch (Exception e) {
throw new SQLException(e.getMessage());
Expand Down
55 changes: 31 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,6 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-java-version</id>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
<configuration>
<rules>
<!-- JDK 1.8 is required to build Mojarra 2.3.x. -->
<requireJavaVersion>
<message>
To build this project, JDK 1.8 is required. Please install it.
</message>
<version>[1.8,1.9)</version>
</requireJavaVersion>
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down Expand Up @@ -168,5 +145,35 @@
</plugins>
</pluginManagement>
</build>


<profiles>
<profile>
<id>java-modules</id>
<activation>
<jdk>[9,]</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<argLine>
--add-opens=java.base/java.lang=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

0 comments on commit 802ef2b

Please sign in to comment.