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

ClassCastException in @ParameterizedTest: Base Class from Different Class Loader #62

Closed
snowdrop-bot opened this issue Apr 16, 2020 · 0 comments
Assignees
Labels
upstream/closed The issue has been closed in the upstream repository

Comments

@snowdrop-bot
Copy link
Collaborator

Describe the bug
Running a @QuarkusTest fails with a java.lang.ClassCastException, see MWE.

Expected behavior
The tests passes.

Actual behavior
When using @ParameterizedTest with @MethodSource, see MWE, the test fails with the following exception:
java.lang.ClassCastException: class org.hamcrest.core.Is cannot be cast to class org.hamcrest.Matcher (org.hamcrest.core.Is is in unnamed module of loader 'app'; org.hamcrest.Matcher is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @7188af83)

However, if the test parameters are mapped manually (using a regular @Test) it passes.

To Reproduce
Steps to reproduce the behavior:

  1. Check out the MWE
  2. run ./mvnw verify

Configuration

# no properties are set explicitly

Environment (please complete the following information):

  • Output of uname -a or ver:
    Darwin Kernel Version 19.3.0; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
    
  • Output of java -version: 11.0.1, vendor: Oracle Corporation
  • Quarkus version or git rev: 1.3.1.Final
  • Build tool (ie. output of mvnw --version or gradlew --version):
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Java version: 11.0.1, vendor: Oracle Corporation, runtime: [...]
    Default locale: de_DE, platform encoding: UTF-8
    OS name: "mac os x", version: "10.15.3", arch: "x86_64", family: "mac"
    

Additional context
The behavior occurred when I upgraded quarkus from 1.2.1.Final to 1.3.0.Final/1.3.1.Final.


quarkusio#8251


$upstream:8251$

@snowdrop-bot snowdrop-bot added the upstream/closed The issue has been closed in the upstream repository label May 19, 2020
@iocanel iocanel closed this as completed May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream/closed The issue has been closed in the upstream repository
Projects
None yet
Development

No branches or pull requests

3 participants