@org.codehaus.groovy.transform.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.
Modifiers | Name | Description |
---|---|---|
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.AnnotationNode |
TEST_ANNOTATION |
|
static java.lang.String |
VOID_TYPE |
Type Params | Return Type | Name and description |
---|---|---|
|
protected void |
addEnableEMCStatement(org.codehaus.groovy.ast.ClassNode classNode) |
|
protected void |
addJunitRuleFields(org.codehaus.groovy.ast.ClassNode classNode) |
|
protected static org.codehaus.groovy.ast.FieldNode |
addLegacyMixinFieldIfNonExistent(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ClassNode fieldType, java.lang.String fieldName) |
|
protected static void |
addMethodCallsToMethod(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String name, java.util.List<org.codehaus.groovy.ast.MethodNode> methods) |
|
protected org.codehaus.groovy.ast.FieldNode |
addTestRuntimeAwareMixinFieldIfNonExistent(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ClassNode fieldType, java.lang.String fieldName) |
|
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 static org.codehaus.groovy.ast.stmt.BlockStatement |
getOrCreateMethodBody(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.MethodNode methodNode, java.lang.String name) |
|
protected static org.codehaus.groovy.ast.stmt.BlockStatement |
getOrCreateNoArgsMethodBody(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String name) |
|
protected static boolean |
hasAnnotation(org.codehaus.groovy.ast.MethodNode mixinMethod, java.lang.Class<?> beforeClass) |
|
protected static boolean |
hasDeclaredMethod(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.MethodNode mixinMethod) |
|
protected static boolean |
hasSimilarMethod(org.codehaus.groovy.ast.MethodNode declaredMethod, org.codehaus.groovy.ast.ClassNode groovyMethods) |
|
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) |
|
protected boolean |
shouldSkipMethod(org.codehaus.groovy.ast.MethodNode declaredMethod) |
|
void |
visit(org.codehaus.groovy.ast.ASTNode[] astNodes, org.codehaus.groovy.control.SourceUnit source) |
|
protected void |
weaveMixinIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ClassNode mixinClassNode, TestMixinTransformation.Junit3TestFixtureMethodHandler junit3MethodHandler) |
|
void |
weaveMixinsIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values) |
|
void |
weaveTestMixins(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values) @param classNode The class node to weave into |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), 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() |
classNode
- The class node to weave intovalues
- A list of ClassExpression instances