Skip to content

Commit aeea0de

Browse files
author
pledbrook
committed
Fixed a problem with the 'messageSource' bean when running integration
tests. The MockServletContext created by Bootstrap is now initialised with 'web-app' as the base path and a FileSystemResourceLoader (before it used the default loader, which tried to load properties files from the classpath). git-svn-id: https://svn.codehaus.org/grails/trunk@6478 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent 861ac2d commit aeea0de

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/Bootstrap.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ target(loadApp:"Loads the Grails application object") {
4242

4343
appCtx = beanDefinitions.createApplicationContext()
4444
def ctx = appCtx
45-
servletContext = new MockServletContext()
45+
46+
// The mock servlet context needs to resolve resources relative to the 'web-app'
47+
// directory. We also need to use a FileSystemResourceLoader, otherwise paths are
48+
// evaluated against the classpath - not what we want!
49+
servletContext = new MockServletContext('web-app', new FileSystemResourceLoader())
4650
ctx.servletContext = servletContext
4751
grailsApp = ctx.grailsApplication
4852
ApplicationHolder.application = grailsApp

0 commit comments

Comments
 (0)