Re: Decoupling JUnit and Hamcrest
| Newsgroups | gmane.comp.java.junit.user |
|---|---|
| Message-ID | <[email protected]> |
Some time ago the testing-java-8 mailing list was started to discuss things like these; to throw around ideas about new testing frameworks and tools in the post-Java 8 world, without cluttering the JUnit mailing list with non-JUnit stuff. https://groups.google.com/forum/#!forum/testing-java-8 Stefan Bechtold [email protected] [junit] wrote on 12.1.2015 13:53: > Concerning the exception handling, I like the JUnit Rule based approach for applications up to Java 7 (without support for lambdas) very well. This provides a way to execute a piece of code and provide information about the code that was executed. In order to be compatible to Java 7 (and maybe 6), I think it is a must-have feature in the next testing framework. Anyways, wherever possible, I would strongly recommend to leave the assertion part out of the test framework and simply provide an extension point (like the @Rule annotation) for 3rd party libraries. For Java 8, I really prefer the lambda approach, as it makes the test code much more readable and expresses the intend of the test case more clearly. -- Esko Luontola www.orfjackal.net ------------------------------------ ------------------------------------