public void testMethodCall() throws Exception { runTest(new String[] {"ClosureMethodTest.groovy"}); runTest(new String[] {"tree/VerboseTreeTest.groovy"}); runTest(new String[] {"tree/NestedClosureBugTest.groovy"}); runTest(new String[] {"tree/SmallTreeTest.groovy"}); runTest(new String[] {"LittleClosureTest.groovy"}); runTest(new String[] {"JointJava.java", "JointGroovy.groovy"}); }
protected void runTest(String[] names) throws Exception { List files = new ArrayList(); for (int i = 0; i < names.length; i++) { String name = names[i]; File file = new File("src/test/groovy/" + name); files.add(file); assertTrue("Could not find source file: " + file, file.exists()); } compiler.compile((File[]) files.toArray(new File[names.length])); }
public void testCommandLine() throws Exception { try { FileSystemCompiler.commandLineCompile(new String[] {"--bogus-option"}); fail("Compiler fails to reject bogus command line"); } catch (Exception re) { // this is why shouldFail {} exists in Groovy tests } File dir = new File("target/test-generated-classes/cl"); dir.mkdirs(); FileSystemCompiler.commandLineCompile(new String[] {"src/test/groovy/LittleClosureTest.groovy", "-d", dir.getPath()}); }