|
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 org.codehaus.groovy.grails.compiler.injection.test.TestForTransformation
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION) @SuppressWarnings("rawtypes") public class TestForTransformation extends TestMixinTransformation
Transformation used by the TestFor annotation to signify the class under test.
Field Summary | |
---|---|
static org.codehaus.groovy.ast.AnnotationNode |
AFTER_ANNOTATION
|
static org.codehaus.groovy.ast.ClassNode |
AFTER_CLASS_NODE
|
static org.codehaus.groovy.ast.AnnotationNode |
BEFORE_ANNOTATION
|
static org.codehaus.groovy.ast.ClassNode |
BEFORE_CLASS_NODE
|
static java.lang.String |
DOMAIN_TYPE
|
static org.codehaus.groovy.ast.ClassNode |
GROOVY_TEST_CASE_CLASS
|
static org.codehaus.groovy.ast.AnnotationNode |
TEST_ANNOTATION
|
static java.lang.String |
VOID_TYPE
|
protected static java.util.Map |
artefactTypeToTestMap
|
Fields inherited from class TestMixinTransformation | |
---|---|
GROOVY_OBJECT_CLASS_NODE, MIXIN_METHOD_ANNOTATION, OBJECT_CLASS, SET_UP_METHOD, SPEC_CLASS, TEAR_DOWN_METHOD, THIS_EXPRESSION |
Method Summary | |
---|---|
protected org.codehaus.groovy.ast.MethodNode
|
addClassUnderTestMethod(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ClassExpression targetClass, java.lang.String type)
|
protected void
|
addMockCollaborator(java.lang.String mockType, org.codehaus.groovy.ast.expr.ClassExpression targetClass, org.codehaus.groovy.ast.stmt.BlockStatement methodBody)
|
protected void
|
addMockCollaborators(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String mockType, java.util.List targetClasses)
|
protected void
|
addMockCollaborators(java.lang.String mockType, java.util.List targetClasses, org.codehaus.groovy.ast.stmt.BlockStatement methodBody)
|
protected org.codehaus.groovy.ast.stmt.Statement
|
getExistingJUnit4BeforeMethod(org.codehaus.groovy.ast.ClassNode classNode)
|
protected org.codehaus.groovy.ast.stmt.BlockStatement
|
getExistingOrCreateJUnit4Setup(org.codehaus.groovy.ast.ClassNode classNode)
|
protected java.lang.Class
|
getMixinClassForArtefactType(org.codehaus.groovy.ast.ClassNode classNode)
|
protected org.codehaus.groovy.ast.stmt.BlockStatement
|
getOrCreateTestSetupMethod(org.codehaus.groovy.ast.ClassNode classNode)
|
ResourceLocator
|
getResourceLocator()
|
void
|
testFor(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ClassExpression ce)
Main entry point for the calling the TestForTransformation programmatically. |
void
|
visit(org.codehaus.groovy.ast.ASTNode[] astNodes, org.codehaus.groovy.control.SourceUnit source)
|
protected void
|
weaveMixinClass(org.codehaus.groovy.ast.ClassNode classNode, java.lang.Class mixinClass)
|
protected org.codehaus.groovy.ast.MethodNode
|
weaveMock(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ClassExpression value, boolean isClassUnderTest)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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.AnnotationNode AFTER_ANNOTATION
public static final org.codehaus.groovy.ast.ClassNode AFTER_CLASS_NODE
public static final org.codehaus.groovy.ast.AnnotationNode BEFORE_ANNOTATION
public static final org.codehaus.groovy.ast.ClassNode BEFORE_CLASS_NODE
public static final java.lang.String DOMAIN_TYPE
public static final org.codehaus.groovy.ast.ClassNode GROOVY_TEST_CASE_CLASS
public static final org.codehaus.groovy.ast.AnnotationNode TEST_ANNOTATION
public static final java.lang.String VOID_TYPE
protected static final java.util.Map artefactTypeToTestMap
Method Detail |
---|
protected org.codehaus.groovy.ast.MethodNode addClassUnderTestMethod(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ClassExpression targetClass, java.lang.String type)
protected void addMockCollaborator(java.lang.String mockType, org.codehaus.groovy.ast.expr.ClassExpression targetClass, org.codehaus.groovy.ast.stmt.BlockStatement methodBody)
protected void addMockCollaborators(org.codehaus.groovy.ast.ClassNode classNode, java.lang.String mockType, java.util.List targetClasses)
protected void addMockCollaborators(java.lang.String mockType, java.util.List targetClasses, org.codehaus.groovy.ast.stmt.BlockStatement methodBody)
protected org.codehaus.groovy.ast.stmt.Statement getExistingJUnit4BeforeMethod(org.codehaus.groovy.ast.ClassNode classNode)
protected org.codehaus.groovy.ast.stmt.BlockStatement getExistingOrCreateJUnit4Setup(org.codehaus.groovy.ast.ClassNode classNode)
protected java.lang.Class getMixinClassForArtefactType(org.codehaus.groovy.ast.ClassNode classNode)
protected org.codehaus.groovy.ast.stmt.BlockStatement getOrCreateTestSetupMethod(org.codehaus.groovy.ast.ClassNode classNode)
public ResourceLocator getResourceLocator()
public void testFor(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ClassExpression ce)
classNode
- The class node that represents th testce
- The class expression that represents the class to test
@Override public void visit(org.codehaus.groovy.ast.ASTNode[] astNodes, org.codehaus.groovy.control.SourceUnit source)
protected void weaveMixinClass(org.codehaus.groovy.ast.ClassNode classNode, java.lang.Class mixinClass)
protected org.codehaus.groovy.ast.MethodNode weaveMock(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.expr.ClassExpression value, boolean isClassUnderTest)
Groovy Documentation