testdriven.com Wrangling quality out of chaos

Archive for the ‘Java’ Category

TestNG aims to provide more flexibility to Java unit testing

04.29.2004 · Posted in Java

Cédric Beust has announced the release of a unit-testing tool for Java, TestNG (Testing, the Next Generation), which combines several features of JUnit and NUnit to provide added functionality:

<ul><li>JSR 175 Annotations</li>
<li>Flexible test configuration</li>
<li>Default JDK functions for runtime and logging (no dependencies)</li>
<li>Powerful execution model (no more TestSuite)</li></ul>Cédric writes: "I have always been confused by JUnit’s Test Suites. Where should the method belong? In the test class? Separately? Should it be static? And if I want to change the tests run, why do I need to rebuild my code? With these changes in mind, I came up with the design principles that are the foundation of TestNG."

Read TestNG’s documentation and download page.
Also take a peek at Robert Watkins’ take on JUnit and TestNG.

Jenny auto-generates JDBC Mock classes to facilitate unit testing

04.06.2004 · Posted in Java

From Jenny’s web page:

"I want to auto-generate a Mock class for every table class to facilitate unit testing. This means that I need to have something I can override. Since static methods cannot be overridden, I need an inner class that the static methods use that I can override for my mock classes. This also means that I need to hide all of the Row constructors so a mock object can be returned. This allows unit testing without having to provide SQL in the unit tests or to have a database server running during the testing."Jenny reads a database and generates java source which provides strongly typed access to the database, with all the getters and setters needed.

It was created to accomodate the slight differences in SQL, drivers, app servers, database access, etc. and provide access to the database in plain java. It also keeps track of table names and columns automatically in strong type.

"For each table and view in a given database, Jenny will create a java source class file. Each of these classes will provide a collection of general purpose methods for working with the table/view. They will also provide a list of all the column names, the table/view name and an inner class called Row that can be used to manipulate a single row in the table."

Gregg Bolinger writes:

"You provide Jenny a properties file with information about the database, what JDBC Driver to use, and what package the source code should be placed in. Jenny will also create mocks for all of her generated classes to help with your unit testing. Then it’s just a matter of executing Jenny from the command line feeding it the properties file to use and Jenny spits out the source code for you."

Find out more about Jenny.
Read Jenny’s one-page tutorial.

Jameleon 1.8 has been released

03.23.2004 · Posted in Java

This version fixes a number of bugs present in earlier releases, and adds new features, such as:

- Sets the test case name from script file name, if not supplied
- Displays Total Execution Time for TestResults
- Provides HttpUnit helper to get cell values in a given column
- Adds an expectException
- Adds a MaxElapseTime for each TestCase
- Adds an assert image on HttpUnit Validation pointGeneral description: "Jameleon is an acceptance-level automated testing tool that separates applications into features and allows those features to be tied together independently, creating test-cases. These test-cases can then be data-driven and executed against different environments. Even though it would be possible to write unit tests using Jameleon, Jameleon was designed with integration and acceptance-level testing in mind. Most bugs are found and fixed by good unit tests. However, this does not eliminate the need to test the application as a whole."

Go to the Jameleon home page.
Read the [url=http://sourceforge.net/project/shownotes.php?group_id=84246&release_id=225074]release notes[/url].

bwbUnit 1.0 released

02.27.2004 · Posted in Java

bwbUnit for Java is a set of components that supports both Black and White Box style of unit testing. Currently the primary component of bwbUnit is called PrivateProxy. It allows Java developers to access private/protected/package variables and methods very easily and without any extra configuration settings.

Other tools in the area require special proxy classes to be hand written or the java poloicy file to be updated. bwbUnit’s PrivateProxy doesn’t have these requirements, which makes it easier to learn and use.

This and all future componets will be developed in a way that allows them to snap into the JUnit framework or to be used as part of a custom testing application.

See http://spectorconsulting.com/bwbunit/

AntFit 1.1

01.28.2004 · Posted in Java

AntFit 1.1 has just been released.

Changes include:

1. useWiki parameter: If your html files don’t have a <wiki> tag, set this to false. Set to true by default for backwards compatibility.

2. fork parameter: forks a separate java process.

http://www.cmdev.com/antfit/

Abbot: New version has Eclipse plug-in

01.08.2004 · Posted in Java

The Abbot framework is a Java library for GUI unit testing and functional testing. It provides methods to reproduce user actions and examine the state of GUI components. The framework may be invoked directly from Java code or accessed without programming through the use of scripts.

It eases test and automation of Java GUIs by driving AWT/Swing (SWT support under development) from JUnit testcases (TDD your GUIs!) and XML scripts (which you can record as well as play). With newly-released version 0.11.0, Abbot is even easier for Eclipse users: it includes a binary plugin.

http://sourceforge.net/projects/abbot

AntFit: A Fit task for Ant

12.29.2003 · Posted in Java

This tool, requested on the FIT wiki MakingRunners page, provides an external task for Ant that will invoke the FIT engine on the test input file.
To be used in a development effort consisting largely of Java where the chosen tool for the project’s build is Apache Ant, this tool allows the acceptance tests to be run as part of the overall build.
In projects where a build and deploy is complex and requires integration with application servers or other complexities, having the power of Ant to handle the steps and run the tests together is an important benefit.

http://www.cmdev.com/antfit/docs/
antfit@cmdev.com