R
Ronny Mandal
Hello, I am relatively new to JUnit. I am instrumenting already
existing tests, what I want to do is to record which exceptions that
(could) occure when running the tests. One sometimes expected
exception is java.lang.SecurityException, i.e. it might be thrown, but
not necessarily. The other does not matter, all that I am interested
in is that an exception has occured.
So my results would be Pass / Fail / SecurityException (Other
exception would normally be recorded as an error. I cannot use
@Test(expected=...), because the test would fail if no exception was
thrown. It is preferrable not to duplicate the test methods, where one
has an expected exception.
Any suggestions is greatly appreciated.
Regards,
Ronny Mandal
existing tests, what I want to do is to record which exceptions that
(could) occure when running the tests. One sometimes expected
exception is java.lang.SecurityException, i.e. it might be thrown, but
not necessarily. The other does not matter, all that I am interested
in is that an exception has occured.
So my results would be Pass / Fail / SecurityException (Other
exception would normally be recorded as an error. I cannot use
@Test(expected=...), because the test would fail if no exception was
thrown. It is preferrable not to duplicate the test methods, where one
has an expected exception.
Any suggestions is greatly appreciated.
Regards,
Ronny Mandal