Skip to content

feat: Migrate com.avaloq.tools.ddk.xtext.generator.test to Junit5#1214

Merged
markdomeng merged 1 commit into
dsldevkit:masterfrom
markdomeng:generatorTestsJunit5
Nov 6, 2025
Merged

feat: Migrate com.avaloq.tools.ddk.xtext.generator.test to Junit5#1214
markdomeng merged 1 commit into
dsldevkit:masterfrom
markdomeng:generatorTestsJunit5

Conversation

@markdomeng
Copy link
Copy Markdown
Collaborator

  • 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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@markdomeng markdomeng force-pushed the generatorTestsJunit5 branch from 4127e66 to c0dd0ad Compare November 6, 2025 09:31
@RunWith(XtextRunner)
class XbaseGeneratorFragmentTest extends TestCase {
@ExtendWith(InjectionExtension)
class XbaseGeneratorFragmentTest {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, if it makes your work easier, just remove it.

@markdomeng markdomeng merged commit a2d7228 into dsldevkit:master Nov 6, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants