use of groovy.lang.GroovyShell in project groovy by apache.
the class MainTest method testMainMethod.
public void testMainMethod() throws Exception {
GroovyShell shell = new GroovyShell();
shell.run(new File("src/test/groovy/SampleMain.groovy"), new String[] { "A", "B", "C" });
}
use of groovy.lang.GroovyShell in project groovy by apache.
the class UnimplementedSyntaxTest method test_StaticImport1.
// -----------------------
// feature: static imports
// -----------------------
// TODO: move somewhere else
public void test_StaticImport1() throws Exception {
//GROOVY-3711: The following call now results in a valid script class node, so foo.Bar needs to get resolved.
GroovyShell groovyShell = new GroovyShell();
compile("package foo; class Bar{}", groovyShell);
assertNotNull(compile("import static foo.Bar.mooky", groovyShell));
}
use of groovy.lang.GroovyShell in project groovy by apache.
the class Groovy7826Bug method testComplexTypeArguments.
public void testComplexTypeArguments() throws Exception {
String script = "def f(org.codehaus.groovy.ast.Groovy7826Bug.C1 c1) { }";
CompilerConfiguration config = new CompilerConfiguration();
config.getOptimizationOptions().put("asmResolving", false);
GroovyShell shell = new GroovyShell(config);
shell.evaluate(script, "bug7826.groovy");
}
use of groovy.lang.GroovyShell in project groovy by apache.
the class Groovy2553Bug method testMe.
public void testMe() {
new GroovyShell().evaluate("groovy.bugs.Autobox.Util.printByte(\"1\", Byte.valueOf((byte)1));");
new GroovyShell().evaluate("groovy.bugs.Autobox.Util.printByte(\"1\", (byte)1);");
}
use of groovy.lang.GroovyShell in project groovy by apache.
the class SeansBug method testMarkupBug.
public void testMarkupBug() throws Exception {
String[] lines = { "package groovy.xml", "", "b = new MarkupBuilder()", "", "b.root1(a:5, b:7) { ", " elem1('hello1') ", " elem2('hello2') ", " elem3(x:7) ", "}" };
String code = asCode(lines);
GroovyShell shell = new GroovyShell();
shell.evaluate(code);
}
Aggregations