You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Renaud Richardet <re...@gmail.com> on 2014/08/18 23:30:13 UTC

Ruta - best practices for unit tests?

Hello,

What are best practices for writing unit tests for Ruta?

Ideally, I would like to have 1) tests that can be run on the command line
(so as to automate them in Jenkins), and 2) where input and expected output
can be edited in a text editor (meaning: not xmi's or java code).

For 1), I was thinking about writing a script to automate testing
For 2), I was about to write the expected output in a simple xml or json
format, but if something already exists, that would be great.

Thanks, Renaud

Re: Ruta - best practices for unit tests?

Posted by Alexandre Patry <al...@keatext.com>.
Hi Renaud,

On 14-08-18 05:30 PM, Renaud Richardet wrote:
> Hello,
>
> What are best practices for writing unit tests for Ruta?
>
> Ideally, I would like to have 1) tests that can be run on the command line
> (so as to automate them in Jenkins), and
We use JUnit and it works quite well for us. I have a small example 
project on github with a RUTA script and its unit test 
(https://github.com/apatry/ruta-with-maven). You can also look at RUTA 
test suite if you want more examples 
(http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-core/src/test/java/org/apache/uima/ruta/).
> 2) where input and expected output
> can be edited in a text editor (meaning: not xmi's or java code).
Is there a reason why you want to avoid Java code for unit tests? 
Building and inspecting CAS in Java for each test allow a lot of 
flexibility and makes it possible to test each analysis engine outside 
of its pipeline. And uimaFIT is an excellent tool for that 
(http://uima.apache.org/uimafit.html).

Hope this help,

Alexandre

-- 
Alexandre Patry, Ph.D
Chercheur / Researcher
http://KeaText.com


Re: Ruta - best practices for unit tests?

Posted by Peter Klügl <pk...@uni-wuerzburg.de>.
Hi,

in addition to alexandre's reply:

We normally use the Annotation Testing view in the Ruta Workbench for
only testing the functionality of rules for an application (not the ruta
implementation), but view builts on xmi and supports no text specification.

If you implement something, consider to contribute it :-)

Best,

Peter

Am 18.08.2014 23:30, schrieb Renaud Richardet:
> Hello,
>
> What are best practices for writing unit tests for Ruta?
>
> Ideally, I would like to have 1) tests that can be run on the command line
> (so as to automate them in Jenkins), and 2) where input and expected output
> can be edited in a text editor (meaning: not xmi's or java code).
>
> For 1), I was thinking about writing a script to automate testing
> For 2), I was about to write the expected output in a simple xml or json
> format, but if something already exists, that would be great.
>
> Thanks, Renaud
>