use of org.codehaus.groovy.runtime.ScriptTestAdapter in project groovy-core by groovy.
the class GroovyTestSuite method loadTestSuite.
public void loadTestSuite() throws Exception {
String fileName = System.getProperty("test", file);
if (fileName == null) {
throw new RuntimeException("No filename given in the 'test' system property so cannot run a Groovy unit test");
}
System.out.println("Compiling: " + fileName);
Class type = compile(fileName);
String[] args = {};
if (!Test.class.isAssignableFrom(type) && Script.class.isAssignableFrom(type)) {
// let's treat the script as a Test
addTest(new ScriptTestAdapter(type, args));
} else {
addTestSuite(type);
}
}
use of org.codehaus.groovy.runtime.ScriptTestAdapter in project groovy by apache.
the class GroovyTestSuite method loadTestSuite.
public void loadTestSuite() throws Exception {
String fileName = System.getProperty("test", file);
if (fileName == null) {
throw new RuntimeException("No filename given in the 'test' system property so cannot run a Groovy unit test");
}
System.out.println("Compiling: " + fileName);
Class type = compile(fileName);
String[] args = {};
if (!Test.class.isAssignableFrom(type) && Script.class.isAssignableFrom(type)) {
// let's treat the script as a Test
addTest(new ScriptTestAdapter(type, args));
} else {
addTestSuite(type);
}
}
Aggregations