@Override public Object invokeMethod(String name, Object args) { try { return delegate.invokeMethod(name,args); } catch (MissingMethodException mme) { return super.invokeMethod(name, args); } }
public void build(final GroovyObject builder) { builder.getProperty("mkp"); builder.invokeMethod("yield", new Object[]{this.value}); }
public void testBytecode4Bug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/Bytecode4Bug.groovy"); object.invokeMethod("testInject", null); object.invokeMethod("testUsingProperty", null); }
public void build(final GroovyObject builder) { builder.getProperty("mkp"); builder.invokeMethod("yield", new Object[]{text()}); } }
public void testConstructor() throws Exception { GroovyObject object = compile("src/test/groovy/NewExpressionTest.groovy"); object.invokeMethod("testNewInstance", null); } }
private void buildChildren(final GroovyObject builder, final Map namespaceMap, final Map<String, String> namespaceTagHints) { for (Object child : this.children) { if (child instanceof Node) { ((Node) child).build(builder, namespaceMap, namespaceTagHints); } else if (child instanceof Buildable) { ((Buildable) child).build(builder); } else { builder.getProperty("mkp"); builder.invokeMethod("yield", new Object[]{child}); } } } }
public void testGuillaumesMapBug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/GuillaumesMapBug.groovy"); object.invokeMethod("testBug", null); }
public void testArrayBug() throws Exception { GroovyObject object = compile("src/test/groovy/ToArrayBugTest.groovy"); object.invokeMethod("testToArrayBug", null); }
public void testClosureWithDefaultParam() throws Exception { GroovyObject object = compile("src/test/groovy/ClosureWithDefaultParamTest.groovy"); object.invokeMethod("methodWithDefaultParam", null); }
public void testZoharsBug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/ZoharsBug.groovy"); object.invokeMethod("testBug", null); }
public void testBytecode2Bug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/Bytecode2Bug.groovy"); object.invokeMethod("testTedsBytecodeBug", null); }
public void testRodsBug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/RodsBug.groovy"); object.invokeMethod("testBug", null); }
public void testCastBug() throws Exception { GroovyObject object = compile("src/test/groovy/ClosureMethodCallTest.groovy"); object.invokeMethod("testCallingClosureWithMultipleArguments", null); }
public void testPrimitiveTypeFieldTest() throws Exception { GroovyObject object = compile("src/test/groovy/PrimitiveTypeFieldTest.groovy"); object.invokeMethod("testPrimitiveField", null); }
public void testClosureVariableBug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/ClosureVariableBug.groovy"); object.invokeMethod("testBug", null); }
public void testClosureParameterPassingBug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/ClosureParameterPassingBug.groovy"); object.invokeMethod("testBug", null); }
public void testByteIndexBug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/ByteIndexBug.groovy"); object.invokeMethod("testBug", null); }
public void testGroovy252_Bug() throws Exception { GroovyObject object = compile("src/test/groovy/bugs/Groovy252_Bug.groovy"); object.invokeMethod("testBug", null); }
@Test public void testLoadGroovyFromString() { GroovyCompiler compiler = spy(new GroovyCompiler()); try { String code = "class test { public String hello(){return \"hello\" } } "; Class clazz = compiler.compile(code, "test"); assertNotNull(clazz); assertEquals(clazz.getName(), "test"); GroovyObject groovyObject = (GroovyObject) clazz.newInstance(); Object[] args = {}; String s = (String) groovyObject.invokeMethod("hello", args); assertEquals(s, "hello"); } catch (Exception e) { assertFalse(true); } } }
@Test public void testLoadGroovyFromString() { GroovyCompiler compiler = spy(new GroovyCompiler()); try { String code = "class test { public String hello(){return \"hello\" } } "; Class clazz = compiler.compile(code, "test"); assertNotNull(clazz); assertEquals(clazz.getName(), "test"); GroovyObject groovyObject = (GroovyObject) clazz.newInstance(); Object[] args = {}; String s = (String) groovyObject.invokeMethod("hello", args); assertEquals(s, "hello"); } catch (Exception e) { assertFalse(true); } } }