|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
ExcludableTestCase
public abstract class ExcludableTestCase
Test case that can be exluded from a test run using system properties. This is especially useful for known issues or similar test cases that are expected to fail, but should not flag the entire test run as a failure.
This class overrides the runBare() method to check whether
the test should or should not be run. This decision is based on the
junit.excludes and junit.includes system
properties. If defined, these properties are interpreted as
whitespace-separated sets of test identifiers to exclude
or include. Normally each test is included in the test run, but identifying
a test in junit.excludes will exclude that test. The exclusion
can be overridden by identifying the test in junit.includes
which again overrides the exclusion.
Each test is identified by a set of test identifiers. The default identifiers of a test are:
org.example.test.ExampleTestCase)
ExampleTestCase)org.example.test)org.example.test.ExampleTestCase#testSomething)
ExampleTestCase#testSomething)
testSomething)
The set of identifiers of a test can be extended using the
addIdentifier(String) method. A common use case for this
would be for example to include the issue tracker identifier for the
known issue for which the test case was written.
| Constructor Summary | |
|---|---|
ExcludableTestCase()
Creates an excludable test case without a name. |
|
ExcludableTestCase(String name)
Creates an excludable test case with the given name. |
|
| Method Summary | |
|---|---|
void |
addIdentifier(String identifier)
Adds an identifier to this test. |
void |
runBare()
Runs the bare test sequence unless the test has been excluded. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ExcludableTestCase()
public ExcludableTestCase(String name)
name - test name| Method Detail |
|---|
public final void addIdentifier(String identifier)
identifier - test identifier
public final void runBare()
throws Throwable
junit.excludes and
junit.includes system properties. If the test is not
excluded, then the standard TestCase.runBare() method is
invoked.
runBare in class TestCaseThrowable - if any exception is thrown by the test
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||