@Test(expected = RuntimeException.class) public void should_not_register_pure_java_object() { world.registerWorld("JAVA"); }
public void registerWorld(Object world) { if (world instanceof GroovyObject) { worlds.add((GroovyObject) world); } else { throw new RuntimeException("Only GroovyObject supported"); } }
GroovyWorld extends GroovyObjectSupport { public void registerWorld(Object world) { if (world instanceof GroovyObject) { worlds.add((GroovyObject) world); } else { throw new RuntimeException("Only GroovyObject supported"); } } }
GroovyWorld extends GroovyObjectSupport { public void registerWorld(Object world) { if (world instanceof GroovyObject) { worlds.add((GroovyObject) world); } else { throw new RuntimeException("Only GroovyObject supported"); } } GroovyWorld(); }
GroovyWorld extends GroovyObjectSupport { public void registerWorld(Object world) { if (world instanceof GroovyObject) { worlds.add((GroovyObject) world); } else { throw new RuntimeException("Only GroovyObject supported"); } } GroovyWorld(); void registerWorld(Object world); Object getProperty(String property); void setProperty(String property, Object newValue); Object invokeMethod(String name, Object args); }
GroovyWorld extends GroovyObjectSupport { public void registerWorld(Object world) { if (world instanceof GroovyObject) { worlds.add((GroovyObject) world); } else { throw new RuntimeException("Only GroovyObject supported"); } } GroovyWorld(); void registerWorld(Object world); Object getProperty(String property); void setProperty(String property, Object newValue); Object invokeMethod(String name, Object args);  }