Using Hamcrest 2.0 with JUnit

240 views
Skip to first unread message

Daniel Rothmaler

unread,
Sep 29, 2015, 9:36:15 AM9/29/15
to Hamcrest Java Users
Hi all, 

I'm just trying to update hamcrest and junit dependencies to the latest version (2.0/4.12) on a project, I'm working on...

But I have some problems, understanding what classes I should use.
Especially what version of "MatcherAssert" (org.hamcrest.junit.MatcherAssert or org.hamcrest.MatcherAssert).
Until now, I used the junit-dep package, und used the org.hamcrest.MatcherAssert directly from hamcrest, to specify my assertions (as I read that they will produce better error messages). 

But now the "new" MatcherAssert and MatcherAssume classes inside the org.hamcrest.junit package came up ported over from junit, is far as I understand). 
Should I switch to them now, or should i stick with the "old" one?
Will they be merged in the future, or are they going to coexist?

It would be nice to have some documentation there... :-)

Best regards, Daniel 

Nat Pryce

unread,
Oct 8, 2015, 4:14:51 PM10/8/15
to hamcre...@googlegroups.com
The plan is for the MatcherAssert and MatcherAssume classes to be the integration point between JUnit and Hamcrest.  Old classes may be kept around for compatibility for a while, but will be removed in a major version increment some time in the future (not decided when, depends on how widely used they are).

--Nat

--
You received this message because you are subscribed to the Google Groups "Hamcrest Java Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hamcrest-jav...@googlegroups.com.
To post to this group, send email to hamcre...@googlegroups.com.
Visit this group at http://groups.google.com/group/hamcrest-java.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages