Overview

portletUnit is a testing framework used to test JSR-168 portlets outside portlet container just as servletUnit is used to test servlets outside a servlet container. The projected is architected to map the functionally of servletUnit onto portlets with servletUnit itself providing the foundation for portletUnit.

Getting Started

  1. Download the latest distribution portletunit-0.2.3.zip
  2. Extract the zip file.
  3. Add lib/portletunit.jar to the CLASSPATH
  4. Add jars/httpunit.jar to the CLASSPATH.  Do not use the standard httpunit jar.
  5. Add all other jars from the jars directory to the CLASSPATH that are not already there.
At this point you can compile and test your portlet. 

Sample Portlet Application

In the portlets/examples directory is a sample portlet application.  It contains 4 portlets that are used to do the testing of portletUnit. 

Writing a Test Case

The portletUnit test cases extend jUnit TestCase.  A sample test looks like:

public void testHelloWorld() throws Exception {

Dependencies

All of these jar fails are found in the jars directory.

httpUnit

Apache Jakarata Commons

jUnit

Apache Pluto Portal