Hi everyone,

I'm juggling with the "failures are anticipated and checked for with assertions while 
errors are unanticipated"

In which circumstances will I encounter a failure?

I try these three senarios and they report error
Test 1:
                try{
                        assertTrue("This was predictable",false);
                }catch(Exception ex){
                        
LoggerFactory.getInstance().logFail("testShouldShowFailure",ex.toString());
                }finally{
                        LoggerFactory.getInstance().timerStop("testShouldShowFailure");
                }

Test 2:
                try{
                        assertEquals("A","B");
                }catch(Exception ex){
                        
LoggerFactory.getInstance().logFail("testShouldShowFailure",ex.toString());
                }finally{
                        LoggerFactory.getInstance().timerStop("testShouldShowFailure");
                }

Test 3:
                try{
                        fail("This was predictable");
                }catch(Exception ex){
                        
LoggerFactory.getInstance().logFail("testShouldShowFailure",ex.toString());
                }finally{
                        LoggerFactory.getInstance().timerStop("testShouldShowFailure");
                }

Somehow, I'd like to see one of these three, log a failure and execute at least the 
finally part.

I use cactus 1.5rc1
With weblogic 8.1 and jboss3.2.2RC3
I execute the test via the web.
The following are in my WEB-INF/lib directory : cactus.jar, cactus-ant.jar, 
,junit.jar, aspectjtr.jar, commons-http.jar, commons-logging.jar, myTestClasses.jar

Test like assertTrue(true) log a success

David Lemieux

Ericsson Canada Inc.
Email : [EMAIL PROTECTED]
Telephone : 514-345-7900 #3426

Reply via email to