Class |
Description |
ChainedTestRule
|
A test method that invokes another test method is a chained test; the methods are dependent on one another. |
CoupledTestCaseRule
|
This rule finds test cases that are coupled to other test cases, either by invoking static methods on another test
case or by creating instances of another test case. |
JUnitAssertAlwaysFailsRule
|
Rule that checks for JUnit assert() method calls with constant arguments
such that the assertion always fails. |
JUnitAssertAlwaysSucceedsRule
|
Rule that checks for JUnit assert() method calls with constant arguments
such that the assertion always succeeds. |
JUnitAssertEqualsConstantActualValueRule
|
Reports usages of org.junit.Assert.assertEquals([message,] expected, actual) where the 'actual' parameter
is a constant or a literal. |
JUnitFailWithoutMessageRule
|
This rule detects JUnit calling the fail() method without an argument. |
JUnitLostTestRule
|
Rule that checks if a JUnit 4 test class contains public, instance, void, no-arg methods
named test*() that are NOT abstract and NOT annotated with- Test.:
|
JUnitPublicFieldRule
|
Checks for public field on a JUnit test class. |
JUnitPublicNonTestMethodRule
|
Rule that checks if a JUnit test class contains public methods other than:
- Zero-argument methods with names starting with "test"
- The setUp() and tearDown() methods
- Methods annotated with @Test
- Methods annotated with
- Before:
- and
@After
- Methods annotated with
- BeforeClass:
- and
@AfterClass
Public, non-test methods on a test class violate conventional usage of test classes,
and can be confusing.
|
JUnitPublicPropertyRule
|
Checks for public properties defined on JUnit test classes. |
JUnitSetUpCallsSuperRule
|
Rule that checks that if the JUnit setUp() method is defined, that it includes a call to
super.setUp() .
|
JUnitStyleAssertionsRule
|
This rule detects calling JUnit style assertions like assertEquals, assertTrue, assertFalse, assertNull,
assertNotNull. |
JUnitTearDownCallsSuperRule
|
Rule that checks that if the JUnit tearDown() method is defined, that it includes a call to
super.tearDown() .
|
JUnitTestMethodWithoutAssertRule
|
This rule searches for test methods that do not contain assert statements. |
JUnitUnnecessarySetUpRule
|
Rule that checks for a JUnit setUp() method that only contains a call to
super.setUp() .
|
JUnitUnnecessaryTearDownRule
|
Rule that checks for a JUnit tearDown() method that only contains a call to
super.tearDown() .
|
JUnitUnnecessaryThrowsExceptionRule
|
Check for throws clauses on JUnit test methods. |
JUnitUtil
|
Utility methods for JUnit rule classes. |
SpockIgnoreRestUsedRule
|
If Spock's- IgnoreRest:
- on any method, all non-annotated test methods are not executed.
|
UnnecessaryFailRule
|
In a unit test, catching an exception and immediately calling Assert.fail() is pointless and hides the stack trace. |
UseAssertEqualsInsteadOfAssertTrueRule
|
This rule detects JUnit assertions in object equality. |
UseAssertFalseInsteadOfNegationRule
|
In unit tests, if a condition is expected to be false then there is no sense using assertTrue with the negation operator. |
UseAssertNullInsteadOfAssertEqualsRule
|
This rule detects JUnit calling assertEquals where the first or second parameter is null. |
UseAssertSameInsteadOfAssertTrueRule
|
This rule detects JUnit calling assertTrue where the first or second parameter is an Object#is() call testing for reference equality. |
UseAssertTrueInsteadOfAssertEqualsRule
|
This rule detects JUnit calling assertEquals where the first parameter is a boolean. |
UseAssertTrueInsteadOfNegationRule
|
In unit tests, if a condition is expected to be true then there is no sense using assertFalse with the negation operator. |