jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabe <bastien.gabr...@gmail.com>
Subject negative testing with FormAuthentication
Date Tue, 16 May 2006 21:04:14 GMT
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

Mime
View raw message