[bs-24] Support multi-file compile from command line

* Each non-option arg is tested to see if it is a file
* If it is .groovy (or .java) it is compiled

[#48127661]
This commit is contained in:
Dave Syer
2013-04-29 15:18:45 +01:00
parent a5f7b6ead3
commit bb62ca835e
7 changed files with 118 additions and 45 deletions

View File

@@ -59,7 +59,7 @@ public class SampleIntegrationTests {
return this.output.toString();
}
private void start(final String sample) throws Exception {
private void start(final String... sample) throws Exception {
Future<RunCommand> future = Executors.newSingleThreadExecutor().submit(
new Callable<RunCommand>() {
@Override
@@ -94,12 +94,23 @@ public class SampleIntegrationTests {
@Test
public void jobSample() throws Exception {
start("samples/job.groovy");
start("samples/job.groovy", "foo=bar");
String output = getOutput();
assertTrue("Wrong output: " + output,
output.contains("completed with the following parameters"));
}
@Test
public void jobWebSample() throws Exception {
start("samples/job.groovy", "samples/web.groovy", "foo=bar");
String output = getOutput();
assertTrue("Wrong output: " + output,
output.contains("completed with the following parameters"));
String result = FileUtil.readEntirely(new URL("http://localhost:8080")
.openStream());
assertEquals("World!", result);
}
@Test
public void webSample() throws Exception {
start("samples/web.groovy");