Arkillian was proposed as a very good option for testing integration. However, it focuses on more โmodernโ applications; most examples use Java EE 5+ and Maven. We use J2EE and Ant. We are currently tied to Java 1.4, and although it may be possible for us to upgrade to Java 5, we will not upgrade to EJB 3.x anytime soon. We also probably stick with Ant.
Given these limitations, is it possible to use Arquillian?
Note. I am a supporter of Arkillian. I tried to be objective in my answer.
It will really depend on how your tests are performed. If you are trying to use Arquillian support for testing inside a container, you are unlikely to find a solution. WebSphere Commerce 6 uses WebSphere 6.0 as its primary container, which is currently not supported by Arkillian. If you can hypothetically use a version of WebSphere Commerce that uses WAS 7.0 or 8.0 as the basis, then most of my answers can be ignored, since these containers are supported.
You can try to run tests from the client using the @RunAsClient
annotation instead of the container, and this will most likely succeed. Note that you will need to perform the deployment in some way without the annotated @Deployment
method due to the aforementioned lack of WAS 6 support in Arquillian.
If you intend to use Ant instead of Maven, then the only requirement is that you have all the dependencies in the class path. Unfortunately, there is no uber JAR or distribution for Arquillian, so for now you need to know all the dependencies in advance.
Note. Creating in support of WebSphere 6.0 for Arquillian cannot be a trivial activity compared to other more recent containers:
- First, there must be tools for deploying the archive. I'm not sure if the mechanism used in supporting the WebSphere 7 and 8 container can be ported.
- Arquillian container support tests for WAS 6.0 may require Servlet 2.4 protocol support to run tests. Arquillian currently supports Servlet Spec 2.5 and 3.0 for ServletTestRunner packaging. This, of course, is necessary if the JMX protocol and the accompanying JMXTestRunner cannot be used.
Or are there better alternatives for integrating testing outdated enterprise Java applications?
I would usually advise people to use the combination of Cargo and JUnit for functional testing of legacy applications, but even Cargo does not support WebSphere 6.0.
You can find JUnitEE to better suit your needs if you are ready to pack JUnitEE TestRunner in your archive; note that the latest release of JUnitEE was in 2004, and the mailing list is a bit inactive, so YMMV.