Grails

Integration tests won't run after installing JSecurity plugin

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-RC4
  • Fix Version/s: None
  • Component/s: Plugins, Testing
  • Labels:
    None
  • Environment:
    Mac OS X 10.5.1

Description

After installing the JSecurity plugin, integration tests stop cooperating:

Error executing tests No such property: realmClasses for class: org.codehaus.groovy.grails.commons.DefaultGrailsApplication ... 
groovy.lang.MissingPropertyException: No such property: realmClasses for class: org.codehaus.groovy.grails.commons.DefaultGrailsApplication

Also see thread http://www.nabble.com/JSecurity-Plugin-vs.-Integration-Tests-to14653797.html#a14653797

Here's an example using an app built from scratch:

> grails create-app sample
Welcome to Grails 1.0-RC4-SNAPSHOT - http://grails.org/
...
> cd sample/
...
> grails create-domain-class foo
...
> grails test-app
...
Running 1 Integration Test...
Running test FooTests...
                    testSomething...SUCCESS
Integration Tests Completed in 383ms
...
Tests passed. View reports in /private/tmp/sample/test/reports

> grails install-plugin jsecurity
...
Plugin jsecurity-0.1.1 installed
Plug-in provides the following new scripts:
------------------------------------------

> grails create-db-realm
...
> grails test-app
...
Loading with installed plug-ins: ["JsecurityGrailsPlugin"] ...
[0] spring.GrailsWebApplicationContext Refreshing org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext@76acee: display name [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext@76acee]; startup date [Tue Jan 08 20:47:13 EST 2008]; root of context hierarchy
[1] spring.GrailsWebApplicationContext Bean factory for application context [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext@76acee]: org.springframework.beans.factory.support.DefaultListableBeanFactory@57ba95
No tests found in test/unit to execute ...
Error executing tests No such property: realmClasses for class: org.codehaus.groovy.grails.commons.DefaultGrailsApplication ...
groovy.lang.MissingPropertyException: No such property: realmClasses for class: org.codehaus.groovy.grails.commons.DefaultGrailsApplication
...
Error running tests: groovy.lang.MissingPropertyException: No such property: realmClasses for class: org.codehaus.groovy.grails.commons.DefaultGrailsApplication
>

Activity

Hide
Peter Ledbrook added a comment -

If you don't mind modifying the Grails script files, a quick hack is to add the marked line to TestApp.groovy:

target(runUnitTests: "Run Grails' unit tests under the test/unit directory") {
   try {
       PluginManagerHolder.pluginManager = null  // <<<< Add this line here
       loadApp()

       pluginManager.getGrailsPlugin("core")?.doWithDynamicMethods(appCtx)
       pluginManager.getGrailsPlugin("logging")?.doWithDynamicMethods(appCtx)
Show
Peter Ledbrook added a comment - If you don't mind modifying the Grails script files, a quick hack is to add the marked line to TestApp.groovy:
target(runUnitTests: "Run Grails' unit tests under the test/unit directory") {
   try {
       PluginManagerHolder.pluginManager = null  // <<<< Add this line here
       loadApp()

       pluginManager.getGrailsPlugin("core")?.doWithDynamicMethods(appCtx)
       pluginManager.getGrailsPlugin("logging")?.doWithDynamicMethods(appCtx)
Hide
Peter Ledbrook added a comment -

I'm not sure what the problem is, but I haven't had any problems running integration tests with the JSecurity plugin installed, so I'm assuming this has been fixed. As usual, re-open if it can still be reproduced.

Show
Peter Ledbrook added a comment - I'm not sure what the problem is, but I haven't had any problems running integration tests with the JSecurity plugin installed, so I'm assuming this has been fixed. As usual, re-open if it can still be reproduced.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: