Issue Details (XML | Word | Printable)

Key: GRAILS-2471
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Jason Rudolph
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Grails

Patch: Increase Test Coverage and Improve Maintainability for GroovyIfTag class

Created: 16/Feb/08 10:33 PM   Updated: 18/Feb/08 04:15 AM   Resolved: 18/Feb/08 04:15 AM
Return to search
Component/s: TagLib, Testing
Affects Version/s: 1.0.1
Fix Version/s: 1.0.1

Time Tracking:
Not Specified

File Attachments: 1. File increase_coverage_and_maintainability_for_GroovyIfTag.diff (4 kB)


Testcase included: yes
Patch Submitted: Yes


 Description  « Hide

The attached patch brings the test coverage to 100% for GroovyIfTag#doStartTag. The additional tests in the patch address the two cases not covered in the current tests.

The patch also offers refactorings for the #doStartTag implementation. These refactorings use method extraction to reduce repetition. They also cut the amount of conditional logic in half.

Note: The test improvements (in CoreTagsTests.groovy) are independent of the refactorings (in GroovyIfTag.java). In case the team disagrees with the refactorings, the additional test cases can still be applied to offer increased test coverage for the existing code base.



Jason Rudolph added a comment - 16/Feb/08 10:37 PM

Added note about the test improvements being independent of the refactorings.


Jason Rudolph made changes - 16/Feb/08 10:37 PM
Field Original Value New Value
Description The attached patch brings the test coverage to 100% for GroovyIfTag#doStartTag. The additional tests in the patch address the two cases [not covered|http://build.canoo.com/grails/artifacts/coverage/org.codehaus.groovy.grails.web.taglib.GroovyIfTag.html] in the current tests.

The patch also offers refactorings for the #doStartTag implementation. These refactorings use method extraction to reduce repetition. They also cut the amount of conditional logic in half.

The attached patch brings the test coverage to 100% for GroovyIfTag#doStartTag. The additional tests in the patch address the two cases [not covered|http://build.canoo.com/grails/artifacts/coverage/org.codehaus.groovy.grails.web.taglib.GroovyIfTag.html] in the current tests.

The patch also offers refactorings for the #doStartTag implementation. These refactorings use method extraction to reduce repetition. They also cut the amount of conditional logic in half.

--

Note: The test improvements (in CoreTagsTests.groovy) are independent of the refactorings (in GroovyIfTag.java). In case the team disagrees with the refactorings, the additional test cases can still be applied to offer increased test coverage for the existing code base.

Graeme Rocher made changes - 17/Feb/08 03:37 PM
Fix Version/s 1.0.1 [ 14065 ]
Graeme Rocher added a comment - 18/Feb/08 04:15 AM

applied. thanks.


Graeme Rocher made changes - 18/Feb/08 04:15 AM
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]