Hi,
I am trying to figure out how to "Test methods that throw an exception". The
test pattern is taken from "AsyncAppenderTestCase.java" (below)
Here is an example:
Now, in this try/catch block, logger.debug("m2"); would throw an exception,
now what I need to do is:
1. Catch this exception, Since I have the text for the exception:
log4j:WARN No appenders could be found for logger
(com.webmethods.sc.logging.test.unit.WmLoggerFilterTest). log4j:WARN Please
initialize the log4j system properly.
2. Fail the test
3. Compare the exception thrown by logger.debug("m2"); with the actual
excption
4. if same , pass the test
5. if not, then fail the test
Thanks,
-Kamal.