GlassFish quality community:
Some new files are now available from the GlassFish repository - a very
early implementation of using TestNG to drive developer tests. The
particular example just checked in runs a test in the deployment section.
If you are interested in looking at what we've done, running it, or
commenting on it, please do the following:
1. Check out the GlassFish workspace including the appserv-tests section
- or update your workspace if you already have one.
2. Visit
http://www.testng.org to download TestNG. Part of what you get
will be the testng jar file such as testng-4.7-jdk15.jar. Copy this file to
${your-GlassFish-workspace}/appserv-tests/lib/testng.jar
Please note that you'll need to change the name to testng.jar (no
version information embedded in the name) when you copy the jar file.
This is just to save setting an additional environment variable.
Also, note that eventually we hope to NOT require you to download TestNG
separately, but for now this is the fastest way to get the work going.
3. Make sure to define the environment variable APS_HOME to point to
${your-GlassFish-workspace}/appserv-tests.
4. Because we are still very early in this work, there is one deployment
devtest that is currently TestNG-enabled:
appserv-tests/devtests/deployment/ejb30/ear/session. More tests - and
not just deployment ones - will follow soon.
To use TestNG to run the test, cd to
appserv-tests/devtests/deployment/ejb30/ear/session and run ant like this:
ant -f ${APS_HOME}/devtests/deployment/build-ng.xml
You will see output that is very similar to the output from running the
tests in the traditional way. (By the way, you can do that by running
ant like this:
ant all
from that same directory.) One difference you will see is that the
ending results are displayed by TestNG, which has managed the execution
of the test from beginning to end. TestNG places several output files
in the test-output subdirectory under the current default. Start by
viewing index.html with a browser and navigate using the left-hand panel
for more details.
Please keep in mind that this is an early implementation. There is
surely plenty of room for improvement. Also, we wanted to make sure we
did not interfere with the existing test infrastructure while making
these early efforts available to the community. So if the steps above
seem a little cumbersome, please bear with us.
Of course, we welcome your feedback via this alias.
- Tim