Details
Description
When running unit test using the STS Run As Grails Command (test-app), I get the following error:
java.lang.NoSuchMethodError: org.codehaus.groovy.grails.commons.spring.GrailsApplicationContext.getEnvironment()Lorg/springframework/core/env/ConfigurableEnvironment;
at grails.test.mixin.support.GrailsUnitTestMixin.initGrailsApplication(GrailsUnitTestMixin.groovy:96)
at grails.test.mixin.domain.DomainClassUnitTestMixin.initializeDatastoreImplementation(DomainClassUnitTestMixin.groovy:86)
The unit test program is empty and looks like this:
import static org.junit.Assert.*
import grails.test.mixin.*
import grails.test.mixin.support.*
import org.junit.*
/**
- See the API for
{@link grails.test.mixin.support.GrailsUnitTestMixin}
for usage instructions
*/
@TestMixin(GrailsUnitTestMixin)
class ComponentTests {
void setUp()
{ // Setup logic here }void tearDown()
{ // Tear down logic here }void testSomething()
{ //fail "Implement me" println("azure datafeed tests begin"); }}
I am using the following plugins:
hibernate 2.0.3, jquery (1.7.1), resources (1.1.6), spring-security-core (1.2.7.3), spring-security-ldap (1.0.5), spring-security-mock(1.0.1), tomcat(2.0.3), and webxml (1.4.1)
I had a bunch of unit test programs and all of them failed the same way. So, I deleted all the unit test programs and created the empty unit test program enclosed above with the same result.
Activity
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Edit [ 10000 ] |
| Affects Version/s | 2.2.1 [ 13323 ] |
| Status | Edit [ 10000 ] | Open [ 1 ] |
I get a similar effect trying to generate the gorm changelog from Database Migration Plugin using dbm-generate-gorm-changelog changelog.groovy --stacktrace
The application was originally developed using grails 1.3.7, then migrated to grails 2.0.3. I actually installed the db migration plugin only today, so this is the first time I used it.
Here you are an excerpt from grails list-plugins
And this is the relevant error message