|
Groovy example source code file (MethodNodeTest.groovy)
The Groovy MethodNodeTest.groovy source codepackage org.codehaus.groovy.ast; import org.codehaus.groovy.ast.stmt.BlockStatement; import org.objectweb.asm.Opcodes; import junit.framework.TestCase; /** * Tests the VariableExpressionNode * * @author <a href="mailto:martin.kempf@gmail.com">Martin Kempf * */ public class MethodNodeTest extends TestCase implements Opcodes { public void testIsDynamicReturnTypeExplizitObject() { MethodNode methodNode = new MethodNode("foo", ACC_PUBLIC, new ClassNode(Object.class), Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, new BlockStatement()); assertFalse(methodNode.isDynamicReturnType()); } public void testIsDynamicReturnTypeDYNAMIC_TYPE() { MethodNode methodNode = new MethodNode("foo", ACC_PUBLIC, ClassHelper.DYNAMIC_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, new BlockStatement()); assertTrue(methodNode.isDynamicReturnType()); } public void testIsDynamicReturnTypeVoid() { MethodNode methodNode = new MethodNode("foo", ACC_PUBLIC, ClassHelper.VOID_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, new BlockStatement()); assertFalse(methodNode.isDynamicReturnType()); } public void testIsDynamicReturnTypNull() { MethodNode methodNode = new MethodNode("foo", ACC_PUBLIC, null, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, new BlockStatement()); assertFalse(methodNode.isDynamicReturnType()); assertNotNull(methodNode.getReturnType()); } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy MethodNodeTest.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.