Grails
  1. Grails
  2. GRAILS-8258

Unit test with Async in Grails 2.0.0.RC1

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-RC1
    • Fix Version/s: 2.1-RC1
    • Component/s: Controllers
    • Labels:
      None
    • Environment:
      mac

      Description

      I follow the instructions on async http://grails.org/doc/2.0.0.RC1/guide/theWebLayer.html#asynchronousRequestProcessing

      def index() {
      def ctx = startAsync()
      ctx.start

      { new Book(title:"The Stand").save() render template:"books", model:[books:Book.list()] ctx.complete() }


      }

      But when running unit test, I got the following errors:

      org.codehaus.groovy.grails.plugins.testing.GrailsMockHttpServletRequest.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)Ljavax/servlet/AsyncContext;

      java.lang.AbstractMethodError: org.codehaus.groovy.grails.plugins.testing.GrailsMockHttpServletRequest.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)Ljavax/servlet/AsyncContext;
      at com.acs.ni.OpenAmController.create(OpenAmController.groovy:21)
      at grails.test.mixin.web.ControllerUnitTestMixin$_mockController_closure4.doCall(ControllerUnitTestMixin.groovy:320)
      at com.acs.ni.OpenAmControllerTests.userIsSuccessfullyRegistered(OpenAmControllerTests.groovy:81)

        Activity

        Hide
        Antoine Lyseight added a comment -

        I'm noticing the same issue as of grails 2.0.1. It doesn't seem to recognize startAsync() in my integration test.

        Show
        Antoine Lyseight added a comment - I'm noticing the same issue as of grails 2.0.1. It doesn't seem to recognize startAsync() in my integration test.
        Hide
        Mel Martin added a comment -

        Same problem for me (grails 2.0.1 also)

        Show
        Mel Martin added a comment - Same problem for me (grails 2.0.1 also)
        Hide
        Graeme Rocher added a comment -

        I have pushed the fixed into master:

        https://github.com/grails/grails-core/commit/8627a48cddd2e3379ff2f5b314d1560d18f57b1f

        However, because it is quite involved I'm still debating whether to merge it into 2.0.x.

        Some further testing time is needed.

        Show
        Graeme Rocher added a comment - I have pushed the fixed into master: https://github.com/grails/grails-core/commit/8627a48cddd2e3379ff2f5b314d1560d18f57b1f However, because it is quite involved I'm still debating whether to merge it into 2.0.x. Some further testing time is needed.

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Jet
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development