1 46 47 package org.codehaus.groovy.classgen; 48 49 import groovy.util.GroovyTestCase; 50 51 56 public class BytecodeHelperTest extends GroovyTestCase { 57 58 public void testTypeName() { 59 assertEquals("[C", BytecodeHelper.getTypeDescription("char[]")); 60 } 61 62 public void testMethodDescriptor() { 63 String answer = BytecodeHelper.getMethodDescriptor(char[].class, new Class [0]); 64 assertEquals("()[C", answer); 65 66 answer = BytecodeHelper.getMethodDescriptor(int.class, new Class [] { long.class }); 67 assertEquals("(J)I", answer); 68 69 answer = BytecodeHelper.getMethodDescriptor(String [].class, new Class [] { String .class, int.class }); 70 assertEquals("(Ljava/lang/String;I)[Ljava/lang/String;", answer); 71 } 72 } 73 | Popular Tags |