arquillian / arquillian-extension-warp

Arquillian Warp fills the void between client-side and server-side testing. Write client-side tests which assert server-side logic.
https://arquillian.org/arquillian-extension-warp/
Apache License 2.0
14 stars 31 forks source link

Restore TomEE support in test suite #242

Open WolfgangHG opened 2 days ago

WolfgangHG commented 2 days ago

@rhusar I struggled a bit with TomEE.

Version 9.1 supports only JakartaEE 9.1 (https://tomee.apache.org/comparison.html) There is at least one test that fails (org.jboss.arquillian.warp.jsf.ftest.redirection.TestJsfRedirect), because the jsf pages fail on TomEE 9 with the current JakartaEE 10 namespaces and work only with the JakartaEE 9 namespaces (xmlns:ui="http://xmlns.jcp.org/jsf/facelets" instead of xmlns:ui="jakarta.faces.facelets"). And this would break WildFly and JakartaEE 10.

So we would have to switch to version 10.0, which is still in development (currently: M2) and supports JakartaEE 10. But it requires Java 17.

This is only a matter of the test suite, arquillian-extension-warp could probably be built with Java 11. But we would have to run the "tomee-managed" profile with Java 17. Would this be possible with Github CI and would this be OK for you?

In the moment I observe a HTMLUnit javascript parse error in org.jboss.arquillian.warp.jsf.ftest.producer.TestJSFTestEnrichers - might be caused by the fact that TomEE uses MyFaces, while WildFly used Mojarra. Will have to dig further...

rhusar commented 2 days ago

@rhusar I struggled a bit with TomEE.

:(

Version 9.1 supports only JakartaEE 9.1 (https://tomee.apache.org/comparison.html) There is at least one test that fails (org.jboss.arquillian.warp.jsf.ftest.redirection.TestJsfRedirect), because the jsf pages fail on TomEE 9 with the current JakartaEE 10 namespaces and work only with the JakartaEE 9 namespaces (xmlns:ui="http://xmlns.jcp.org/jsf/facelets" instead of xmlns:ui="jakarta.faces.facelets"). And this would break WildFly and JakartaEE 10.

Uh, Jakarta EE 9 is not exactly useful and not worth supporting here at this point in time.

So we would have to switch to version 10.0, which is still in development (currently: M2) and supports JakartaEE 10. But it requires Java 17.

M2 release is fine with me and also JDK 17 is fine.

This is only a matter of the test suite, arquillian-extension-warp could probably be built with Java 11. But we would have to run the "tomee-managed" profile with Java 17. Would this be possible with Github CI and would this be OK for you?

Yes - that's not a problem at all - we would just exclude that one from the matrix (11 and tomee-managed).

In the moment I observe a HTMLUnit javascript parse error in org.jboss.arquillian.warp.jsf.ftest.producer.TestJSFTestEnrichers - might be caused by the fact that TomEE uses MyFaces, while WildFly used Mojarra. Will have to dig further...

No idea there yet, but I see how this might be causing an issue. Can be conditionally ignore if needs be.

🔨 🔨 🔨

WolfgangHG commented 2 days ago

OK! Will stop for now and continue the next few days...

WolfgangHG commented 17 hours ago

I added a "maven-enforcer-plugin" rule to the "tomee-managed" profile to ensure Java 17.

About the changes: Change 1: the test "TestFacesLifecycleFailurePropagation" required some workarounds (https://github.com/arquillian/arquillian-extension-warp/pull/108#issuecomment-1475388798) because a ServletException was deserialized from TomEE, and the ServletException class on the client side declared a different SerialVersionUID than the class on the server side. Those workarounds got worse with 10.0: the dependency "org.apache.tomcat:tomcat-servlet-api" must be declared before "org.apache.tomee:arquillian-tomee-remote", because the latter brings "org.apache.tomee:jakartaee-api", which also contains a "ServletException", but with a different SerialVersionUID. Thus the "InvalidClassException" would occur. If we declare the servlet api jar before the arquillian jar, the ServletException class is loaded from there. Just for the records: https://issues.apache.org/jira/browse/TOMEE-4418 (but not fixable on the TomEE side)

Change 2: updated several deployment descriptors and Faces pages to the JakartaEE 10 versions/namespaces.

Problem: most of the "jsf-ftest" tests will not run. The reason is a java script parse error in HtmlUnit: https://github.com/HtmlUnit/htmlunit/issues/883 This happens for TomEE, because it bundles MyFaces, while WildFly has Mojarra. As long as this is not fixed, we cannot enable the TomEE profile in CI.

WolfgangHG commented 16 hours ago

Six test that would fail because of the HtmlUnit javascript parse error were excluded with this code snippet:

    @BeforeClass
    public static void beforeClass() throws IOException, InterruptedException {
       String tomEEHome = (String) System.getProperty("tomee.home");
       Assume.assumeTrue(tomEEHome == null || tomEEHome.length() == 0);
    }

This has to be reverted if the HtmlUnit problem is fixed.