Grails
  1. Grails
  2. GRAILS-8204

Some default test of controller has the NullPointException

    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-RC2
    • Component/s: Controllers, Testing
    • Environment:
      Ubuntu 11.04
      java version "1.6.0_22"
      OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
      OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
      grails-2.0.0.RC1
    • Testcase included:
      yes

      Description

      The Grails-8031(http://jira.grails.org/browse/GRAILS-8031) fix some methods(index, list, create), but the other methods(save, show, edit, update, delete) give the NullPointerException.
      like this(book's testSave-method):
      java.lang.NullPointerException
      at com.sun.beans.TypeResolver.resolve(TypeResolver.java:321)
      at com.sun.beans.TypeResolver.resolve(TypeResolver.java:157)
      at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:78)
      at java.beans.FeatureDescriptor.getReturnType(FeatureDescriptor.java:368)
      at java.beans.Introspector.getTargetEventInfo(Introspector.java:1020)
      at java.beans.Introspector.getBeanInfo(Introspector.java:424)
      at java.beans.Introspector.getBeanInfo(Introspector.java:189)
      at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:142)
      at test.BookController.save(BookController.groovy:24)
      at grails.test.mixin.web.ControllerUnitTestMixin$_mockController_closure4.doCall(ControllerUnitTestMixin.groovy:320)
      at test.BookControllerTests.testSave(BookControllerTests.groovy:45)

        Activity

        Hide
        Graeme Rocher added a comment -

        Patch that fixes the issue in grails-datastore project attached

        Show
        Graeme Rocher added a comment - Patch that fixes the issue in grails-datastore project attached
        Show
        Graeme Rocher added a comment - fixed by https://github.com/SpringSource/grails-data-mapping/commit/aa22444e9c23f3f4bd0f1f4a2455a91d9e76b19b

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            rainbow
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development