You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Berin Loritsch <bl...@apache.org> on 2003/07/07 21:22:55 UTC

[Merlin] Tests could be simplified...

Stephen, I noticed a couple things about your tests that you might want to
concider:

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


Re: [Merlin] Tests could be simplified...

Posted by Stephen McConnell <mc...@apache.org>.

Berin Loritsch wrote:

> 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. 


More than open - please feel free to make the changes.

Cheers, Steve.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin




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