Hi all,


I'm trying to create some DSL for my application. And here is what I have done till now; The groovy script below calls the DSL after setting up the base script class etc.


def handler = new SeleniumCallHandler()

def binding = new Binding(driver: handler.getDriver(),seleniumcallhandler: handler)


def importCustomizer = new ImportCustomizer();



def config = new CompilerConfiguration();

config.addCompilationCustomizers importCustomizer

config.scriptBaseClass = SeleniumBaseScript.name




def shell = new GroovyShell(this.class.classLoader,binding,config)


shell.evaluate(new File("loadGroovyPage.groovy"))


and SeleniumBaseScript:

abstract class SeleniumBaseScript extends Script {

    @Delegate @Lazy SeleniumCallHandler seleniumcallhandler = this.binding.seleniumcallhandler




TestBehavior('test google home page' , {

    loAd "http://www.google.com"




the TestBehavior method is defined in SeleniumCallHandler. Like:


    def TestBehavior(def name,Closure cls)


        cls.delegate = this;




The above code in loadGroovypage works fine. But to make my DSL good, I tried this:


TestBehavior 'test google home page' , {

    loAd "http://www.google.com"




(same code without param's) And this code fails with message:


Error:(1, 13) Groovyc: unexpected token: test google home page on loadGroovyPage.groovy.


Where I'm making the mistake? Does the method call without params should work without any issues right?