feat: Migrate com.avaloq.tools.ddk.xtext.generator.test to Junit5#1214
Conversation
markdomeng
commented
Nov 6, 2025
- completely remove junit4 dependencies, hence removing the need for dependency in junit-vintage-engine
- create AbstractTest and AbstractXtextTest that does not need junit4 runners
- create junit5 extensions for LoggingRule, BugTestAwareRule, and IssueAwareRule to move away from the junit4 @rule annotation and use @RegisterExtension instead
3fd8af7 to
4127e66
Compare
There was a problem hiding this comment.
I think this is the only file that needs adjustments.. but all other Abstract classes like AbstractScoping, Formatting, marker based tests are used downstream, and if I change them to junit5 the downstream tests might fail?
There was a problem hiding this comment.
i can confirm it fails.. i tried converting directly the abstract marker based, and abstract formatting classes to be in native junit5 code.. and the junit4 tests that extends it are failing.. I think we should temporarily keep 2 copies of the abstract tests? one in the .jupiter package that i created in this change, and one in the old .core package
There was a problem hiding this comment.
I agree, we should have copies to allow an step-wise upgrade of downstream projects
| @@ -0,0 +1,100 @@ | |||
| /******************************************************************************* | |||
| * Copyright (c) 2016 Avaloq Group AG and others. | |||
There was a problem hiding this comment.
new classes shouuld have copyright year 2025 :)
- completely remove junit4 dependencies, hence removing the need for dependency in junit-vintage-engine - create AbstractTest and AbstractXtextTest that does not need junit4 runners - create junit5 extensions for LoggingRule, BugTestAwareRule, and IssueAwareRule to move away from the junit4 @rule annotation and use @RegisterExtension instead
4127e66 to
c0dd0ad
Compare
| @RunWith(XtextRunner) | ||
| class XbaseGeneratorFragmentTest extends TestCase { | ||
| @ExtendWith(InjectionExtension) | ||
| class XbaseGeneratorFragmentTest { |
There was a problem hiding this comment.
I actually have a question @rubenporras , this test was removed and is failing since forever. I tried to make it pass but im not successful. why does this test exist?
There was a problem hiding this comment.
I have no idea, if it makes your work easier, just remove it.