groovy

Documentation for Collection Jdk Methods

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.7.1
  • Component/s: groovy-jdk
  • Labels:
    None
  • Testcase included:
    yes
  • Number of attachments :
    1

Description

Added groovy assertions to Javadocs for Collection methods, e.g.:

/**
     * Sums the items in a collection.  This is equivalent to invoking the
     * "plus" method on all items in the collection.
     * <pre class="groovyTestCase">assert 1+2+3+4 == [1,2,3,4].sum()</pre>
     *
     * @param self Collection of values to add together
     * @return The sum of all of the items
     * @since 1.0
     */

The patch includes a TestSuite that will execute the code inside the pre tag to ensure that the assertions hold.

Issue Links

Activity

Hide
Merlyn Albery-Speyer added a comment -

If this could benefit from being part of the Groovy distribution then feel free to move the test code from src/test/groovy/util to src/main/groovy/util.

Show
Merlyn Albery-Speyer added a comment - If this could benefit from being part of the Groovy distribution then feel free to move the test code from src/test/groovy/util to src/main/groovy/util.
Hide
Paul King added a comment -

Thanks for the patch!

I moved it back into src/main as it seems to belong with things like GroovyTestSuite and GroovyLogTestCase. These probably all belong in some kind of groovy-test internal module but that is part of the planned re-org.

I also provided a command-line entry point for JavadocAssertionTestSuite similar to GroovyTestSuite.

Show
Paul King added a comment - Thanks for the patch! I moved it back into src/main as it seems to belong with things like GroovyTestSuite and GroovyLogTestCase. These probably all belong in some kind of groovy-test internal module but that is part of the planned re-org. I also provided a command-line entry point for JavadocAssertionTestSuite similar to GroovyTestSuite.
Hide
Merlyn Albery-Speyer added a comment -

Thanks Paul. I appreciate the effort you put in integrating the patch.

Show
Merlyn Albery-Speyer added a comment - Thanks Paul. I appreciate the effort you put in integrating the patch.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: