[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-user
Subject:    Re: [groovy-user] Re: Setting Junit properties in Groovy without
From:       Jochen Theodorou <blackdrag () gmx ! org>
Date:       2011-08-26 9:46:03
Message-ID: 4E576B5B.4070805 () gmx ! org
[Download RAW message or body]

I am answering here, because I don't see the message from BrianGardner 
since it was send through nabble and without having an account here.

Anyway... If you want to set the JUnit property, then you are talking 
about setting the property of the ant tast. In that case you have to 
init the JUnit task and then run it in matter comparable to ant. setting 
the property is then really only setting at property like in Groovy 
normally, because there is a set method for that on the junit ant task 
class.

if you want to run completely without ant, then I would probably use the 
result object from JUnitCore#runClasses for example and make an output 
according to the Result object from there. That's how GroovyShell does 
it, only that GroovyShell does not provide any way to set a custom 
formatter of some kind.

bye blackdrag

Am 26.08.2011 07:42, schrieb Peter Niederwieser:
> JUnit itself doesn't have a concept of "formatters". (Likewise, JUnit doesn't
> know anything about XML or HTML test reports.) It's the tool that drives
> JUnit (Ant, Maven, 'groovy' command. etc.) that may or may not provide such
> a feature. Whereas Ant and Maven let you customize their output, the
> 'groovy' command doesn't . You could, however, take its code as a starting
> point and adapt the output to your needs. See class
> org.codehaus.groovy.vmplugin.v5.JUnit4Utils.
> 
> Cheers,
> Peter
> 
> 
> BrianGardner wrote:
> > 
> > I need to set the formatter for JUnit 4 in a Groovy script. I'm not, in
> > this instance, using Ant, Gant, Maven, it's just a simple Groovy script.
> > 
> > Is there a way to set the JUnit property for the formatter directly in the
> > Groovy code?
> > 
> > Brian Gardner
> > 
> 
> 
> --
> View this message in context: \
> http://groovy.329449.n5.nabble.com/Setting-Junit-properties-in-Groovy-without-Gant-tp4735405p4737049.html
>  Sent from the groovy - user mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
> http://xircles.codehaus.org/manage_email
> 
> 


-- 
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead
http://blackdragsview.blogspot.com/
For Groovy programming sources visit http://groovy.codehaus.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic