Skip to content

Auto-skip CSP-backport-incompatible ITs for Mojarra 4.0.17+ / 4.1.8+#2153

Merged
BalusC merged 2 commits into
masterfrom
autoskip_specific_tck_tests_for_mojarra_4.1_csp_backport
Apr 30, 2026
Merged

Auto-skip CSP-backport-incompatible ITs for Mojarra 4.0.17+ / 4.1.8+#2153
BalusC merged 2 commits into
masterfrom
autoskip_specific_tck_tests_for_mojarra_4.1_csp_backport

Conversation

@BalusC
Copy link
Copy Markdown
Member

@BalusC BalusC commented Apr 28, 2026

The CSP backport (eclipse-ee4j/mojarra#5606 for Mojarra 4.0.17 and 4.1.8) replaces inline event-handler attributes (onclick/onchange/onfocus/...) with trailing <script>mojarra.ael(...)</script> listeners. A handful of HtmlUnit-based 4.0 ITs assert against those now-empty inline attributes and can't be edited:

  • Issue2439IT (faces22/ajax) — reads input.onchange
  • Issue2674IT (faces22/ajax) — reads input.onfocus
  • Issue4331IT, Spec1238IT (faces23/searchExpression) — read input.onchange

To avoid hand-passing -Dit.test=... on every run, parse mojarra.version in the validate phase via gmavenplus-plugin and, only when the version falls in 4.0.17+ or 4.1.8+, populate it.test with the exclusion pattern and set failsafe.failIfNoSpecifiedTests=false. Anything else (older Mojarra, 4.2.x, 5.x, or a non-Mojarra impl overriding mojarra.version) runs unfiltered. A user-supplied -Dit.test=... still wins.

Lives only inside the glassfish-ci-managed profile, so MyFaces/Tomcat/Payara runs are untouched.


cc: @jasondlee

Same PR for 4.0 here: #2152

The CSP backport (Mojarra 4.0.17 and 4.1.8) replaces inline
event-handler attributes (onclick/onchange/onfocus/...) with trailing
<script>mojarra.ael(...)</script> listeners. A handful of HtmlUnit-based
4.0 ITs assert against those now-empty inline attributes and can't be
edited:

- Issue2439IT (faces22/ajax) — reads input.onchange
- Issue2674IT (faces22/ajax) — reads input.onfocus
- Issue4331IT, Spec1238IT (faces23/searchExpression) — read
input.onchange

To avoid hand-passing -Dit.test=... on every run, parse mojarra.version
in the validate phase via gmavenplus-plugin and, only when the version
falls in 4.0.17+ or 4.1.8+, populate it.test with the exclusion pattern
and set failsafe.failIfNoSpecifiedTests=false. Anything else (older
Mojarra, 4.2.x, 5.x, or a non-Mojarra impl overriding mojarra.version)
runs unfiltered. A user-supplied -Dit.test=... still wins.

Lives only inside the glassfish-ci-managed profile, so
MyFaces/Tomcat/Payara runs are untouched.
@BalusC BalusC merged commit 33702ae into master Apr 30, 2026
1 check passed
@BalusC BalusC deleted the autoskip_specific_tck_tests_for_mojarra_4.1_csp_backport branch April 30, 2026 12:14
@dmatej
Copy link
Copy Markdown
Contributor

dmatej commented May 4, 2026

Aha, seems we were hit by this right now:

<pre>java.lang.NullPointerException: Cannot invoke &quot;String.isEmpty()&quot; because the return value of &quot;org.openqa.selenium.WebElement.getAttribute(String)&quot; is null
	at ee.jakarta.tck.faces.test.servlet30.ajax_selenium.Issue2674IT.testProgrammaticAjaxBehavior(Issue2674IT.java:38)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)

So just for the record how the failure looks like :-)
The change I made in GlassFish which probably caused the only failure:

-        <mojarra.version>4.1.7</mojarra.version>
+        <mojarra.version>4.1.8</mojarra.version>

@BalusC
Copy link
Copy Markdown
Member Author

BalusC commented May 4, 2026

Or use 4.1.9 instead. See also eclipse-ee4j/mojarra#5723

@dmatej
Copy link
Copy Markdown
Contributor

dmatej commented May 4, 2026

Or use 4.1.9 instead. See also eclipse-ee4j/mojarra#5723

Oh, wow, right on time! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants