1 46 47 package org.codehaus.groovy.tools; 48 49 import groovy.util.GroovyTestCase; 50 51 import java.io.File ; 52 53 import org.codehaus.groovy.control.CompilerConfiguration; 54 55 61 public class CompilerTest extends GroovyTestCase { 62 63 Compiler compiler = null; 64 boolean dumpClass = true; 65 66 public void testMethodCall() throws Exception { 67 runTest("tree/SmallTreeTest.groovy"); 71 } 73 74 protected void runTest(String name) throws Exception { 75 File file = new File ("src/test/groovy/" + name); 76 77 assertTrue("Could not find source file: " + file, file.exists()); 78 79 compiler.compile(file); 80 } 81 82 protected void setUp() throws Exception { 83 File dir = new File ("target/test-generated-classes"); 84 dir.mkdirs(); 85 86 CompilerConfiguration config = new CompilerConfiguration(); 87 config.setDebug( dumpClass ); 88 89 compiler = new Compiler ( config ); 90 } 91 92 } 93 | Popular Tags |