grails.test
Class GrailsAwareGroovyTestSuite

java.lang.Object
  extended by junit.framework.TestSuite
      extended by groovy.util.GroovyTestSuite
          extended by grails.test.GrailsAwareGroovyTestSuite
All Implemented Interfaces:
junit.framework.Test

public class GrailsAwareGroovyTestSuite
extends groovy.util.GroovyTestSuite

Adds support for running Grails JUnit Tests from Eclipse JUnit runner or even from the command line. Set GRAILS_HOME environment variable before running the test. Change the working directory to the Grails application's root directory. There are several extension points (protected template methods customize*) for customizing behaviour in a subclass. You will have to copy&paste the suite() and main() methods to the subclass because they are static methods Contributed by Lari Hotari

Since:
1.1
Author:
Graeme Rocher, Lari Hotari

Field Summary
protected  boolean registerContextClassLoader
           
 
Fields inherited from class groovy.util.GroovyTestSuite
file, loader
 
Constructor Summary
GrailsAwareGroovyTestSuite()
           
 
Method Summary
 Class compile(String fileName)
           
protected  void customizeBuildSettings(BuildSettings grailsSettings)
           
protected  void customizeClassInjectors(List<ClassInjector> classInjectors)
           
protected  void customizeClassLoader(GrailsAwareClassLoader gcl)
           
protected  void customizeGrailsResources(List<Resource> grailsResources)
           
protected  File findBaseDir()
           
protected  File findGrailsHome()
           
static void main(String[] args)
           
static junit.framework.Test suite()
           
 
Methods inherited from class groovy.util.GroovyTestSuite
loadTestSuite
 
Methods inherited from class junit.framework.TestSuite
addTest, addTestSuite, countTestCases, createTest, getName, getTestConstructor, run, runTest, setName, testAt, testCount, tests, toString, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

registerContextClassLoader

protected boolean registerContextClassLoader
Constructor Detail

GrailsAwareGroovyTestSuite

public GrailsAwareGroovyTestSuite()
Method Detail

customizeClassLoader

protected void customizeClassLoader(GrailsAwareClassLoader gcl)

customizeClassInjectors

protected void customizeClassInjectors(List<ClassInjector> classInjectors)

customizeGrailsResources

protected void customizeGrailsResources(List<Resource> grailsResources)

findBaseDir

protected File findBaseDir()

findGrailsHome

protected File findGrailsHome()

customizeBuildSettings

protected void customizeBuildSettings(BuildSettings grailsSettings)

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)

compile

public Class compile(String fileName)
              throws Exception
Overrides:
compile in class groovy.util.GroovyTestSuite
Throws:
Exception


Copyright (c) 2005-2009 The Grails project