grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.77k stars 952 forks source link

GRAILS-8181: Windows Only - Unit test mixin in unit test causes integration test to fail #4206

Closed graemerocher closed 9 years ago

graemerocher commented 12 years ago

Original Reporter: tiggerizzy Environment: Not Specified Version: 2.0-M2 Migrated From: http://jira.grails.org/browse/GRAILS-8181

When using {{@TestMixin(DomainClassUnitTestMixin)}} and the {{mockDomain}} method to mock collaborating domains in a unit test, integration tests that later use a dynamic finder on the mocked domain behave inconsistently.

See issue GRAILS-8176 for some more detail (includes testcase as zip).

See the Environment information for specific environment details.

I have pushed the testcase to github for simplicity. https://github.com/bendoerr/GRAILS-8181-Testcase

You should expect the following failure when running {{grails test-app}} against the testcase on a windows environment.

{code} | Completed 4 unit tests, 0 failed in 4262ms | Running 1 integration test... 1 of 1 | Failure: testThatFails(org.grails.bug.DomainIntegrationTests) | Assertion failed:

assert Gizmo.findByName(g.name) | | | null | Giz org.grails.bug.Gizmo : 1

    at org.grails.bug.DomainIntegrationTests.testThatFails(DomainIntegrationTests.groovy:19)

| Completed 1 integration test, 1 failed in 439ms {code}

graemerocher commented 12 years ago

graemerocher said: Thanks for confirming, quite a few things were fixed in the RCs, so it is likely this was picked up before final