Quantcast

Domain class dynamic methods in integration tests

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Domain class dynamic methods in integration tests

martel9057
Recently upgraded to 2.1.0.RC2. When running integration tests, I get MissingMethodExceptions for the domain class dynamic methods (example below). It's odd that the method I'm trying to call is in the list of suggestions. I only get this running tests as well, so it might have something to do with my test environment configuration. Anyone know of anything obvious I might be doing wrong?

groovy.lang.MissingMethodException: No signature of method: basset.reporting.app.User.list() is applicable for argument types: () values: []
Possible solutions: list(), list(java.util.Map), is(java.lang.Object), wait(), lock(), find()
        at basset.reporting.app.FilterIntegrationTests.tearDown(FilterIntegrationTests.groovy:29)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Domain class dynamic methods in integration tests

bobbywarner
I've seen this before when the data source can't be resolved.  Can you double check your data source connection settings ( or just try quick with the H2 database)?  Let me know.


Thanks,
Bobby
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Domain class dynamic methods in integration tests

martel9057
Sorry for the late reply on this. I am using the default H2 database and still get those errors. Here's what my DataSource file looks like:

dataSource {
    pooled = true
}
hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = true
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
    development {
        dataSource {
            driverClassName = "org.h2.Driver"
            username = "sa"
            password = ""
            dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
            url = "jdbc:h2:mem:devDb;MVCC=TRUE"
        }
    }
    test {
        dataSource {
            driverClassName = "org.h2.Driver"
            username = "sa"
            password = ""
            dbCreate = "update"
            url = "jdbc:h2:mem:testDb;MVCC=TRUE"
        }
    }
    production {
        dataSource {
            jndiName = 'java:comp/env/jdbc/auditing'
            dialect = org.hibernate.dialect.Oracle10gDialect
            dbCreate = 'update'
        }
    }
}


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Domain class dynamic methods in integration tests

martel9057
FWIW this was because I was still extending ControllerUnitTestCase in my integration tests.
Loading...