GitHub user mafulafunk opened a pull request:
https://github.com/apache/wicket/pull/58
Assert that instance of cherry picked
This is to replace the pull request
https://github.com/apache/wicket/pull/57
The commit 3744d5b was inspired by a non informativ test fail.
Like the assert
assertTrue(factory.getFieldValue(field, obj) instanceof ILazyInitProxy);
simply fails with no further information.
As org.hamcrest.CoreMatchers is already pulled into the classpath by junit
it might be ok to transform the given assertTrue to:
assertThat(factory.getFieldValue(field, obj),
instanceOf(ILazyInitProxy.class));
Now when the assertion fails the value of the first argument is printed
in the test output.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mafulafunk/wicket
assertThatInstanceOfCherryPicked
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/58.patch
----
commit 3744d5bee81753f3623497dd39e4529d2be5ee84
Author: Martin Funk <[email protected]>
Date: 2013-11-06T16:44:21Z
Refactor Testcases to make failing tests more informative:
Refactor
assertTrue(factory.getFieldValue(field, obj) instanceof ILazyInitProxy);
to
assertThat(factory.getFieldValue(field, obj),
instanceOf(ILazyInitProxy.class));
Now when the assertion fails the value of the first argument is printed
in the test output.
commit ad98b7ca75afb0617c04e1885a5aec7dac447734
Author: Martin Funk <[email protected]>
Date: 2013-11-06T17:09:13Z
Code formatted version of the previous commit, as suggested by Eclipse
using:
wicket-core/EclipseCodeFormat.xml
----