TestMixinTransformation (Grails 3.2.9)
Date: 2017-04-26

Package: org.grails.compiler.injection.test

## [Java] Class TestMixinTransformation

- org.grails.compiler.injection.test.TestMixinTransformation

- All Implemented Interfaces and Traits:
    org.codehaus.groovy.transform.ASTTransformation

      @org.codehaus.groovy.transform.GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
      public class TestMixinTransformation

  An AST transformation to be applied to tests for adding behavior to a target test class.

  Authors:
    Graeme Rocher
  Since:
    2.0

- - ### Field Summary

    Fields
    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` | `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` |

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `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, org.codehaus.groovy.ast.ClassNode applicationClassNode)`
    `` | `void` | `weaveMixinsIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values)`
    `` | `void` | `weaveMixinsIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values, org.codehaus.groovy.ast.ClassNode applicationClassNode)`
    `` | `void` | `weaveTestMixins(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values)` @param classNode The class node to weave into
    `` | `void` | `weaveTestMixins(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values, org.codehaus.groovy.ast.ClassNode applicationClassNode)` @param classNode The class node to weave into

  - ### Inherited Methods Summary

    Inherited Methods
    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()`

- - ### 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 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.AnnotationNode TEST_ANNOTATION

    - #### public static final java.lang.String VOID_TYPE

  - ### Method Detail

    - #### 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)

    - #### 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)

    - #### protected boolean shouldSkipMethod(org.codehaus.groovy.ast.MethodNode declaredMethod)

    - #### public 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, org.codehaus.groovy.ast.ClassNode applicationClassNode)

    - #### public void weaveMixinsIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values)

    - #### public void weaveMixinsIntoClass(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values, org.codehaus.groovy.ast.ClassNode applicationClassNode)

    - #### public void weaveTestMixins(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values)

      Parameters:
        `classNode` - The class node to weave into
        `values` - A list of ClassExpression instances

    - #### public void weaveTestMixins(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ListExpression values, org.codehaus.groovy.ast.ClassNode applicationClassNode)

      Parameters:
        `classNode` - The class node to weave into
        `values` - A list of ClassExpression instances