You can use the
JUnitEE user
interface to run your all your tests inside the Container. JUnitEE is
a JUnit TestRunner that has been written as a servlet with the user
interface in HTML format.
You cannot achieve all features of Cactus using JUnitEE as
part of them depend on being executed on the client side.
Executing JUnitEE from ANT commands will probably not be possible.
Some benefits however of JUnitEE are:
-
All class files are in one place : Install all your
TestCase class-files only in your container classpath. Both
TestCases derived from
junit.framework.TestCase
and from
org.apache.cactus.JspTestCase
will be located in the same place and only once.
-
Run all TestCases in the container : You can mix
both types of TestCases mentioned above in your test. All tests are
executed inside the Container. You can use testcases derived from
junit.framework.TestCase
to test methods that do not
require the http objects such as the
HttpServletRequest
or
HttpServletResponse
objects.
Using JUnitEE is (relatively) simple. Assuming you have a container
such as Weblogic, Tomcat or Orion functioning and you know how to
configure Servlets and adding libraries to the Containers classpath and
you are familiar with the basics of Cactus then the rest is easy.
-
One good reason to use JUnitEE would be when you want to try Cactus
quickly and are not concerned with automatic unit testing.
-
Usage of standard JUnit testrunner (textui,swingui, ...) will not be
possible if cactus is configured this way and thus the ant junit task
cannot be used to automate the test.