Summary of changes
Last 15 days web site changes
These are the changes that happened to the Cactus web site for the past 15 days since the last site update (excluding the todo and changes pages which are modified too often):
<no changes>
Release changes
Cactus 1.5 (released on 23 November 2003)
-
The HttpClient 2.0 rc2 jar packaged with Cactus 1.5-rc1 was only
working with JDK 1.4. The HttpClient team has provided a new jar
compiled with the JDK 1.3, which we have included in our release.
(VMA) -
In the Cactus/Ant integration, user-defined tomcat-usersandweb.xmlare now correctly replacing the default version provided by Cactus. This is for the Tomcat 4.x and 5.x containers. (VMA) -
The Jetty Test Setup was not shutting Jetty down if an error ocurred
during setUp.
(VMA) Thanks to James Stangler. Fixes bug 24072.
Cactus 1.5-rc1 (released on 26 October 2003)
-
The Cactus Ant integration now reports the HTTP error code when it
fails to start the container and timeouts. It was previously doing
this but only in debug mode.
(VMA) Thanks to Norbert Pabis. Fixes bug 23604. -
Update the version of Commons HttpClient in the Cactus distribution to
1.0 rc2.
(VMA) -
Fixed and improved logging. It now works with Log4j, JDK 1.4 logging
and Commons Simple log. Check the sample servlet application for an
example of how to set up Cactus logging.
(VMA) -
Added new optional cactus.logging.configCactus property. If specified Cactus will load the properties file pointed by this property and will set each property as a system property. (VMA) -
Updated to use AspectJ 1.1.1. When you upgrade to Cactus 1.5-rc1
make sure you update your aspectjrt.jarto version 1.1.1 (the jar is provided in the Cactus distribution). (VMA) -
Added an EJB sample application to demonstrate how to perform EJB
unit testing with Cactus and how to automate it with the
Cactus/Ant integration.
(VMA) -
When using the new ServletTestSuitewrapper around pure JUnit test cases, thesetUp()andtearDown()methods were not called. (VMA) Thanks to Alexander Ananiev. -
In the Ant integration, when using the <cactus> task with
an EAR, the test webapp context was not correctly set.
(VMA) Thanks to Jonathan Kovacs. Fixes bug 22794. -
Fixed the JettyTestSetupclass so that it stops the running Jetty server at the end of the test suite execution. (VMA) Thanks to James Stangler. Fixes bug 22249. -
The Cactus distribution now packages commons-httpclient 2.0 RC1
(we were previously including version 2.0 beta2).
(VMA) -
Support for WebLogic 7.x is now working fine. Fixed bugs in the
WebLogic 7.x configuration: the
weblogic.xmlfile was not correctly copied in theWEB-INFdirectory of the cactified war, and an NPE happened when the bea home property was not set. It now tries to guess it from thecactus.home.weblogic7xproperty if not set. In addition, the configuration has also been greatly simplified. (VMA) -
In the cactifywar Ant task, changed the default realm name
that is used when adding Cactus default configuration data.
It was previously Cactus test realm. It is nowmyrealm. The reason is that the default WebLogic configuration creates amyrealmrealm and thus using this name makes our Cactus configuration for WebLogic much simpler. It doesn't affect the other containers as they do not seem to check for the realm name. (VMA) -
Added the ability to define the JBoss port that will be used
in the Ant integration to poll if the JBoss server is up and
running. Note: This value will not modify the port of the
default JBoss configuration (it is still 8080). However, it
is useful for users who have defined their own JBoss
configuration and are using a port other than 8080.
(VMA) Thanks to Florin Vancea. -
Fixed bug in Eclipse plugin build where the plugin version was not
correctly resolved.
(VMA) Thanks to Christopher Marshall. Fixes bug 21892.
Cactus 1.5-beta1 (released on 14 July 2003)
-
Support for WebLogic 7.x has not been tested with Cactus 1.5 and
may not work.
(VMA) -
Support for WebLogic 6.x is still available in the Ant integration.
However, it has not been tested as it is no longer possible to
download WebLogic 6.x from the BEA web site. It is thus completely
untested.
(VMA) -
Update of jars bundled in the Cactus distribution: Commons Logging
1.0.3, Log4j 1.2.8, HttpClient 2.0beta2, HttpUnit 1.5.3 and
JUnit 3.8.1. In addition the requirements for the jars needed to
build Cactus were also updated: Checkstyle 3.1 (and the dependent
jars: BeanUtils 1.6.1, Collections 2.1, Regexp 1.2 and Antlr 2.7.2).
(VMA) -
Added a Cactus books section
for books covering the Cactus framework.
(VMA) -
Refactoring of XXXTestCaseclass hierarchy. Whereas it was previously inheriting fromAbstractWebTestCaseandAbstractTestCaseit is now simply inheriting from JUnitTestCase. Thus all non-public API are now not visible from user (as they should be). This has broken binary compatibility. If you had some framework compiled with Cactus 1.4.1 and using some methods fromAbstractWebTestCaseorAbstractTestCase, you'll need to recompile it with Cactus 1.5. (VMA) -
Added a HttpServletRequestWrapper.setRemoteUser()method to simulate a remote user. Thus, there is now 2 methods to get a remote user: by simulating it as above or by using real BASIC or Form-based authentication. (CML) -
Refactored the authentication support by introducing the interface
Authentication, which the classAbstractAuthenticationnow implements. (CML) -
Added a quick tutorial for Cactus developers who want to
set up their Eclipse
environment to work on the Cactus plugins for Eclipse.
(VMA) -
The WebResponseclass now has a method to directly retrieve the status code. (CML) -
When a simulation URL is used and null values are passed for the
Server name, Context Path and Servlet Path parameters, calls to
Cactus HttpServletRequestWrapper.getServerName(),HttpServletRequestWrapper.getServerPort(),HttpServletRequestWrapper.getContextPath()andHttpServletRequestWrapper.getServletPath()now correctly return the values from the original Request object (and not the wrapped one), handled by the Servlet Redirector. (VMA) -
Added verification code in Cactus to verify that the parameters
passed to the WebRequest.setURL()method have the correct format and throw an exception if not. (VMA) -
Added a RSS feed for Cactus news.
(VMA) -
The Cactus web site has a new style that is heavily based on CSS.
It should provide better printing capabilities and a more consistent
look.
(CML) -
Cactus was not correctly handling the ComparisonFailureexception introduced by JUnit 3.8.1 and these exceptions were reported as errors instead of failures. (VMA) Thanks to Misak Boulatian. Fixes bug 9544. -
Fixed bug in Cactus exception handling where an invalid test result
could result in a StringIndexOutOfBoundsException, thus hiding the real problem. (VMA) Thanks to Melissa White. -
Added a new custom Ant task (WebXmlMerge) that merges the content of
two web deployment descriptors into one. That includes the
definitions of filters and servlets, as well as some security-related
elements.
(CML) -
Allows creating Cactus TestCase without the need for a constructor
that takes a String parameter (a default constructor is good enough).
Obviously, this feature works only with JUnit 3.8.1 (but Cactus
continues to support JUnit 3.7).
(VMA) -
Added ability to add any additional HTTP parameters to the request
used by Cactus to the Form-based authentication security URL.
(VMA) -
Added support for running pure JUnit TestCase on the server side
using Cactus. This is possible by using a new
ServletTestSuiteTest Suite. (VMA) -
Fixed bug where a simulation URL would be used even when none has
been defined (Reminder: a simulation URL is defined by calling
WebRequest.setURL()). (VMA) Thanks to Helen Rehn. -
Added a timeout for the <runservertests>Ant task so that the verification that the container is started is stopped if this timeout is reached (a build exception is raised). (VMA) -
Moved some Ant tasks that were previously in the Cactus Ant tasks;
they are now in the Ant Integration project. They are the tasks used
to start/stop the containers and the runserverteststask. It is now recommended to use the Ant Integration. (VMA) -
Improved (and normalized) build system. This change should not
affect nor be visible by Cactus end-users. However, Cactus power
users building Cactus from sources will appreciate.
(VMA) -
Improved test classe names in the Servlet Sample application.
(VMA) -
The Servlet Sample build is now using the Cactus Ant Integration.
(VMA) -
New Cactus Ant Integration. It provides new custom Ant tasks
such as
<cactifywar>,<cactus>which makes executing Cactus tests from an Ant build script extremely easy. (CML) -
Modified the build process to generate the Cactus web site by
removing the use of Stylebook and replacing it with an XSL
stylesheet. In addition, added several new features: support for
subdirectories, support for dynamic menu items and sitemap
generation.
(VMA) -
The Cactus runservertestscustom Ant task has been improved and it is now propagating correctly Ant references to the targets you defined for starting the container, stopping it and runnning the Cactus tests. Previously, it was only propagating the Ant properties. (VMA) -
Added stack trace filtering to the ServletTestRunner. Stack frames
in the JUnit framework classes as well as in the Cactus base test
case classes are filtered out.
(CML) -
The Cactus web site now provides online documentation for both the
CVS HEAD version and the last released version.
(VMA) -
Enable the ServletTestRunnerto run in an environment where it is not allowed to set system properties. In such cases, thecactus.propertiesconfiguration file needs to be on the server classpath. (CML) -
Implemented server-side XSLT transformations in the
ServletTestRunner. The code is based on the TraX API but uses reflection to avoid a direct runtime dependancy. (CML) -
Added automated Ant scripts for JBoss/Jetty 3.x.
(VMA) -
Fixed bug where users using a Locale which does not format numbers
with dots (".") had issues with the JUnitReport Ant XSL stylesheet.
The Servlet Test Runner code now forces a US Locale.
(CML) -
Added new extension class to help unit test JSP Taglibs. See the
TestJspTagLifecycletest class in the sample-servlet application for help on using it. (VMA) Thanks to Christopher Lenz. -
Improved error handling when dealing with invalid Cookies.
(VMA) -
Fixed a potential bug with classloaders. On the server side, Cactus
looks for the TestCase class by searching first the WebApp
Classloader and then the Context ClassLoader. However, the Context
ClassLoader is only searched if an Exception (subclass of
Exception) is raised. Thus, if aNoClassDefFoundErrorhad been raised, Cactus would not have searched in the Context ClassLoader. (VMA) Thanks to Roumen B. Antonov. -
Added support for internationalization (double byte characters) for
sending back test results. This allows Cactus to be used with any
character set.
(VMA) Thanks to Atsushi Hasegawa. -
Fixed bug where a redirector overriden by calling
WebRequest.setRedirectorName()was not used to fetch the Cactus test result (the default redirector specified in the Cactus configuration was used instead). (VMA) Thanks to Pranab Dhar. -
Fixed bug where Cactus was using the deprecated HttpClient
PostMethod.setRequestBody(String)which had some bug related to char to byte encoding. Now using thePostMethod.setRequestBody(InputStream)signature. (VMA) Thanks to Stephan Merker. -
Added links to Japanese and Korean translations of Cactus.
(VMA) -
Ability to get a real HTTP Session cookie before the start of the
test. This is achieved by calling the new
WebRequest.getSessionCookie()method which returns aHttpSessionCookieobject that you then add to the HTTP request. Initially suggested by Kyle W. Willkomm. (VMA) -
New WebResponse.getCookieIgnoreCase(cookieName)to get the first cookie matchingcookieNamewhatever the case (case-insensitive). (VMA) -
Added Form-based authentication support.
(VMA) Thanks to Jason Robertson. -
Added a tutorial that explains
how to build Cactus from the sources.
(VMA) -
Added a Jetty Sample application to demonstrate how to use the new
JettyTestSetupthat automatically starts Jetty before a test suite. (VMA) -
Added a Jetty integration
tutorial.
(JRU) -
Added a org.apache.cactus.extension.jetty.JettyTestSetupJUnit TestSetup to automatically start Jetty before a test suite is executed. This is really nice to quickly run tests inside any IDE or even from a simple<junit>Ant taks without the need to package and deploy a WAR. In addition, it is real nice to debug tests this way. Moreover, Jetty starts in less than 1 second, making it completely seamless and transparent! We are now at the same order of magnitude as pure JUnit tests in term of speed ... :-). Of course, this is only for Servlet tests ... I am still waiting for an embeddable EJB container that starts in less than 1 second ... (VMA) -
Added support for client side begin(...)andend(...)methods. They are called on the client side, before and after every test in the same way as the JUnitsetUp()andtearDown()are called before and after each test, but on the server side. (VMA)
Cactus 1.4.1 (released on 31 August 2002)
-
Added a sample (and thus a test for Cactus) for HttpUnit integration
as part of the Cactus sample.
(VMA) Thanks to Hirsch Richard. -
Fixed bug in new HttpClient wrapper in Cactus with regards to the
headers returned in the HTTP response (they were offset by one and
the status line was not returned as a header).
(VMA) Thanks to Hirsch Richard. -
Fixed bug where NullPointerExceptionwould be thrown by CactusServletTestRunnerif an exception raised in a test case had not specified a message (i.e.getMessage()returningnull). (VMA) Thanks to Micah Williams. -
Some JDK implementation return "null" when Class.getClassLoader() is
called to indicate that the given class has been loaded by the
bootstrap class loader. This was leading to
NullPointerExceptionbeing thrown by Cactus in some cases. (VMA) Thanks to Gerhard Kreutzer. -
Fixed import bug in sample-servlet which prevented building Cactus
from the sources on JDK 1.4.
(VMA) Thanks to Ville Skyttä. -
Fixed default properties for the sample application so that it points
to the correct HttpClient jar which is packaged with Cactus (the one
built on 06/06/2002).
(VMA) Thanks to Hirsch Richard. -
Fixed a bug that was preventing having several POST parameters added in
the request in beginXXX()methods. (VMA) Thanks to Larry Tambascio. -
The encoding in the sample junit-noframesXSL stylesheet was set to be "US-ASCII". It is now set to "UTF-8". Apparently, XSLT processors are only required to support utf-8 and utf-16, the rest is processor specific. For example your processor might support US-ASCII-7 and others might support US-ASCII. Thanks to Robert Koberg for the explanation! (VMA) Thanks to Dave Hoover.
Cactus 1.4 (released on 25 August 2002)
-
Added a tutorial that explains how
to test JSPs with Cactus.
(VMA) -
Fixed JDK 1.2 compatibility (broken in 1.4b1).
(VMA) Thanks to David George. -
According to the XML definitions (at least the definitions Mozilla 1.0
got implemented), the <?xml version...> tag should go before the
<?xml-stylesheet...> tag. Using them in the wrong order produces
an error when Mozilla tries to render it.
(VMA) Thanks to Felipe Hoffa.
Cactus 1.4b1 (released on July 31 2002)
-
It is now possible to assert response codes in
endXXX(). For example, you can verify that you servlet has returned a 500 response code. See the tests provided in the Sample Servlet application which is part of the Cactus distribution. This change was possible because we moved the underlying implementation fromHttpURLConnectionto Jakarta Commons HttpClient. Note: It is still not possible to test a 401 response code (this limitation has been raised to the HttpClient team). (VMA) -
Refactored internal code to be able to use different HTTP connection
implementation. 2 are currently provided: one using the JDK
HttpURLConnectionand one using Jakarta Commons HttpClient (the default one). It can be modified by setting the following System property:cactus.connectionHelper.classname = org.apache.cactus.client.JdkConnectionHelper(for the JDKHttpURLConnection). Note that the Servlet Sample test that assert response code will fail with the JDKHttpURLConnectionimplementation. (VMA) -
Cactus now requires the Commons Logging library
(commons-logging.jar). It is needed as Commons HttpClient is now using Commons Logging for logging and Cactus depends on HttpClient. Cactus is also now using Commons HttpClient for all its internal logs. This lets us use any underlying logging implementation: Log4j, LogKit, JDK 1.4 Logging, No Logging or SimpleLog (provided with Commons Logging - logs to the console). Check the Config Howto for how to configure logging in Cactus. (VMA) -
Removed deprecated org.apache.cactus.ServletTestRequestclass (was deprecated in Cactus 1.2). (VMA) -
Removed deprecated org.apache.cactus.util.ClientCookieclass (was deprecated in Cactus 1.2). (VMA) -
Removed deprecated org.apache.cactus.util.AssertUtilsclass (was deprecated in Cactus 1.2). (VMA) -
Added automatic script support for Orion 1.6.
(VMA) -
Ant scripts for Resin, Orion, Tomcat 3.2.4, WebLogic 6.1 and WebLogic
7.0 now correctly configured for Cactus BASIC authentication tests.
(VMA) -
Added automatic script support for WebLogic 7.0.
(VMA) -
It seems that it is possible that the test result contain an end of
line character and the Cactus WebTestResultParserwas choking on this and seeing the returned result as invalid. This has been fixed. (VMA) Thanks to Daniel Dennison. Fixes bug 9544. -
Added Test Coverage Reports as part of the Web Site generation.
(VMA) -
Renamed all external jars used in Cactus by suffixing them with their
versions. This is so that Cactus users will know exactly what jars
Cactus is packaging. You are of course free to use your own jars and
Cactus only packages these jars for your convenience. Cactus nows
packages Log4j 1.2.3, AspectJ Runtime 1.0.4, JUnit 3.7,
HttpClient 2.0alpha1 built on 6/6/2002, HttpUnit 1.4 and (new) the
Servlet API 2.2 and 2.3 jars. The Cactus jars have also been renamed
to include the version number in their names.
(VMA) -
Cactus Sample can be built using Ant 1.4 (support for Ant 1.4 was
broken by a line introduced in Cactus 1.3 that would only work with
Ant 1.5. However, this line can easily be commented out).
(VMA) -
(It also solves bug
Bug #4167 reported by
Eric Walker).
Modified the jspRedirector.jspso that it initializes an HTTP Session (session="true"). There is no way I know to make this parameter dynamic so we set it to true as this is the most used case. If one of your test must not have a session created for it, then you can always use the Redirector overriding feature (WebRequest.setRedirectorName(String redirectorName)). (VMA) Thanks to Marc Brette. Fixes bug 8640. -
Fixed bug where the Test Result object which is put in the Servlet
Context was not serializable. This might cause some trouble with some
containers.
(VMA) Thanks to Patrick Lightbody. -
Added simulation of Remote IP address and Remote Host Name, i.e. you
can now control what request.getRemoteAddr()andrequest.getRemoteHost()will return. That is useful if your code depends on these values. (VMA) Thanks to Marc Brette. -
It is now possible to specify the Cactus properties as System
properties (the property names are the same as the ones in
cactus.properties). Also if not specified, redirector names are set by default to "ServletRedirector", "JspRedirector" and "FilterRedirector". (VMA) -
New Quick start tutorial that
explains how to run Cactus tests quickly in Tomcat.
(VMA) -
A cool new way to quickly execute your test cases: Cactus now has
a JUnit Test Runner called ServletTestRunner (it is a servlet) that
you start using your browser. See the
TestRunner Howto tutorial.
(VMA) -
Test classes are now first looked for using the Current classloader
(the webapp one for Servlets) and if not found using the context
class loader. Previously the order was the revert, which was not
logical and could lead to issues.
(VMA) -
Improved debugging of runserverteststask. Simply run Ant in debug mode (ant -debug xxx) and the task will print information. Very useful to know why therunserverteststask seems to hang after starting your server ... (VMA)

