GroovyWorkspaceCompiler.of(targetDirectory, workspaceRoot, changedFilesDirectory); TreeParser parser = GroovyTreeParser.of(compiler, workspaceRoot, new WorkspaceUriSupplier(workspaceRoot, changedFilesDirectory)); DefaultCompilerWrapper groovycWrapper = new DefaultCompilerWrapper(compiler, parser);
@Before public void setup() throws IOException { workspaceRoot = tempFolder.newFolder(); Path changedOutput = tempFolder.newFolder().toPath(); Path target = tempFolder.newFolder().toPath(); uriSupplier = new WorkspaceUriSupplier(workspaceRoot.toPath(), changedOutput); parser = GroovyTreeParser.of(() -> { GroovyWorkspaceCompiler compiler = GroovyWorkspaceCompiler.of(target, workspaceRoot.toPath(), changedOutput); assertEquals(Sets.newHashSet(), compiler.compile(ImmutableSet.of())); return compiler.get(); }, workspaceRoot.toPath(), uriSupplier); }
@Test public void testWorkspaceRootNotFolder() throws IOException { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("workspaceRoot must be a directory"); GroovyTreeParser.of(() -> null, tempFolder.newFile().toPath(), uriSupplier); }