Grails
  1. Grails
  2. GRAILS-8181

Windows Only - Unit test mixin in unit test causes integration test to fail

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-M2, 2.0-RC1
    • Fix Version/s: 2.0 final
    • Component/s: Testing
    • Labels:
    • Environment:
    • Testcase included:
      yes

      Description

      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.

      | 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
      

        Activity

        Hide
        Graeme Rocher added a comment -

        Would you be able to verify with the current 2.0.1 snapshot if this is still a problem? Build available here:

        http://hudson.grails.org/view/Grails%202.0.x/job/grails_core_2.0.x/lastSuccessfulBuild/artifact/build/distributions/grails-2.0.1.BUILD-SNAPSHOT.zip

        Show
        Graeme Rocher added a comment - Would you be able to verify with the current 2.0.1 snapshot if this is still a problem? Build available here: http://hudson.grails.org/view/Grails%202.0.x/job/grails_core_2.0.x/lastSuccessfulBuild/artifact/build/distributions/grails-2.0.1.BUILD-SNAPSHOT.zip
        Hide
        Benjamin R. Doerr added a comment -

        Awesome. Tests passed with the current 2.0.1 snapshot you provided. I also just checked and it also passed with 2.0.0. Do you think the changes around MetaClassRegistryCleaner during the later 2.0.0 RC's fixed this?

        Feel free to close this issue.

        Show
        Benjamin R. Doerr added a comment - Awesome. Tests passed with the current 2.0.1 snapshot you provided. I also just checked and it also passed with 2.0.0. Do you think the changes around MetaClassRegistryCleaner during the later 2.0.0 RC's fixed this? Feel free to close this issue.
        Hide
        Graeme Rocher added a comment -

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

        Show
        Graeme Rocher added a comment - Thanks for confirming, quite a few things were fixed in the RCs, so it is likely this was picked up before final

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Benjamin R. Doerr
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development