History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-2153
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Jason Rudolph
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Grails

Integration tests won't run after installing JSecurity plugin

Created: 08/Jan/08 07:49 PM   Updated: 14/May/08 12:32 PM
Component/s: Plugins, Testing
Affects Version/s: 1.0-RC4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive sample-bug-report-08012008.zip (25 kb)

Environment: Mac OS X 10.5.1


 Description  « Hide
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
>


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Peter Ledbrook - 09/Jan/08 12:18 AM
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)

Peter Ledbrook - 14/May/08 12:32 PM
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.