GitHub user mafulafunk opened a pull request:
https://github.com/apache/wicket/pull/57
Assert that instance of
Ok,
this is two commits aa422c1 is just because the eclipse property files get
in the way.
The commit 0aac81f 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 assertThatInstanceOf
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/57.patch
----
commit aa422c16a8711c43e03b65cec7148afd53153ac5
Author: Martin Funk <[email protected]>
Date: 2013-10-28T19:03:09Z
remove eclipse jdt.core and jdt.ui prefs
commit 0aac81f393047865088864c6b299ce1e022ce1fa
Author: Martin Funk <[email protected]>
Date: 2013-11-03T21:20:56Z
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.
----