From: Harald B. <bra...@gm...> - 2015-02-16 08:21:35
|
Hi, I would like to make the CompareMatcher extendable. This means that the constructor and two methods must be protected instead private. I created an Example usage in the UnitTest: https://github.com/brabenetz/xmlunit/commit/8479be3c9192bac073460002f55a6f5c1238c46b#diff-be4be35ef4f91a64f60bae29d9c22e8fR343 This example is basically what I do with the Matcher on my current Project: I write the test-Input into the FileSystem, where I can manual review it. And when the changes are OK I can simply overwrite my control-File with the written Test-File. Alternative (CompareMatcher not extendable because of private constructor) I could write a custom "assertThat()" method in my current project which would do the same thing. At least for my current project it is cleaner to extends the Matcher: In all my Tests I only need the extended Matcher instead of the compination of the CompareMatcher AND a custom "assertThat" method. On the other hand it is more difficult to maintain a Class which can be extended. Please let me know what you think. with friendly regards, Harald |