com.mucommander.test
Class ConditionalTestSuite
java.lang.Object
junit.framework.TestSuite
com.mucommander.test.ConditionalTestSuite
- All Implemented Interfaces:
- junit.framework.Test
- Direct Known Subclasses:
- SingleConditionalTestSuite
public abstract class ConditionalTestSuite
- extends junit.framework.TestSuite
ConditionalTestSuite is an abstract JUnit test suite which can be conditionally enabled or disabled at
runtime, depending on the value returned by isEnabled().
The test suite can comprise one or several test cases: the populateTestSuite() method populates the test
suite before it is executed. SingleConditionalTestSuite is a specialized
ConditionalTestSuite for test suites with a single test case.
Once implemented, test suites can easily be run by JUnit's test runner by implementing a
public static TestSuite suite() method and have it return an instance of itself.
.
- Author:
- Maxence Bernard
|
Method Summary |
protected abstract boolean |
isEnabled()
Returns true if this test case is enabled. |
protected abstract void |
populateTestSuite()
Populates this test suite with the JUnit tests to be performed. |
| Methods inherited from class junit.framework.TestSuite |
addTest, addTestSuite, countTestCases, createTest, getName, getTestConstructor, run, runTest, setName, testAt, testCount, tests, toString, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ConditionalTestSuite
public ConditionalTestSuite()
isEnabled
protected abstract boolean isEnabled()
- Returns
true if this test case is enabled. This method is called before each test to determine
if it should be executed or skipped. It allows to conditionally enable or disable the test case, for example
depending on some configuration property.
- Returns:
- true if this test case is enabled
populateTestSuite
protected abstract void populateTestSuite()
- Populates this test suite with the JUnit tests to be performed. This method is called by
ConditionalTestSuite() only if this test suite is enabled, as
reported by isEnabled().
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard