On Wed, 2010-06-09 at 16:42 +1000, Adam Murdoch wrote:
> 
> On 8/06/10 2:46 AM, Misha Koshelev wrote:
> > 0
> >
> > Dear All:
> >
> > Sorry this is probably a very simple question.
> >
> > I am using gradle http://www.gradle.org/ for my development environment.
> > It works quite well!
> >
> > I have written a simple unit test that uses HtmlUnit and my own package.
> >
> > For my own package, I use java.util.Logger.
> >
> > HtmlUnit seems to use commons logging:
> > http://htmlunit.sourceforge.net/logging.html
> >
> > I would like to see console output of my logging messages from
> > java.util.Logger
> >
> > However, it seems that even messages at the info level are not displayed
> > in my Unit Test Results GUI (System.err link), although the HtmlUnit
> > messages are all displayed.
> >
> > Please let me know if you have suggestions.
> >
> >    
> 
> You might try the Gradle 0.9-preview-3 release. There are a number of 
> fixes to using java.util.Logger from tests, which should solve your problem.
> 
> 

Thank you.

I figured out the answer here:
http://stackoverflow.com/questions/2991360/gradle-java-util-logging-logger-output-in-unit-tests

It turns out I need to initialize my logger inside a constructor or
method, but not directly

(i.e., 

class A {
   def logger=Logger.getLogger(this.class.name) 
}

does _not_ work when doing unit tests, but works fine otherwise.

But:

class A {
    def logger
    A() {
       logger=Logger.getLogger(this.class.name)
    } 

works fine.
)

Thank you!

Misha



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

    http://xircles.codehaus.org/manage_email


Reply via email to