JUnit Gotcha!

October 24, 2008

I’m in the process of getting the newly separated cmlxom library ready for release. As I’m an obsessive upgrader I decided to update the junit library cmlxom uses from 4.3 to 4.5. And a load of tests broke. What?

The reason: <code>Assert.assertEquals(double, double)</code> has been deprecated for a while, replaced by <code>Assert.assertEquals(double expected, double actual, double delta)</code>, and rightly so. Instead of removing <code>Assert.assertEquals(double, double></code> they chose to make it throw AssertionFailed.

Moral of the tale: examine deprecation warnings before upgrading dependencies!

Advertisements

3 Responses to “JUnit Gotcha!”


  1. Saw your links about the new JUnit version… looks cool. CDK is way behind in JUnit version, but got so many unit tests to convert…

    BTW, might you send me pom files which I can use as template for the CDK? CDK-Eclipse is working out quite well, and now have some helper classes to get relevant metadata about the CDK modules… so creating POM files should be easy now…

  2. ojd20 Says:

    Sure, it’s in the e-post…

  3. ojd20 Says:

    BTW…

    Saw your links about the new JUnit version… looks cool. CDK is way behind in JUnit version, but got so many unit tests to convert…

    … a nice problem to have!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: