This page (revision-3) was last changed on 12-Sep-2020 22:16 by Albrecht Striffler

This page was created on 17-Dec-2012 14:57 by Daniel Zügner

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
3 12-Sep-2020 22:16 6 KB Albrecht Striffler to previous
2 17-Dec-2012 14:57 7 KB Daniel Zügner to previous | to last
1 17-Dec-2012 14:57 7 KB Daniel Zügner to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 92 removed one line
!Writing testcases in Groovy directly in the wiki
At line 94 removed 29 lines
Tests can also be written directly in the wiki, using the dynamic language [Groovy|http://groovy.codehaus.org/]. You just have to implement the call() method as you would with java, wrap around the source code in and specify the {{@name}} annotation:
{{{
%%CITest
public CITestResult call() {
.....
}
@name: TestName
%
}}}
__Example__:
%%prettify
{{{
%%CITest
public CITestResult call() {
if (config.getMonitoredArticleTitle().length() < 20)
new CITestResult(SUCCESSFUL)
else new CITestResult(FAILED, "Title longer than 20 Characters!")
}
@name: TrivialCITestGroovy
%
}}}
/%
As you can see, Groovy supports a much more simpler and easier syntax, but you [loose a lot of static typing and compile time checking safety|http://groovy.codehaus.org/Runtime+vs+Compile+time%2C+Static+vs+Dynamic] due to the runtime execution and compilation of groovy. Be sure to test your test-code before productive usage :-)