Question

Is there a recommended way to integrate Hamcrest into the JUnit configuration in Eclipse? Currently Eclipse's JUnit comes with Hamcrest-core only. I want to edit that configuration to include Hamcrest-all. How should I do this?

Was it helpful?

Solution

There's nothing to stop you adding hamcrest as a JAR to your eclipse project's build path. If there's one packaged with eclipse (and I didn't realise there was, but fair enough), then it's just there as a convenience.

OTHER TIPS

I had problems using hamcrest-all and junit-dep - you then need jMock an easymock and ant.tasks

If you just want more matchers, add hamcrest-library (along with the junit and hamcrest core you get from Eclipse)

Shouldn't this question have the "hamcrest" tag?

JUnit goes in two distributions: with Hamcrest (junit-4.6.jar) and without Hamcrest (junit-dep-4.6.jar). If I understand your question correctly, you need to specify junit-4.6.jar in JUnit configuration. I think it is possible in Eclipse (I use another IDE).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top