The WOUnit framework contains a set of utilities for testing WebObjects applications using JUnit 4.7 or later capabilities. This library can be useful if you write unit/integration tests for Enterprise Objects or employ the TDD technique on your projects.

WOUnit is free software released under the Apache 2 license. Visit the WOUnit website for more information and a complete guide on how to use this framework.


Here is a brief example that demonstrates some of the features of WOUnit: rules, special annotations and specific matchers for assertion.
import static com.wounit.matchers.EOAssert.*;
import com.wounit.rules.MockEditingContext;
import com.wounit.annotations.Dummy;
import com.wounit.annotations.UnderTest;

public class FooTest {
    public MockEditingContext ec = new MockEditingContext("MyModel");

    private Bar dummyBar;

    private Foo foo;

    public void cantSaveFooWithOnlyOneBar() {

        confirm(foo, cannotBeSavedBecause("Foo must have at least 2 bars related to it"));
  • No labels