Resources plugin causing problems with functional tests

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Resources plugin causing problems with functional tests

Paul Fairless-3
Hi,

Hitting an issue where by I can't run my functional (Geb) tests locally. The problem seems to be that the grails-resources plugin disables itself in the test environment, but the <r:layoutResources> tag throws an exception due to missing resource definitions. 


Question is - are there any workarounds? I miss being able to run a simple test-app

TIA
Paul
Reply | Threaded
Open this post in threaded view
|

Re: Resources plugin causing problems with functional tests

ld@ldaley.com
I use the resources plugin with Geb, no problem. 

What versions are you using?

On 18/03/2011, at 8:50 AM, Paul Fairless wrote:

Hi,

Hitting an issue where by I can't run my functional (Geb) tests locally. The problem seems to be that the grails-resources plugin disables itself in the test environment, but the <r:layoutResources> tag throws an exception due to missing resource definitions. 


Question is - are there any workarounds? I miss being able to run a simple test-app

TIA
Paul

Reply | Threaded
Open this post in threaded view
|

Re: Resources plugin causing problems with functional tests

Paul Fairless-3
1.0-RC1b 

i get the same behaviour if i set grails.resources.debug=true in development. Are you using the layoutResources tag in your gsp?

On 17 March 2011 23:05, Luke Daley <[hidden email]> wrote:
I use the resources plugin with Geb, no problem. 

What versions are you using?

On 18/03/2011, at 8:50 AM, Paul Fairless wrote:

Hi,

Hitting an issue where by I can't run my functional (Geb) tests locally. The problem seems to be that the grails-resources plugin disables itself in the test environment, but the <r:layoutResources> tag throws an exception due to missing resource definitions. 


Question is - are there any workarounds? I miss being able to run a simple test-app

TIA
Paul


Reply | Threaded
Open this post in threaded view
|

Re: Resources plugin causing problems with functional tests

ld@ldaley.com

On 18/03/2011, at 9:29 AM, Paul Fairless wrote:

1.0-RC1b 

i get the same behaviour if i set grails.resources.debug=true in development. Are you using the layoutResources tag in your gsp?

I do.

I can't think of what the difference would be. What error do you get? It can't find the source files for the modules?
Reply | Threaded
Open this post in threaded view
|

Re: Resources plugin causing problems with functional tests

Paul Fairless-3
Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag <r:layoutResources>: No module found with name [main] at /Users/paul/Dev/less-test/grails-app/views/index.gsp:53
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.handleException(GroovyPageView.java:180)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderWithTemplateEngine(GroovyPageView.java:153)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderMergedOutputModel(GroovyPageView.java:81)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.renderViewForUrlMappingInfo(UrlMappingsFilter.java:260)
... 36 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <r:layoutResources>: No module found with name [main] at /Users/paul/Dev/less-test/grails-app/views/index.gsp:53

If I run-app normally everything works fine. My problem seems to be in the resourceService - reload method:
def reload() {
        // @todo remove this environment check when servletContext in integ test issues in Grails are fixed
        def weAreGoingToRun = (Environment.current != Environment.TEST) &&
            !getConfigParamOrDefault('debug', false) 

        if (weAreGoingToRun) {
            log.info("Performing a full reload")
            resourceMappers = ResourceMappersFactory.createResourceMappers(grailsApplication, config.mappers)
            loadResources()
        } else {
            log.info("Skipping resource reload, grails.resources.debug is set to true or running in TEST environment")
        }
    }

On 18 March 2011 02:43, Luke Daley <[hidden email]> wrote:

On 18/03/2011, at 9:29 AM, Paul Fairless wrote:

1.0-RC1b 

i get the same behaviour if i set grails.resources.debug=true in development. Are you using the layoutResources tag in your gsp?

I do.

I can't think of what the difference would be. What error do you get? It can't find the source files for the modules?

Reply | Threaded
Open this post in threaded view
|

Re: Resources plugin causing problems with functional tests

ld@ldaley.com
You are using an old version of the plugin. This was fixed a while ago:


Try using 1.0-RC2-SNAPSHOT, which you will have to install by specifying the version number explicitly as it was released as a snapshot.

Marc: probably time to release RC2 proper.

On 18/03/2011, at 7:51 PM, Paul Fairless wrote:

Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag <r:layoutResources>: No module found with name [main] at /Users/paul/Dev/less-test/grails-app/views/index.gsp:53
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.handleException(GroovyPageView.java:180)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderWithTemplateEngine(GroovyPageView.java:153)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderMergedOutputModel(GroovyPageView.java:81)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.renderViewForUrlMappingInfo(UrlMappingsFilter.java:260)
... 36 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <r:layoutResources>: No module found with name [main] at /Users/paul/Dev/less-test/grails-app/views/index.gsp:53

If I run-app normally everything works fine. My problem seems to be in the resourceService - reload method:
def reload() {
        // @todo remove this environment check when servletContext in integ test issues in Grails are fixed
        def weAreGoingToRun = (Environment.current != Environment.TEST) &&
            !getConfigParamOrDefault('debug', false) 

        if (weAreGoingToRun) {
            log.info("Performing a full reload")
            resourceMappers = ResourceMappersFactory.createResourceMappers(grailsApplication, config.mappers)
            loadResources()
        } else {
            log.info("Skipping resource reload, grails.resources.debug is set to true or running in TEST environment")
        }
    }

On 18 March 2011 02:43, Luke Daley <[hidden email]> wrote:

On 18/03/2011, at 9:29 AM, Paul Fairless wrote:

1.0-RC1b 

i get the same behaviour if i set grails.resources.debug=true in development. Are you using the layoutResources tag in your gsp?

I do.

I can't think of what the difference would be. What error do you get? It can't find the source files for the modules?


Reply | Threaded
Open this post in threaded view
|

Re: Resources plugin causing problems with functional tests

Paul Fairless-3
Yep - that fixed my problem. 

Would be good to see a proper release of RC2 given it fixes this and the 1.3.7 compilation issue

Thanks for the help
Paul


On 19 March 2011 01:35, Luke Daley <[hidden email]> wrote:
You are using an old version of the plugin. This was fixed a while ago:


Try using 1.0-RC2-SNAPSHOT, which you will have to install by specifying the version number explicitly as it was released as a snapshot.

Marc: probably time to release RC2 proper.

On 18/03/2011, at 7:51 PM, Paul Fairless wrote:

Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag <r:layoutResources>: No module found with name [main] at /Users/paul/Dev/less-test/grails-app/views/index.gsp:53
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.handleException(GroovyPageView.java:180)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderWithTemplateEngine(GroovyPageView.java:153)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderMergedOutputModel(GroovyPageView.java:81)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.renderViewForUrlMappingInfo(UrlMappingsFilter.java:260)
... 36 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <r:layoutResources>: No module found with name [main] at /Users/paul/Dev/less-test/grails-app/views/index.gsp:53

If I run-app normally everything works fine. My problem seems to be in the resourceService - reload method:
def reload() {
        // @todo remove this environment check when servletContext in integ test issues in Grails are fixed
        def weAreGoingToRun = (Environment.current != Environment.TEST) &&
            !getConfigParamOrDefault('debug', false) 

        if (weAreGoingToRun) {
            log.info("Performing a full reload")
            resourceMappers = ResourceMappersFactory.createResourceMappers(grailsApplication, config.mappers)
            loadResources()
        } else {
            log.info("Skipping resource reload, grails.resources.debug is set to true or running in TEST environment")
        }
    }

On 18 March 2011 02:43, Luke Daley <[hidden email]> wrote:

On 18/03/2011, at 9:29 AM, Paul Fairless wrote:

1.0-RC1b 

i get the same behaviour if i set grails.resources.debug=true in development. Are you using the layoutResources tag in your gsp?

I do.

I can't think of what the difference would be. What error do you get? It can't find the source files for the modules?