Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate what Arquillian extensions are needed to replace the EE10 porting lib #1355

Closed
starksm64 opened this issue Jul 10, 2024 · 5 comments
Assignees
Labels
11.0 Issues related to the Jakarta EE 11 Platform TCK release

Comments

@starksm64
Copy link
Contributor

starksm64 commented Jul 10, 2024

We need to defined what arquillian loadable extension requirements are needed to replace the EE10 CTS porting lib classes. The deployment related classes will be taken care of by the arquillian @deployment method on the test class, but vendor specific descriptors and classes will need an ArquillianDeploymentAppender.

It may be useful to add base class implementations to simplify vendor implementations.

The current porting lib section of the TCK user guild will need to be replaced to document requirements/usage.
Update the TCK user guide

@starksm64 starksm64 converted this from a draft issue Jul 10, 2024
@starksm64
Copy link
Contributor Author

After looking into the often used ApplicationArchiveProcessor approach to supproriting inclusions of vendor descriptors, this was seen as too cumbersome as you are presented with the top level archive and then have to go looking through it for child archives and sun xml descriptors.

With the release of Arquillian core 1.9.1.Final, the static class deployment methods are able to accepts @ArquillianResource annotated paramters. What I have prototyped is the following where the test deployment methods accept a TestArchiveProcessor instance that can be used to augment the individual archives as they are built:

@ExtendWith(ArquillianExtension.class)
public class ClientTest extends com.sun.ts.tests.ejb30.misc.sameejbclass.Client {

    @TargetsContainer("tck-javatest")
    @OverProtocol("javatest")
    @Deployment(name = "misc_sameejbclass")
    public static EnterpriseArchive createDeployment(@ArquillianResource TestArchiveProcessor archiveProcessor) {
        // War
...
        // The sun-web.xml descriptor
        warResURL = Client.class.getResource("/com/sun/ts/tests/ejb30/misc/sameejbclass/misc_sameejbclass_web.war.sun-web.xml");
        if(warResURL != null) {
            misc_sameejbclass_web.addAsWebInfResource(warResURL, "sun-web.xml");
            archiveProcessor.processWebArchive(misc_sameejbclass_web, ClientTest.class, warResURL);
        }
...

The proposed TestArchiveProcessor is:

/**
 * Interface that vendors implement to augment test archives with vendor specific deployment content.
 */
public interface TestArchiveProcessor {
    void processClientArchive(JavaArchive clientArchive, Class<?> testClass, URL sunXmlUrl);
    void processEjbArchive(JavaArchive ejbArchive, Class<?> testClass, URL sunXmlUrl);
    void processWebArchive(WebArchive webArchive, Class<?> testClass, URL sunXmlUrl);
    void processRarArchive(JavaArchive warArchive, Class<?> testClass, URL sunXmlUrl);
    void processEarArchive(EnterpriseArchive earArchive, Class<?> testClass, URL sunXmlUrl);
}

@starksm64
Copy link
Contributor Author

A question is, should this be called regardless of whether there is a sun*.xml descriptor, or only when there is such a descriptor? I'm leaning toward the later, but I'm not sure what all vendors need to customize.

starksm64 added a commit to jakartaredhat/jakartaee-tck-tools that referenced this issue Jul 23, 2024
@starksm64 starksm64 moved this from Needs Definition to In progress in Jakarta EE11 TCK Release Jul 24, 2024
@starksm64 starksm64 self-assigned this Jul 24, 2024
@starksm64 starksm64 moved this from In progress to In review in Jakarta EE11 TCK Release Jul 25, 2024
@starksm64
Copy link
Contributor Author

The proposed interface has been updated to support persistence unit archives:

package tck.arquillian.porting.lib.spi;

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;

import java.net.URL;

/**
 * Interface that vendors implement to augment test archives with vendor specific deployment content.
 */
public interface TestArchiveProcessor {
    /**
     * Called to process a client archive (jar) that is part of the test deployment.
     * @param clientArchive - the appclient archive
     * @param testClass - the TCK test class
     * @param sunXmlUrl - the URL to the sun-application-client.xml file
     */
    void processClientArchive(JavaArchive clientArchive, Class<?> testClass, URL sunXmlUrl);
    /**
     * Called to process a ejb archive (jar) that is part of the test deployment.
     * @param ejbArchive - the ejb archive
     * @param testClass - the TCK test class
     * @param sunXmlUrl - the URL to the sun-ejb-jar.xml file
     */
    void processEjbArchive(JavaArchive ejbArchive, Class<?> testClass, URL sunXmlUrl);
    /**
     * Called to process a web archive (war) that is part of the test deployment.
     * @param webArchive - the web archive
     * @param testClass - the TCK test class
     * @param sunXmlUrl - the URL to the sun-web.xml file
     */
    void processWebArchive(WebArchive webArchive, Class<?> testClass, URL sunXmlUrl);
    /**
     * Called to process a resource adaptor archive (rar) that is part of the test deployment.
     * @param rarArchive - the resource archive
     * @param testClass - the TCK test class
     * @param sunXmlUrl - the URL to the sun-ra.xml file
     */
    void processRarArchive(JavaArchive rarArchive, Class<?> testClass, URL sunXmlUrl);
    /**
     * Called to process a persistence unit archive (par) that is part of the test deployment.
     * @param parArchive - the resource archive
     * @param testClass - the TCK test class
     * @param persistenceXmlUrl - the URL to the sun-ra.xml file
     */
    void processParArchive(JavaArchive parArchive, Class<?> testClass, URL persistenceXmlUrl);
    /**
     * Called to process an enterprise archive (ear) that is part of the test deployment.
     * @param earArchive - the application archive
     * @param testClass - the TCK test class
     * @param sunXmlUrl - the URL to the sun-application.xml file
     */
    void processEarArchive(EnterpriseArchive earArchive, Class<?> testClass, URL sunXmlUrl);
}

@brideck
Copy link
Contributor

brideck commented Jul 31, 2024

A question is, should this be called regardless of whether there is a sun*.xml descriptor, or only when there is such a descriptor? I'm leaning toward the later, but I'm not sure what all vendors need to customize.

I can confirm that in Open Liberty we do provide something in a binding or extension descriptor for at least one test that doesn't have a sun*.xml file provided by the TCK. Whether or not those files are strictly necessary is an open question, I suppose, but not one I'm able to research deeply at the moment. Given that, I'd appreciate this being called all the time. Hopefully that won't prove to be a colossal performance degradation.

starksm64 added a commit to jakartaredhat/jakartaee-tck-tools that referenced this issue Jul 31, 2024
@starksm64
Copy link
Contributor Author

starksm64 commented Aug 1, 2024 via email

@gurunrao gurunrao added the 11.0 Issues related to the Jakarta EE 11 Platform TCK release label Oct 4, 2024
@starksm64 starksm64 moved this from In review to Done in Jakarta EE11 TCK Release Oct 8, 2024
@starksm64 starksm64 closed this as completed by moving to Done in Jakarta EE11 TCK Release Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11.0 Issues related to the Jakarta EE 11 Platform TCK release
Projects
Status: Done
Development

No branches or pull requests

3 participants