Has anyone tried using XMLUnit with JUnit 4.x? I'm new to both products. I downloaded XMLUnit 1.3, found that I needed JUnit, and downloaded JUnit 4.8.2 binary. I was able to create an Eclipse workspace and build XMLUnit, with one source change.
The change was to examples\XPathRegexAssert.java, to change the import of junit.framework.Assert to org.junit.Assert.
I suppose I can't used the new annotations of JUnit 4 with XMLUnit, but I would like to use them for other test cases. Any problems there?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
XMLUnit can be used without using JUnit at all - as a library. It is probably easiest to use it together with JUnit 4.x that way.
What I mean is that instead of using
assertXMLEquals(Diff d)
you'd use
assertTrue(d.similar())
.
I'm currently working on XMLUnit2 in svn and intend to provide JUnit4 integration via Hamcrest Matchers, but I'm not there (not yet and likely not withing reasonable time).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-05-21
Thanks. I'd looked into it some more and come to that conclusion. It's good to see that XMLUnit is still being enhanced.
Regards,
Jeff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Has anyone tried using XMLUnit with JUnit 4.x? I'm new to both products. I downloaded XMLUnit 1.3, found that I needed JUnit, and downloaded JUnit 4.8.2 binary. I was able to create an Eclipse workspace and build XMLUnit, with one source change.
The change was to examples\XPathRegexAssert.java, to change the import of junit.framework.Assert to org.junit.Assert.
I suppose I can't used the new annotations of JUnit 4 with XMLUnit, but I would like to use them for other test cases. Any problems there?
Thanks.
XMLUnit can be used without using JUnit at all - as a library. It is probably easiest to use it together with JUnit 4.x that way.
What I mean is that instead of using
you'd use
.
I'm currently working on XMLUnit2 in svn and intend to provide JUnit4 integration via Hamcrest Matchers, but I'm not there (not yet and likely not withing reasonable time).
Thanks. I'd looked into it some more and come to that conclusion. It's good to see that XMLUnit is still being enhanced.
Regards,
Jeff