testdriven.com Wrangling quality out of chaos

Posts Tagged ‘Tools for Unit-Testing’

Jakarta Cactus: Unit-testing server-side Java

10.04.2003 · Posted in Links

Cactus is a simple test framework for unit testing server-side java code (Servlets, EJBs, Tag Libs, Filters, etc.). The intent of Cactus is to lower the cost of writing tests for server-side code. It uses JUnit and extends it. Cactus implements an in-container strategy.
link

AUnit: Unit-testing framework for ADA

10.04.2003 · Posted in Links

AUnit is a set of AdaLanguage packages based on the xUnit family of unit test frameworks. It’s intended as a developer’s tool to facilitate confident writing and evolution of Ada software. It is purposely lightweight, as one of its main goals is to make it easy to develop and run unit tests, rather than to generate artifacts for process management. The framework supports easy composition of sets of unit tests to provide flexibility in determining what tests to run for a given purpose.

Keyword: ADAUnit
link

XMLUnit

10.04.2003 · Posted in Links

XmlUnit provides extensions to JUnit (Java) and NUnit (.Net) to allow assertions to be made about XML:
Are two pieces of XML similar? Does an XPath exist? Is the result of an XSL transformation what is expected? And more! Enjoy ;-)

See also: HTMLUnit, HTTPUnit
link

XMLTestSuite

10.04.2003 · Posted in Links

XmlTestSuite provides a powerful way to test web applications.

Check site structure:
HTML pages are well formed and links are valid

Check the content of pages:
Use Javascript variables, XPath expressions, database queries

Check the way the site works:
Run test scanarios, written in XML
link

NUnitASP: ASP .NET Unit-testing

07.02.2003 · Posted in Links

NUnitAsp is based on the principle that testing web pages should use the same concepts as creating them. When you use NUnitAsp, you use classes and IDs similar to those you used when creating the web page you are testing.

In this tutorial, we’ll walk you through the process of creating a simple one-page web application and tests.

Authors: Jim Little and Andrew Enfield
See also: Quick Start Guide

link

JUnitEE: HTML output for Servlets

07.02.2003 · Posted in Links

JUnitEE provides a TestRunner which outputs HTML and a servlet which can be used as an entry point to your test cases. Building your test harness as a standard J2EE web application means:

– Your tests are packaged conveniently into a .war file which can easily be moved between servers; you can leave the .war file in the main .ear file and simply avoid enabling the test web application on the production server.

– Your test classes will be dynamically reloaded by the app server (assuming your server supports this).

– Your test cases look just like your production code, and can use the same beans (or whatever) you use as a facade for your EJBs.
link

TagUnit: Unit-testing custom JSP tags

07.02.2003 · Posted in Links

In the same way that JUnit allows us to write unit tests for Java classes, TagUnit allows us to unit test JSP custom tags, inside the container. In essence, TagUnit is a tag library for testing custom tags within JSP pages.

Even with tools like Cactus, JUnitEE and HttpUnit, testing Java Servlets and JSP pages is hard, particularly if they contain specific business or presentation logic that needs to be tested. Best practices around J2EE development suggest that logic should be encapsulated in JavaBeans or JSP custom tags for better separation of concerns, maintainability, reusability and to facilitate easier testing. Although JUnit can be used to test JavaBeans, testing custom tags by simply invoking their methods doesn’t make sense. Custom tags are components and therefore need to be tested at that level, in the way that they would normally be used from within a JSP page.

TagUnit provides a way to perform assertions on the content that custom tags generate and the side-effects that they have on the environment such as the introduction of scoped (request/page/session/application) attributes, cookies and so on. In addition to this, assertions can be made on the constraints specified within the tag library descriptor file that give us a way to verify the contract that a tag provides. In just a four line JSP page, TagUnit can automatically perform tests such as asserting whether the tag handler class is loadable and that it has setter methods for all declared attributes. To supplement this, user defined tests provide a way to perform assertions on the description of a tag, such as its body content and the details of any attributes.
link

Mock Objects

05.09.2003 · Posted in Links

The Mock Objects project is a generic unit testing framework whose goal is to facilitate developing unit tests in the mock object style. The goal of this project is to provide a core mock objects framework, a methodology for developing and using mock objects, a default set of mock implementation for the standard Java platform APIs, mock implementations for more specialised libraries.
link

The Grinder (Java load-testing framework)

05.09.2003 · Posted in Links

The Grinder, a Java load-testing framework freely available under a BSD-style open-source license, makes it easy to orchestrate the activities of a test script in many processes across many machines, using a graphical console application. Test scripts make use of client code embodied in Java plug-ins. Most users of The Grinder do not write plug-ins themselves, instead they use one of the supplied plug-ins. The Grinder comes with a mature plug-in for testing HTTP services, as well as a tool which allows HTTP scripts to be automatically recorded.
link

StrutsTestCase for JUnit v2.0

05.09.2003 · Posted in Links

StrutsTestCase for JUnit is an extension of the standard JUnit TestCase class that provides facilities for testing code based on the Struts framework. StrutsTestCase provides both a Mock Object approach and a Cactus approach to actually run the Struts ActionServlet, allowing you to test your Struts code with or without a running servlet engine. Because StrutsTestCase uses the ActionServlet controller to test your code, you can test not only the implementation of your Action objects, but also your mappings, form beans, and forwards declarations. And because StrutsTestCase already provides validation methods, it’s quick and easy to write unit test cases.

Author: Deryl Seale
link

JUnit-addons Runner

04.22.2003 · Posted in Links

Junit-addons Runner is a Junit runner that is especially targeted at integration tests, where external resources are too expensive to acquire before each test. Some of JUnit-addons Runner features include:

- custom listeners;
- resources (like a connection to a database) shared by tests;
- properties split for the runner and tests;
- custom monitor (to manage the execution of the tests).

This runner is very flexible (IMO) and was designed especially for
integration tests.

Programmer: Vladimir R. Bossicard (site)
See also: JUnit-addons documentation

link

Polygenix White Paper on Object Substitution

04.15.2003 · Posted in Links

Mock objects are a powerful and flexible mechanism for substituting an imposter as a parameter to the class under test. In many cases, however, the collaborations with the class under test are not parameterized — for example: an attribute that is not supplied to the constructor; objects that are created or referenced via static factories; or new instances of collaborations that are created by the class.
Object Substitution is a technique developed by Polygenix to enable the developer to replace such collaborations with the class under test without modifying the original source code.

The Polygenix staff
Polygenix
March 10, 2003

link

Abbot – Java GUI testing framework using JUnit

04.15.2003 · Posted in Links

Abbot (A Better Bot) is a Java GUI testing framework. The framework may be invoked directly in hand-coded Java tests, or more simply using XML-based scripts. Both methods are designed to be used with the JUnit testing framework. You can launch a GUI, invoke arbitrary user actions on it, and examine its state. The scripts may be invoked from JUnit or with minor modification any other testing environment.

link

JUnit

04.15.2003 · Posted in Links

JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. Most famous of XUnits, JUnit is Open Source Software.
link