-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unittest parameterization #267
Labels
Milestone
Comments
Announced in the blog - http://news.planet-xp.net/article/510/2013/04/01/ |
A good example: https://github.com/xp-forge/mustache/blob/master/src/test/php/com/github/mustache/unittest/SpecificationTest.class.php $ unittest com.github.mustache.unittest.SpecificationTest -a spec-master/specs
[........................................................................
..................................................]
OK: 122/122 run (0 skipped), 122 succeeded, 0 failed
Memory used: 2748.67 kB (2965.49 kB peak)
Time taken: 0.034 seconds |
thekid
added a commit
to xp-framework/xp-framework
that referenced
this issue
May 5, 2013
# See also pull request #273
What a massive ease this can be can be seen by looking at xp-framework/xp-framework@c492823 |
thekid
added a commit
to xp-framework/remote
that referenced
this issue
Nov 10, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/doclet
that referenced
this issue
Nov 10, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/zip
that referenced
this issue
Nov 10, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/rdbms
that referenced
this issue
Nov 11, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/csv
that referenced
this issue
Nov 11, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/parser
that referenced
this issue
Nov 11, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/rest
that referenced
this issue
Nov 11, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/scriptlet
that referenced
this issue
Nov 11, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/imaging
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/ftp
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/http
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/ldap
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/mail
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/news
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/irc
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/sieve
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/webdav
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/spelling
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/xml
that referenced
this issue
Nov 12, 2013
# See also pull request #273
thekid
added a commit
to xp-framework/telephony
that referenced
this issue
Nov 12, 2013
# See also pull request #273
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scope of Change
This will extend the unittest API by adding a facility for providing values to a test.
Rationale
This will make it easier to discover problems in tests written using
foreach
loops currently, and at the same time reduce the amount of code that needs to be written for tests with separate test methods for every value.Functionality
Parameterized test case methods can be annotated with a
@values
annotation.Value sources
Inline
The values are taken from the annotation itself, as an array:
Locally sourced
The values are returned from a public instance method inside the current class
Outsourced
The values are returned from a public static method inside a class specified by a double-colon notation.
Method sources - arguments
For the values sourced to methods, additional arguments may be provided by using the named annotation form. The source method is then invoked with the given arguments. If the
args
key is omitted, the method is invoked without any arguments (and may thus use their defaults):Example 1: Refactoring multiple tests
This example collapses two separate methods into using the inline value source.
Before
After
Security considerations
n/a
Speed impact
Negligible
Dependencies
n/a
Related documents
The text was updated successfully, but these errors were encountered: