Return-Path: list-help: list-unsubscribe: List-Post: List-Id: Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 25300 invoked by uid 99); 16 May 2006 21:04:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2006 14:04:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of bastien.gabriel@gmail.com designates 64.233.162.207 as permitted sender) Received: from [64.233.162.207] (HELO nz-out-0102.google.com) (64.233.162.207) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2006 14:04:35 -0700 Received: by nz-out-0102.google.com with SMTP id x7so20831nzc for ; Tue, 16 May 2006 14:04:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=GZ2L7XK6+QZd+8h5VoYBh9OjHu9MViVUE53VuGTqjNDySejpHlkniv+gQVtTn8BznP0N4PVdRCGdSYbE9vTX2umodKeu+sgYD41c0nx0Fh+XyZMLsd29wZHDULsCDT0u1uFXpSeyZelqTC80PeeOAqDZ3L4Velfb9hrh/VSfwiI= Received: by 10.36.24.14 with SMTP id 14mr215944nzx; Tue, 16 May 2006 14:04:14 -0700 (PDT) Received: by 10.36.221.19 with HTTP; Tue, 16 May 2006 14:04:14 -0700 (PDT) Message-ID: Date: Tue, 16 May 2006 17:04:14 -0400 From: Gabe To: cactus-user@jakarta.apache.org Subject: negative testing with FormAuthentication MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org 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