Groovy Documentation

Package org.codenarc.rule.junit

 

Class Summary
JUnitAssertAlwaysFailsAstVisitor
JUnitAssertAlwaysFailsRule Rule that checks for JUnit assert() method calls with constant arguments such that the assertion always fails.
JUnitAssertAlwaysSucceedsAstVisitor
JUnitAssertAlwaysSucceedsRule Rule that checks for JUnit assert() method calls with constant arguments such that the assertion always succeeds.
JUnitPublicNonTestMethodAstVisitor
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.
JUnitSetUpCallsSuperAstVisitor
JUnitSetUpCallsSuperRule Rule that checks that if the JUnit setUp() method is defined, that it includes a call to super.setUp().
JUnitTearDownCallsSuperAstVisitor
JUnitTearDownCallsSuperRule Rule that checks that if the JUnit tearDown() method is defined, that it includes a call to super.tearDown().
JUnitUtil Utility methods for JUnit rule classes.
 


Groovy Documentation