You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes one might not want to check for certain return values. Issueing
exceptions to check error handling code is even quite common.
The annotation @expect will simplify the common case where one needs to
check that a specific exception has been thrown.
The annotation @timeout can be used to check the runtime behaviour of
a method.
Functionality
The @expect annotation takes the name of the expected exception:
Scope of Change
The unittest API should be extended to support some of the annotation
based features that will be introduces with JUnit 4.0.
These annotations include
. @expect
. @timeout
Rationale
Sometimes one might not want to check for certain return values. Issueing
exceptions to check error handling code is even quite common.
The annotation
@expect
will simplify the common case where one needs tocheck that a specific exception has been thrown.
The annotation @timeout can be used to check the runtime behaviour of
a method.
Functionality
The @expect annotation takes the name of the expected exception:
The @timeout annotation takes the amount of seconds a method may take
to execute.
The method will be interrupted if it didn't complete within the time
specified and the result will be assumed as failed.
Security considerations
n/a
Speed impact
Of course, exception handling is a slow thing, but this doesn't count
for unit testing.
Dependencies
http://php3.de/pcntl_alarm
Related documents
http://www.beust.com/weblog/archives/000292.html
http://www.frankwestphal.de/JUnit4.0.html
http://xp-framework.net/downloads/rfc0032.diff
http://xp-framework.info/xml/xp.en_US/news/view?67
The text was updated successfully, but these errors were encountered: