Skip to content

[java] Fix #4350: Fix ClassNamingConventions by teaching TestFrameworkUtil about type resolution#6689

Merged
adangel merged 5 commits into
pmd:mainfrom
UncleOwen:issue-4350-java]-ClassNamingConventions-testClassPattern-not-applied-to-class-that-inherits-all-its-@Test-methods
May 28, 2026
Merged

[java] Fix #4350: Fix ClassNamingConventions by teaching TestFrameworkUtil about type resolution#6689
adangel merged 5 commits into
pmd:mainfrom
UncleOwen:issue-4350-java]-ClassNamingConventions-testClassPattern-not-applied-to-class-that-inherits-all-its-@Test-methods

Conversation

@UncleOwen
Copy link
Copy Markdown
Member

@UncleOwen UncleOwen commented May 16, 2026

Describe the PR

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • [n/a] Added (in-code) documentation (if needed)

@pmd-actions-helper
Copy link
Copy Markdown
Contributor

pmd-actions-helper Bot commented May 16, 2026

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-05-25 14:48:29+00:00 for 7d9ecce)

@UncleOwen UncleOwen force-pushed the issue-4350-java]-ClassNamingConventions-testClassPattern-not-applied-to-class-that-inherits-all-its-@Test-methods branch 2 times, most recently from 1fd0d0f to b6a2fe8 Compare May 22, 2026 16:38
UncleOwen added 4 commits May 24, 2026 12:44
This change removes the visibility check from isJUnit4Method. It was not
needed (see https://pull-requests.pmd-code.org/pr-6685/cbd30fcbbd68a7b96a9b4eabbbf1c46a46f7a411/regression/).
This brings isJUnit4Method in line with isJUnit5Method and isTestNgMethod.
... by replacing its implementation with the obvious one.

Slight change to the method signature of isTestClass. But that's
allowed, since TestFrameworksUtil is NOT public API
(it is in a .internal package)
@UncleOwen UncleOwen force-pushed the issue-4350-java]-ClassNamingConventions-testClassPattern-not-applied-to-class-that-inherits-all-its-@Test-methods branch from b6a2fe8 to 1cb7b90 Compare May 24, 2026 10:46
@UncleOwen UncleOwen requested a review from lukasgraef May 24, 2026 11:07
Comment thread docs/pages/release_notes.md Outdated
adangel

This comment was marked as resolved.

@adangel adangel added this to the 7.25.0 milestone May 28, 2026
Copy link
Copy Markdown
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks!

@adangel adangel merged commit 25f30fe into pmd:main May 28, 2026
13 checks passed
@UncleOwen UncleOwen deleted the issue-4350-java]-ClassNamingConventions-testClassPattern-not-applied-to-class-that-inherits-all-its-@Test-methods branch May 28, 2026 07:22
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.

[java] ClassNamingConventions: testClassPattern not applied to class that inherits all its @Test methods

2 participants