Catch assertion exceptions in Groovy
If you would like to handle the exception raised from an assert you can use the following snippet.
(more…)
The inject method of list
The inject method of the list can be used for summing up the list contents.
(more…)
Execute external programs
This example executes an external program as an process in groovy.
(more…)
Named parameters in groovy
Overloaded constructors in Groovy
Read from stdin
Read lines from stdin and print in on stdout. Terminate the program when “exit” is entered.
(more…)
Read the first line of a file
Snippet to read the first line of a file in Groovy.
(more…)
Run a Timer in the future
Howto run a Timer in the future.
(more…)
Example Timer and TimerTask in Groovy
This is an example of the Timer and TimerTask in Groovy.
(more…)
SSH with Groovy and Antbuilder
This examples show how to use the ant ssh task with the Antbuilder in groovy.
(more…)