FEST-Assert 1.0a1: Fluent Interface for Assertions

FEST-Assert is an "assertThat" library that provides a fluent interface for writing assertions. Its main goal is to improve test code readability and make maintenance of tests easier.

We are proud to announce that FEST-Assert 1.0a1 is out! This release includes many new features and improvements. Release notes and more information can be found here.

Example:

int removed = employees.removeFired();
assertThat(removed).isZero();

List newEmployees = employees.hired(TODAY);
assertThat(newEmployees).hasSize(6)
.contains(frodo, sam);

String[] newHires = employees.newHiresNames();
assertThat(newHires).containsOnly("Gandalf", "Arwen", "Gimli");

assertThat(yoda).isInstanceOf(Jedi.class)
.isEqualTo(foundJedi)
.isNotEqualTo(foundSith);

You can download the latest release here (file fest-assert-1.0a1.zip.) FEST-Assert requires Java SE 5.0 or later.

Here are some useful links:

Feedback is always appreciated :)

 
0

Alex Ruiz is a Software Engineer in the development tools organization at Oracle. Alex enjoys reading anything related to Java, testing, OOP, and AOP and has programming as his first love. Before joining Oracle, Alex was a consultant for ThoughtWorks. Alex is a DZone MVB and is not an employee of DZone and has posted 20 posts at DZone. You can read more from them at their website.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

ff aaa replied on Tue, 2008/02/19 - 7:25am

very nice. How is the interaction with JUnit or TestNG?

Alex Ruiz replied on Tue, 2008/02/19 - 9:46am in response to: afsina

Hi Ahmet,

It can be used with either JUnit or TestNG.

Regards,

-Alex 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.