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 FileSystemCompilerTest extends GroovyTestCase { 62 63 FileSystemCompiler 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(new File [] { file }); 80 } 81 82 protected void setUp() throws Exception { 83 File dir = new File ("target/test-generated-classes"); 84 dir.mkdirs(); 85 86 CompilerConfiguration configuration = new CompilerConfiguration(); 87 configuration.setTargetDirectory(dir); 88 configuration.setVerbose(dumpClass); 89 90 compiler = new FileSystemCompiler( configuration ); 91 } 92 93 } 94 | Popular Tags |