jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. B. Rainsberger" <jbra...@rogers.com>
Subject Re: setUp() still not being called.
Date Thu, 18 Dec 2003 23:11:59 GMT
Invent Yourself wrote:

> Here is my test class:
> 
> public class EmptyTest extends ServletTestCase
> {
>    private boolean set_up_was_called = false;
> 
> 
>    protected void setUp() throws Exception
>    {
>       set_up_was_called = true;
>       throw new RuntimeException("Stepped on a nail!");
>    }
> 
> 
>    public void testSetupMethodWasCalled() throws Exception
>    {
>       assertTrue(set_up_was_called);
>    }
> }
> 
> The assertion is failing. I'm also not seeing the exception from setUp. I
> am using cactus 1.5 (freshly downloaded today), and JBoss 3.0.7. Thanks
> for any feedback.

When setUp() fails, the test does not execute, which is the reason your 
assertion is failing.
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand


Mime
View raw message