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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.