-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Broken QuarkusTestExtension #8446
Comments
newMethod = {java.lang.reflect.Method@8575} "void io.apicurio.registry.ArtifactStateTest.testEnableDisableArtifact(io.apicurio.registry.client.RegistryService)" Where actual argument then gets this classloader ... argumentsFromTccl = {java.util.ArrayList@8577} size = 1 |
I went through this and unfortunately there is no good solution... Although the code in the custom extension can be hacked to load everything from the TCCL instead of the CL which the methods run, that won't cut it unfortunately because JUnit then validates the returned object against the parameter type (and of course this validation fails because of the different ClassLoaders). This is somewhat related to #8252. Perhaps your custom extension could return a proxy (constructed on the regular CL) that then delegates the calls to the real object which is constructed on the TCCL. |
How would this help? |
Ah sorry, yes you are right.... |
/cc @stuartwdouglas |
I worked around this by introducing Supplier |
You did need to make the changes I suggested in chat, right? |
Which changes?
I did need to use reflection yes.
See PR.
…On Wed, 8 Apr 2020 at 19:51, Georgios Andrianakis ***@***.***> wrote:
You did need to make the changes I suggested in chat, right?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8446 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACRA6G3ROIF2CPXXVYT7GLRLS2QRANCNFSM4MDCW7HQ>
.
|
Yeah, that's what I meant. The use of reflection in your extension
…On Wed, Apr 8, 2020, 21:24 Aleš Justin ***@***.***> wrote:
Which changes?
I did need to use reflection yes.
See PR.
On Wed, 8 Apr 2020 at 19:51, Georgios Andrianakis <
***@***.***>
wrote:
> You did need to make the changes I suggested in chat, right?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#8446 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AACRA6G3ROIF2CPXXVYT7GLRLS2QRANCNFSM4MDCW7HQ
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8446 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBMDP3SCJ5T2FF7TTXP4G3RLS6NVANCNFSM4MDCW7HQ>
.
|
I dont think there is much we can do here without JUnit changes. They are considering adding better support for custom ClassLoader implementations in the next release, so hopefully that happens in a way that is useful to us. |
This is one that would potentially be fixed by @holly-cummins's WIP |
When using Quarkus 1.3.1.Final or current master against our Registry, I get this:
Zulip thread:
As mentioned / described, we use custom JUnit5 extension
(it's similar to existing JUnit5 Parameter extension, just custom for RegistryService)
To reproduce, simply change Quarkus version here:
and run "mvn clean install"
The text was updated successfully, but these errors were encountered: