How to test J2EE Applications

Most java developers use (ok, ok maby just know about :) ) Junit. JUnit provides an effective and easy way to unit test client-side Java applications. Here is an very short example, just to see how easy you can build client-side Junit tests:
{[.junit1 /enzymes/s_java.php]}

JunitEE

But Junit has some limitations, therefore, testing in each application server container becomes a tedious process. The JunitEE test framework addresses these limitations. This framework extends the standard JUnit so that tests can be executed in an application server container. JunitEE is configured in the J2EE Web module of a unit test application, and it uses a TestRunner to output HTML or XML test results. So according to Junitee.org there are following benefites :

How it works? Roughly it could be described like below, see resources for detailed examples:

  1. Develop JUnit test cases
  2. Create and configure a JUnitEE test modulePlace
    1. junit.jar and junitee.jar files in the project classpath by placing them in the WEB-INF/lib directory
    2. a jar file, like MyUnitTest.jar, containing your Test classes. Copy this file into the WEB-INF/lib directory too
    3. Include in the Servlet description like shown below in the web.xml deployment descriptor
  3. Deploy and execute test cases on the Application Server.

{[.xml1 /enzymes/xml.php]}

Resources

  1. New features in Junit 4
  2. JunitEE Tutorial
  3. Other Junit Extensions for J2EE
  4. An extended example from IBM
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BlinkList
  • MisterWong.DE
  • Slashdot
  • StumbleUpon
  • Technorati
  • NewsVine
  • Reddit
  • Yigg
  • HackerNews
  • LinkedIn
  • Webnews.de
  • Yahoo! Buzz

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)