avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject [Merlin] Tests could be simplified...
Date Mon, 07 Jul 2003 19:22:55 GMT
Stephen, I noticed a couple things about your tests that you might want to

Serveral places you have something like this:

     assertTrue( "description", false );
     throw new Exception( "description" );

That can be simplified by the following line:

     fail( "description" );

That line throws an AssertionFailedException with the message passed along.

Also, you perform the following:

     assertTrue( "Message", some.long.test().toString().equals( "foo" ) );

Rewritten, this is also clearer when it is written like this:

     assertEquals( "Message", "foo", some.long.test().toString() );

If you need to test identity (i.e. object == another) then you would use

     assertSame( "Message", original, some.long.test() );

If you are open to the idea of using the Merlin Meta as a base for a
common Avalon meta info API, then I can start performing those types of
changes.  More importantly, this will help writing future tests.


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org

View raw message