All Packages Class Hierarchy This Package Previous Next Index
Suite design can exploit the treeness of Test. The designer can design small suites that can be composed into larger suites that can be assembled into a huge suite that is a large product's full regression test. A development in product areas proceeds, the small suites can be run on those areas frequently, while the full suite would be run only perhaps daily, when all work has been integrated. This is all highly flexible, due to the design of the org.jsl.autotest.cases package.
Good test design can lead to high test reuse. For example, a Test generally has no idea who its parent is. A test can be used in different containers, and can even behave differently by using properties the different container provide.
Note the isContainer() and
getChildTests() methods.
This allows a Test to be a container or leaf,
simplifying the framework. It also lets you suddenly decide to
change a leaf into a container, with very little code work. This
allows test suites to evolve more gracefully. It even allows a
Test to dynamically decide to be a leaf or container during a
session.
Note that all Test "delegates" are provided, such as Asserter. This allows the framework more control and flexibility, such as customizing different delegates and changing them from classes to interfaces.
runTest() is called.
runTest() is called.
public abstract void setTestContext(TestContext testContext)
If the test sets properties this must be done within
this method. This allows passing container properties to their
children before a test's beforeTest() is called.
public abstract TestContext getTestContext()
public abstract void setTestInfo(TestInfo testInfo)
public abstract TestInfo getTestInfo()
public abstract void beforeTest()
runTest() is called. This is an
opportunity to set up test fixtures.
public abstract void runTest()
testThis(), testThat(), or
testUniversalSocket().
If multiple test methods are called, one must be careful that they don't mess up the shared state, causing some test methods to behave improperly. One way to resolve this is to reinitialize the shared state that could be affected before each test method. We shall see what's best as the framework evolves....
If the Test is a container this method is called before its
children are used, ie before they have their beforeTest,
runTest() and afterTest() called.
public abstract void afterTest()
runTest() is called. Any
outstanding resources should be released.
public abstract boolean isContainer()
public abstract Enumeration getChildTests()
getChildTests() the children must be the
same instances. If the Test is a leaf then this returns
null and is never called.
public abstract void assert(boolean isTrue)
public abstract void assert(boolean isTrue,
String description)
setAssertDescription(String),
if any. The description does not change the assert
description in effect.
public abstract void setAssertDescription(String description)
All Packages Class Hierarchy This Package Previous Next Index