|
Groovy example source code file (MethodNodeTest.groovy)
The Groovy MethodNodeTest.groovy source code
package 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: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.