Skip to content
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

can the Failures class be moved from internal to util? #2026

Closed
Zegveld opened this issue Oct 29, 2020 · 6 comments
Closed

can the Failures class be moved from internal to util? #2026

Zegveld opened this issue Oct 29, 2020 · 6 comments
Labels
3rd-party: XMLUnit An issue related to the XMLUnit library
Milestone

Comments

@Zegveld
Copy link

Zegveld commented Oct 29, 2020

We've got an OSGI project that uses both assertj and xmlunit-assertj ( https://github.com/xmlunit/xmlunit )
But now we get issues with that xmlunit uses the Failures class while this is not exposed.

The reason why they use it is to:

  1. determine whether or not to filter (their own) elements from the exception's stacktrace. (not avoidable)
  2. create the AssertionError class. (avoidable)

I've been looking at the xmlunit-assertj code and checking if I could find another way to achieve this without usage of the Failures class but did not find it.
I could avoid the creation of the AssertionError route, but I would still end up with the same problem concerning the first point.

@scordio
Copy link
Member

scordio commented Oct 29, 2020

Before exposing Failures we could try to work together with xmlunit-assertj to change the access to internal classes. If something is needed but not available, we can probably find a way to expose it via a new public api.

I'll take a look and put here my thoughts.

@scordio
Copy link
Member

scordio commented Oct 29, 2020

One important point is that xmlunit-assertj relies on assertj-core 2.9, which is in maintenance mode. We need to check if upgrading to 3.x and Java8 is an option considering XMLUnit requirement section:

Starting with version 2.8.0 XMLUnit requires Java 7, which has always been the minimum requirement for the AssertJ module. All other modules in versions 2.0.0 to 2.7.0 required Java 6.

@scordio
Copy link
Member

scordio commented Oct 29, 2020

I put my comments in xmlunit/xmlunit#203.

@scordio
Copy link
Member

scordio commented Nov 3, 2020

As discussed in xmlunit/xmlunit#203:

  1. determine whether or not to filter (their own) elements from the exception's stacktrace. (not avoidable)

AbstractAssert#removeCustomAssertRelatedElementsFromStackTraceIfNeeded() is mostly doing what is needed here, but it is private and is restricted to AssertJ package. We could refactor this part in assertj-core and expose it as protected method.

@scordio scordio added this to the 3.19.0 milestone Nov 3, 2020
@joel-costigliola
Copy link
Member

@Zegveld let us know if we can close this issue.

@Zegveld
Copy link
Author

Zegveld commented Nov 11, 2020

Fix found in commit 4e04c29ce67b712af1661aae4706c883c20d2c7e as discussed at xmlunit/xmlunit#203

xmlunit's Assertj3 variant tested and works correctly under OSGI.

Therefor closing this issue.

@Zegveld Zegveld closed this as completed Nov 11, 2020
@joel-costigliola joel-costigliola modified the milestones: 3.19.0, 3.18.1 Nov 11, 2020
@scordio scordio added the 3rd-party: XMLUnit An issue related to the XMLUnit library label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd-party: XMLUnit An issue related to the XMLUnit library
Projects
None yet
Development

No branches or pull requests

3 participants