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
OSGI - org.assertj.core.internal is not exposed and can therefor not be used. #203
Comments
Following what has been mentioned in assertj/assertj#2026:
Could by replaced by fail(String). As AssertJ 2.x is in maintenance mode, would it be an option for XMLUnit to upgrade to AssertJ 3.x, which would also raise the Java requirement to version 8? |
That's a pretty big jump, given that we've put in some extra effort to stay compatible with newer versions of AssertJ without actually depending on a new version. If we upgraded the AssertJ dependency we'd force all downstream users to upgrade as well. It might be an option to add an assertj3 module that explicitly depended on AssertJ 3.whatever_is_needed_to_fix_this and allow people to stick to the 2.x compatible version if they want to. I'm doing something similar for NUnit 2/3 over in XMLUnit.NET and have found a way to keep this manageable. Let me think about it for a while. |
My take on this would be for you guys to add assertj3 module as assertj 2.x is not active anymore but if you decide not too, we are happy to release a new version of 2.x with |
Yes, this probably is the way to go. I'll add a new assertj3 module and will try to ensure we don't need to duplicate too much code. Right now I haven't actually investigated the problem at hand at all - I'm not deeply familiar with the code here which has largely been written by @krystiankaluzny - but we'll get there :-). In order to keep things simple I'd make the assertj3 module depend on the first AssertJ release that allows us to access People using older versions of AssertJ will have to stick with the xmlunit-assertj module and live outside of OSGi land. Since this has come up for the first time I don't believe we need to make sure the xmlunit-assertj module works in OSGi environments if xmlunit-assertj3 does and thus don't think we really need another AssertJ 2.x release. Thanks for the offer. |
@scordio @joel-costigliola I believe this is a bit more complex - and right now I don't think making Of the assertions we offer the ones that compare two pieces of XML are a bit uncommen in that we want to throw a JUnit 4.x's The second part is that we have introduced a method similar to |
@scordio , @joel-costigliola , @bodewig in xmlunit it could then be overridden to return the default action or it's own check. The timing of it being called is then handled by Assertj code internal, while the decision to remove the StackTraceElement can be handled by XmlUnit code. This way the exposure will be limited to a specific behaviour that you want to extend, and not a duplication of the entire framework which decides when to use the behaviour. |
No problem for us to make |
I agree that making We'd still need access to the stack-trace cleanup logic for custom |
I was about to work on a PR for a custom |
unfortunately So be it -> ab90c1d |
once I still need to refactor a few things, but we should be close to marking this as fixed (and cutting XMLUnit 2.8.1). |
@bodewig If I understand correctly all you need from us is to make |
@joel-costigliola this is correct, yes |
@bodewig I just released 3.18.1 with this change, should be in maven central soonish. |
Many thanks @joel-costigliola @scordio and @Zegveld - I've just pushed a change that uses the now protected method. I'll be pushing a new SNAPSHOT later today so @Zegveld could verify the new xmlunit-assertj3 module works as expected in an OSGi context. There is some documentation cleanup to be done before I cut 2.8.1 but I think I should get there during the coming weekend. And I need to come up with something so we don't get to maintain two copies of very similar code bases, but this can be done post release. |
great, thank you. |
I've just release XMLUnit 2.8.1 with the new module. Announcements will go out soonish. |
When using the xmlunit-assertj module in an OSGI environment tests fail because of the use of classes in the org.assert.core.internal package. This package is not marked as exposed and can therefor not be accessed.
The only use for this import seems to be the Failures class. So far I haven't found a way to avoid it so I'm also creating an issue with the assertj-core module to request it to be moved to the util package.
See assertj/assertj#2026
The text was updated successfully, but these errors were encountered: