|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.compiler.injection.test.TestMixinTransformation
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION) public class TestMixinTransformation extends java.lang.Object
An AST transformation to be applied to tests for adding behavior to a target test class.
Field Summary | |
---|---|
static org.codehaus.groovy.ast.ClassNode |
GROOVY_OBJECT_CLASS_NODE
|
static org.codehaus.groovy.ast.AnnotationNode |
MIXIN_METHOD_ANNOTATION
|
static java.lang.String |
OBJECT_CLASS
|
static java.lang.String |
SET_UP_METHOD
|
static java.lang.String |
SPEC_CLASS
|
static java.lang.String |
TEAR_DOWN_METHOD
|
static org.codehaus.groovy.ast.expr.VariableExpression |
THIS_EXPRESSION
|
Method Summary | |
---|---|
protected void
|
addMethodCallsToMethod(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String name, java.util.List methods)
|
protected void
|
autoAnnotateSetupTeardown(org.codehaus.groovy.ast.ClassNode classNode)
|
protected void
|
error(org.codehaus.groovy.control.SourceUnit source, java.lang.String me)
|
protected org.codehaus.groovy.ast.expr.ListExpression
|
getListOfClasses(org.codehaus.groovy.ast.AnnotationNode node)
|
protected org.codehaus.groovy.ast.stmt.BlockStatement
|
getOrCreateMethodBody(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.MethodNode setupMethod, java.lang.String name)
|
protected org.codehaus.groovy.ast.stmt.BlockStatement
|
getOrCreateNoArgsMethodBody(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String name)
|
protected boolean
|
hasAnnotation(org.codehaus.groovy.ast.MethodNode mixinMethod, java.lang.Class beforeClass)
|
protected boolean
|
hasDeclaredMethod(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.MethodNode mixinMethod)
|
static boolean
|
isAddableMethod(org.codehaus.groovy.ast.MethodNode declaredMethod)
|
protected boolean
|
isCandidateMethod(org.codehaus.groovy.ast.MethodNode declaredMethod)
|
static boolean
|
isJunit3Test(org.codehaus.groovy.ast.ClassNode classNode)
|
static boolean
|
isSpockTest(org.codehaus.groovy.ast.ClassNode classNode)
|
void
|
visit(org.codehaus.groovy.ast.ASTNode[] astNodes, org.codehaus.groovy.control.SourceUnit source)
|
void
|
weaveMixinsIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final org.codehaus.groovy.ast.ClassNode GROOVY_OBJECT_CLASS_NODE
public static final org.codehaus.groovy.ast.AnnotationNode MIXIN_METHOD_ANNOTATION
public static final java.lang.String OBJECT_CLASS
public static final java.lang.String SET_UP_METHOD
public static final java.lang.String SPEC_CLASS
public static final java.lang.String TEAR_DOWN_METHOD
public static final org.codehaus.groovy.ast.expr.VariableExpression THIS_EXPRESSION
Method Detail |
---|
protected void addMethodCallsToMethod(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String name, java.util.List methods)
protected void autoAnnotateSetupTeardown(org.codehaus.groovy.ast.ClassNode classNode)
protected void error(org.codehaus.groovy.control.SourceUnit source, java.lang.String me)
protected org.codehaus.groovy.ast.expr.ListExpression getListOfClasses(org.codehaus.groovy.ast.AnnotationNode node)
protected org.codehaus.groovy.ast.stmt.BlockStatement getOrCreateMethodBody(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.MethodNode setupMethod, java.lang.String name)
protected org.codehaus.groovy.ast.stmt.BlockStatement getOrCreateNoArgsMethodBody(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String name)
protected boolean hasAnnotation(org.codehaus.groovy.ast.MethodNode mixinMethod, java.lang.Class beforeClass)
protected boolean hasDeclaredMethod(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.MethodNode mixinMethod)
public static boolean isAddableMethod(org.codehaus.groovy.ast.MethodNode declaredMethod)
protected boolean isCandidateMethod(org.codehaus.groovy.ast.MethodNode declaredMethod)
public static boolean isJunit3Test(org.codehaus.groovy.ast.ClassNode classNode)
public static boolean isSpockTest(org.codehaus.groovy.ast.ClassNode classNode)
public void visit(org.codehaus.groovy.ast.ASTNode[] astNodes, org.codehaus.groovy.control.SourceUnit source)
public void weaveMixinsIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values)
Groovy Documentation