Hjem   |   Kontakt   |   Sitemap
Hvem er vi Hvad kan vi Vores kunder Ledige stillinger Kontakt os Blog

Console output from Grails tests

Published Thursday, September 24th, 2009 by AN

For casual testing in Grails, it would be nice to be able to just have the output of the tests dumped to the console that the tests were run from. This doesn’t seem possible in the default setup, but adding these lines

		if(argsMap['no-reports']){
			println testRunner.out.toString()
			println testRunner.err.toString()
		}

should do the trick, if you add them to $GRAILS_HOME/script/_GrailsTest.groovy in the “runTests” closure, right after ” def result = testRunner.runTests(testSuite)

With those lines in place you can run your test like


grails -Dserver.port=9090 test-app -integration -no-reports MyController


Specifying the name of the class to test is important since only the output from the last test class will be printed. So we might as well only run one.

Leave a Reply

Creating, consuming and testing SOAP webservices on Grails

Friday, February 12th, 2010
We are currently making a backend system, that has its services exposed as webservices. Since ...

My first patch to Grails accepted

Monday, November 23rd, 2009
I recently wrote a patch for Grails to support dateCreated and lastUpdated when using mockDomain ...
 
© 2008 Code3 ApS  |  Rådmandsgade 45A, 1.  |  2200 København N  |  +45 7020 3383  |  kontakt@code3.dk