Ashish's running commentary ...
Archives
« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
Click me to subscribe
Search

Links
 

Today's Page Hits: 15

Main | Deploying a Ruby on... »
Monday Aug 14, 2006
Howto add unit tests in Glassfish
The GlassFish team recently looked at using TestNG as the Java test based framework for writing unit tests. Take a look at the team's findings here under the 'Developer Unit Test Initiative' section.

Since unit tests are an important factor in determining the quality of any product and given the fact GlassFish is an open source project I thought this is a good time as any to write a short primer on how to add unit tests for our ever increasing set of GlassFish developers

For general check-in guidelines and procedures, checkout this URL

First and foremost you need to checkout 'appserv-tests' module (which contains a LOT of tests)
cvs -d :pserver:@cvs.dev.java.net:/cvs checkout glassfish/appserv-tests
Currently, the developers write their tests in the devtests directory under the module specific directory. For TestNG based tests we've recently added a devtestsNG directory.

Secondly, modify the configuration file appserv-tests/config.properties to reflect the configuration you are trying to test.

Next copy the contents of appserv-tests/devtestsNG/template directory under the new (sub)module that you are writing tests for and modify the template files per your requirements. Ofcourse, you need add your tests ;)

The GlassFish test framwork is built using ant. Take a look at the appserv-tests/config/common.xml and appserv-tests/devtestsNG/common-build.xml - these file contain the ant based target definitions for a lot of the task that are commonly used during the tests such as packaging, deploying, undeploying applications and more.

Also, view the readme files in the appserv-tests/devtestsNG/ and appserv-tests/devtestsNG/template.

As always, please feel free to send us feedback

Posted at 05:09PM Aug 14, 2006 by Ashish Sahni in General  | 

Comments:

Post a Comment:
Comments are closed for this entry.