Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1492

Grails' controller methods are not shown as entered

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 4.0.2
    • 3.3.0
    • Grails Plugin
    • None

      Hello,
      For some reason the method in a controller is marked as not entered even though the content inside is shown to be executed. Please can you help me rationalize/ understand this?

      Please refer to me screenshots:
      index_method_not_executed.png: to see that the index() method is not executed even though its contents are.
      test_for_index_method.png: the test that is run to get the method to run.

        1. cloverController-bug-report-28092014.zip
          25 kB
          Sam Farmer
        2. DashboardController.groovy
          0.9 kB
          cartman12
        3. DashboardControllerTests.groovy
          0.8 kB
          cartman12
        4. index_method_not_executed.PNG
          31 kB
          cartman12
        5. test_for_index_method.PNG
          5 kB
          cartman12

            [CLOV-1492] Grails' controller methods are not shown as entered

            Owen made changes -
            Workflow Original: New Clover Workflow [ 897417 ] New: New Clover Workflow - Restricted [ 1473037 ]
            Piotr Swiecicki made changes -
            Workflow Original: Clover Workflow [ 896296 ] New: New Clover Workflow [ 897417 ]
            Piotr Swiecicki made changes -
            Workflow Original: reviewflow [ 683130 ] New: Clover Workflow [ 896296 ]

            as workaround (if it's really necessary) you can change the access modifier to protected (or private...).

            this issue only happens with public and default.

            Francesco Durbin added a comment - as workaround (if it's really necessary) you can change the access modifier to protected (or private...). this issue only happens with public and default.
            Marek Parfianowicz made changes -
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Marek Parfianowicz made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: To be reviewed [ 10026 ] New: Resolved [ 5 ]

            A bug was caused by a fact how AST looks like for controller classes - MethodNode.getCode() has TryCatchStatement instead of a BlockStatement (as for normal methods). I've added handling of this special case in Clover.

            Marek Parfianowicz added a comment - A bug was caused by a fact how AST looks like for controller classes - MethodNode.getCode() has TryCatchStatement instead of a BlockStatement (as for normal methods). I've added handling of this special case in Clover.
            Marek Parfianowicz made changes -
            Fix Version/s Original: 4.1.0 [ 37518 ]
            Marek Parfianowicz made changes -
            Status Original: In Progress [ 3 ] New: To be reviewed [ 10026 ]
            Marek Parfianowicz made changes -
            Summary Original: Grails Code Coverage Bug New: Grails' controller methods are not shown as entered

              mparfianowicz Marek Parfianowicz
              f67dcf827f0e cartman12
              Affected customers:
              2 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: