-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract a ComparisonFailure interface from AssertionFailedException #27
Comments
I presume you didn't mean |
@cgruber fixed. Thanks |
We could certainly do this. Another option would be to change Vintage to use |
@marcphilipp changing JUnit4 in that way would break tests and tools |
I don't think it would break a lot of tests and it would only break tools that don't support OTA, right? |
@marcphilipp Eclipse (and probably other IDEs) special case While IDEs will eventually be updated to support OTA, it will take time for people to update their IDEs. What's wrong with extracting an interface as I proposed? |
@marcphilipp any more thoughts on this? Note that we could change JUnit4's |
How would that work in terms of artifact dependencies and JDK compatibility? JUnit4 is still compiled to JDK5 byte code while OTA4J isn't... 🤔 |
Sooner or later we will have a release of JUnit4 that is compiled with a more recent JDK (I was originally thinking that we would do that in a point-zero release, but since 5.0 is taken...). We have had a few feature requests that require JDK 6 |
It would be useful if JUnit4's
ComparisonFailure
exception could share a common interface with OpenTest4J'sAssertionFailedException
so 1) IDEs have a simple way to show a diff view on comparison failure and 2) JUnit4 can get better IDE integration for comparison failures for things that are not strings.This would require some changes to
AssertionFailedException
, since the JUnit4ComparisonFailure
class already has methods namedgetActual()
andgetExpected()
. I suggest renaming OpenTest4J'sAssertionFailedException
methods as follows:getActual()
->getActualValue()
getExpected()
->getExpectedValue()
isExpectedDefined()
->hasExpectedValue()
isActualDefined()
->hasActualValue()
The above four methods would be the only methods in this proposed
ComparisonFailure
interfaceThe text was updated successfully, but these errors were encountered: