negative testing with FormAuthentication
Gabe <[email protected]>
| Newsgroups | gmane.comp.jakarta.cactus.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I've been setting up a cactus test to test a web application containers login. My test succeeds until I try a bad login. The FormAuthentication throws a "org.apache.cactus.util.ChainedRuntimeException: Failed to authenticate the principal" exception. This is expected behavior. The problem I can't wrap my head around is how is my test case supposed to catch the exception? I put try catch blocks in the beginXXX() and in the testXXX() methods and neither catch the exception. Right now the exception causes an error and makes the test fail. But the login was supposed to fail. How should one test and assert a failed login using Cactus? Thanks, Gabriel