groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anto Aravinth <anto.aravinth....@gmail.com>
Subject Help On Writing DSL
Date Tue, 18 Aug 2015 13:19:33 GMT
Hi All,



I'm planning to write an DSL for our application. Currently our application
uses TestNg to run the test cases. So they have testng.xml, which calls the
test cases etc. I have convinced our client to use groovy in-order to
support DSL test cases!



I want now the test cases to be written in DSL groovy language, with our
domain keywords. With this in mind, I have few questions, that need help
from the community:



        1. I have written a simple DSL, which is being called by the
GroovyShell evaluate method, which is working perfectly fine. Given the
fact that our team already uses TestNG to run the suite. Now how will I
direct testNg runner to call the scripts?

        2. For now, my simple DSL looks like this:



                testInternalAPI {

                        openTheConnection to DEV port

                        sendPOSTRequest with data {some:value}

                }



        Now I need to wrap this with @Test annotation of testng, so that,
when called from testng.xml, these will be identified as the testNg test
cases.Any idea how to solve this? I'm thinking of AST-transformations, but
any other ideas?

Thank you so much for your response.

Anto.

Mime
View raw message