Groovy Documentation

groovy.org.codenarc.rule.junit
[Groovy] Class JUnitUtil

java.lang.Object
  groovy.org.codenarc.rule.junit.JUnitUtil

class JUnitUtil

Utility methods for JUnit rule classes. This class is not intended for general use.

Authors:
Chris Mair


Method Summary
protected static boolean isAssertConstantValueCall(org.codehaus.groovy.ast.expr.MethodCallExpression methodCall, String methodName, Object value)

Return true if the MethodCallExpression represents a JUnit assert method call with the specified method name and constant argument value.

protected static boolean isSetUpMethod(org.codehaus.groovy.ast.MethodNode methodNode)

protected static boolean isTearDownMethod(org.codehaus.groovy.ast.MethodNode methodNode)

static boolean isTestMethod(org.codehaus.groovy.ast.ASTNode node)

Tells you if an ASTNode is a test MethodNode.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Method Detail

isAssertConstantValueCall

protected static boolean isAssertConstantValueCall(org.codehaus.groovy.ast.expr.MethodCallExpression methodCall, String methodName, Object value)
Return true if the MethodCallExpression represents a JUnit assert method call with the specified method name and constant argument value. This handles either single-argument assert calls or 2-argument assert methods where the first parameter is the assertion message.
Parameters:
methodCall - - the MethodCallExpression of the method call
methodName - - the name of the method
value - - the argument value


isSetUpMethod

protected static boolean isSetUpMethod(org.codehaus.groovy.ast.MethodNode methodNode)


isTearDownMethod

protected static boolean isTearDownMethod(org.codehaus.groovy.ast.MethodNode methodNode)


isTestMethod

static boolean isTestMethod(org.codehaus.groovy.ast.ASTNode node)
Tells you if an ASTNode is a test MethodNode. A method node is a MethodNode and is named test.* or is annotated with
Test:
or
@org.junit.Test,
Parameters:
node - the node to analyze
Returns:
true if the node is a test method


 

Groovy Documentation