Welcome to BeanUnit

BeanUnit is a free, open source extension to JUnit.

It is not an API, but a theory, and a few tools.

The Theory

Expose your JUnit Test Suite as JavaBeans!

To elaborate, this means creating getters and setters for all configurable properties for your test. Make sure all the properties have a default value.

For example, here is a simple BeanUnit test:

public class MyTest extends TestCase {
  
  private String url = "http://beanunit.sourceforge.net/";
  
  public MyTest(String name) {
    super(name);
  }
  
  public String getUrl() {
    return url;
  }
  
  public void setUrl(String url) {
    this.url = url;
  }
  
  public void testServerPing() throws Exception {
    //perform the test here
  }
}

This does not require any extra API, therefore developers can continue to use other JUnit extensions that force a different parent class. This also does not require any configuation file, so developers can continue to execute individual tests from their IDE or Build scripts using their exsiting tools.

The advantage lies in the BeanUnit Runners. These are extra, stand-alone applications for executing BeanUnit test suites. The Runners can discover the TestCases and their properties, and expose these to a user wanting to configure and run the tests. The configurations can also be saved, creating a library of configurations for different sites.