jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff_Mycha...@nlgroup.ca
Subject Odd output with servlet redirector and assert
Date Tue, 23 Dec 2003 19:30:22 GMT
Greetings:

      I am using cactus 1.5/jboss3.0.4/tomcat4.0.6 and trying to using the
most simple config option that I can until I get he hang of writing tests.

So I have both the client and server side Jars in on the serverside and am
running tests with a browser.

I noticed the output from assertEquals() does not show the expected and
actual values.
Improper Key: expected:<...e> but was:<...>  should be:
Expected: businessrule.customer.invalid.dat
Actual:businessrule.customer.invalid.date

The xml output is:
<failure message="Improper Key: expected:<...e> but was:<...>" type="junit.framework.ComparisonFailure">
junit.framework.ComparisonFailure: Improper Key: expected:<...e> but was:<...>
at com.nlg.ar.web.common.LogNoteTest.testValidationSaveNewLogNoteWithPastFollowup

I get the same type of output if I have &transform=yes in my url

In this case I am only testing two strings that are message resource keys.

The passes when the value is the same but when I test for a failure, I get the output above.

The test code is.
      //Check for proper key
      String msgKey = e.getMessageKey();
      if(log.isDebugEnabled()) log.debug("Exception Key: " + msgKey);

      //Should be the proper key
      assertEquals("Improper Key: ","businessrule.customer.invalid.date",msgKey);

I am very new to Cactus and Junit style testing, so please forgive me if this a dumb question..



Mime
View raw message