info/CWS dba32b : OOoRunner: complexlib.Assurance: +assureException

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

info/CWS dba32b : OOoRunner: complexlib.Assurance: +assureException


          Type: info
         Title: OOoRunner: complexlib.Assurance: +assureException
     Posted by: [hidden email]
      Affected: -
Effective from: CWS dba32b
    CWS status: new

class complexlib.Assurance:
+ protected void assureException( final String _message,
    final Object _object, final String _methodName,
    final Class[] _argClasses, final Object[] _methodArgs,
    final Class _expectedExceptionClass )
+ various flavours

complexlib.Assurance, base class of complexlib.ComplexTestCase, now
has a facility to check a certain exception being thrown (or not
thrown) when invoking a given method.

For this, the method with the given name is looked up at the given
object (using introspection), and called with the given parameters. If
the given exception class is not null, then the method is expected to
throw an exception of the given class. If the exception class is null,
then the method is expected to throw no exception.
If this expectation does not meet reality, this is delegated (with the
given message) to the Assurance.assure method, effectively throwing an
AssureException this way.

For convenience, and as usual for the other assureSomething methods,
there are versions of assureException which do not take a message, but
generate a default one. Also, there are versions which do not take the
_argClasses parameter, but deduce the classes of the parameters of the
given method from _methodArgs (which works only if those are not null).

Send feedback to [hidden email]

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]