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

Java 17 Record tests do not run (jackson-jr-test-module) #149

Closed
cowtowncoder opened this issue Jun 13, 2024 · 3 comments
Closed

Java 17 Record tests do not run (jackson-jr-test-module) #149

cowtowncoder opened this issue Jun 13, 2024 · 3 comments

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 13, 2024

Looks like tests added for #94 (and further #148) do not actually get run with 2.17/2.17: groovy tests do, java tests not. Need to figure out now.

At first thought use of JUnit5 was the problem (all other tests run on JUnit4) but that's not it.
Maven module is not imported by Eclipse so I have limited visibility (can try with Idea next).

I wonder if Groovy and Java17 tests need to be separate into different modules, even.

@cowtowncoder
Copy link
Member Author

/cc @Shounaks @TomaszGaweda

@cowtowncoder cowtowncoder changed the title Java 17 Record tests not sure (jackson-jr-test-module) Java 17 Record tests do not run (jackson-jr-test-module) Jun 14, 2024
@cowtowncoder
Copy link
Member Author

Started by renaming existing module as jr-groovy-test. Also noticed it was being published (even if as just pom.xml) -- that is wasteful and unnecessary, so will block that.

And it is necessary to separate out Records test as they can only run with JDK 17 -- and the way to do that (while still allowing other modules to build on JDK 8) is , I think, via Profiles (or play with toolchains or something else). At least jackson-databind does that.
But I think I'll try to create separate Maven module for test(s) to avoid possible breakage of jr-objects.

@cowtowncoder
Copy link
Member Author

cowtowncoder commented Jun 14, 2024

Fixed so that test now run; under new jackson-jr-record-test module.

But one thing that I think it's wrong -- and I wish I had noticed it originally is that this:

JSON.builder().enable(JSON.Feature.USE_FIELD_MATCHING_GETTERS).build();

should NOT be needed; setting should be dynamically applied for Record types.
I'll create separate issues for fixing this for serialization, and deserialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant