How to test Hello World
How to test Hello World
Summary
How to test a simple groovy program that produces output.
HelloWorld.groovy
println 'Hello World'
HelloWorldTest.gant
@GrabResolver(name='atlassian', root='https://maven.atlassian.com/content/groups/public/') @Grab(group='org.swift.tools', module='gint', version='1.4.0') import org.swift.tools.* includeTool << Gint gint.initialize(this) // required gint.setCmdGenerator('groovy', [file: 'helloWorld.groovy']) // set default cmd generator to call the script gint.add(name: 'hello', data: 'Hello World') // confirm that Hello World is produced by the script gint.finalizeTest() // final preparations for running tests
Output
gant -f helloWorldTest.gant = = = = = = helloWorldTest started at Fri Feb 25 21:13:08 CST 2011 = = = = = = [start] hello [ending] hello [complete] hello - 1.179 secs [info] Successful testcases . . . . . . . . . . : 1 <<< TEST SUCCESSFUL [info] Total testcases . . . . . . . . . . . . . : 1 [info] Elapsed run time . . . . . . . . . . . . : 3.054 secs = = = = = = helloWorldTest completed at Fri Feb 25 21:13:09 CST 2011 = = = = = = BUILD SUCCESSFUL Total time: 5.53 seconds
, multiple selections available,
Related content
How to use GINT for unit testing
How to use GINT for unit testing
More like this
How to run Selenium as a GINT test
How to run Selenium as a GINT test
More like this
How to run final code at the end of the test
How to run final code at the end of the test
More like this
Groovy script tester in JMWE
Groovy script tester in JMWE
More like this
How to add GINT integration test to Maven build
How to add GINT integration test to Maven build
More like this
How to get on board with Groovy
How to get on board with Groovy
More like this