[jboss-as7-dev] Writing Tests for AS7

Andrew Lee Rubinger andrew.rubinger at redhat.com
Thu Apr 21 05:22:35 EDT 2011


Hi all:

In the AS7 suite we now have a series of new modules I'd like to introduce.

arquillian2 - Home of the new ARQ AS7 Containers, based on ARQ 
1.0.0.Alpha5. These are not yet feature-complete (needs remote and 
embedded servers), but the existing managed connector is working and in 
place.  The "arquillian" subsystem stuff will eventually be ported here.

demos2 - New home for the demos.  These are split into submodules: spec, 
api, and internals.  The compilation ClassPath of "spec" is limited to 
the JDK and the EE APIs, and the "api" submodule will also add in 
support for the A7 APIs once those become available[1].  Anything in 
"internals" will have compilation access to anything in the AS7 runtime. 
  As a general rule, place demos into the submodule with the most 
limited scope you can.

testsuite2 - New home for the testsuite.  Currently broken into spec, 
api, and internals, just like the demos.  I've ported some EJB3 tests 
into here as an example.

Looking forward, please put new tests under "testsuite2" in the 
appropriate module.  Testable resources (like Servlets and EJBs) should 
live either in demos2/*/src/main or testsuite2/*/src/main, not under the 
test sources (so we ensure the compilation CP is correct and don't end 
up testing internals accidentally).  Also, have a look at porting tests 
you've written in the original "testsuite" module...this may require 
some refactoring to match the ARQ 1.0.0.Alpha5 and ShrinkWrap 
1.0.0-alphas-12 APIs.  Ping me if you need any help in this area.  Some 
common things to note:

* ZipExporter.export() > ZipExporter.exportAsStream()
* archive.add*() > archive > addAs*()
* @RunMode(RunModeType.CLIENT) > @RunAsClient
* Also, if you're running as client, you'll probably want to note to ARQ 
*not* to wrap your deployment in a WAR along with the test case.  This 
is done by setting @Deployment(testable=false) on your deployment method.

An example of an EJB test which runs inside the container, using 
injection into the test:

https://github.com/jbossas/jboss-as/blob/master/testsuite2/spec/src/test/java/org/jboss/as/test/spec/ejb3/StatelessBeanTestCase.java

Also, I'll soon be publishing a draft of a formal test plan for review, 
which will account for:

* Assigning each subsystem lead to inventory coverage
* Porting AS6 tests into AS7

S,
ALR

[1] https://issues.jboss.org/browse/JBAS-9283



More information about the jboss-as7-dev mailing list