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 UTs: Replace LogTester with slf4j #7600

Closed
pavel-mikula-sonarsource opened this issue Jul 13, 2023 · 2 comments
Closed

Java UTs: Replace LogTester with slf4j #7600

pavel-mikula-sonarsource opened this issue Jul 13, 2023 · 2 comments
Assignees
Labels
Area: SQ Plugin Java plugin related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: Tooling Tools make us productive.
Milestone

Comments

@pavel-mikula-sonarsource
Copy link
Contributor

As per sonar-plugin-api 9.15 change log:
https://github.com/SonarSource/sonar-plugin-api/blob/master/CHANGELOG.md#915

We need to remove usages of LogTester

This is a prerequisite for #7595

@pavel-mikula-sonarsource
Copy link
Contributor Author

Example of sonar-java PR: SonarSource/sonar-java#4416

They migrated:

Package From To
sonar-plugin-api 9.13.0.360 10.0.0.695
sonar-plugin-api-impl 9.5.0.56709 9.9.1.69595
sonar-testing-harness 9.5.0.56709 9.9.1.69595

Forced breaking changes:

  • LogTesterJUnit5 has been moved:
    • The package has changed from org.sonar.api.utils.log to org.sonar.api.testfixtures.log
    • The LogTesterJUnit5 class is now in a new artifact that we have added sonar-plugin-api-test-fixtures 10.0.0.695
  • Replace usage of org.sonar.api.utils.log.LoggerLevel with matching elements of org.slf4j.event.Level.
  • Now LogTester only collects INFO by default, we use new LogTesterJUnit5().setLevel(Level.DEBUG) to also collect DEBUG
  • org.sonar.api.SonarPlugin has been removed, we now use org.sonar.api.Plugin.
  • We have to implement the new InputFile#md5Hash() method
  • Rule repository name changes from SonarQube to Sonar

Deprecation changes:

  • Replace thousands of calls to org.sonar.api.utils.log.Logger#get with org.slf4j.LoggerFactory.getLogger from a new provided dependency org.slf4j:slf4j-api:1.7.30

@mary-georgiou-sonarsource
Copy link
Contributor

this has been already done in #7777
thanks @costin-zaharia-sonarsource!

@mary-georgiou-sonarsource mary-georgiou-sonarsource closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: SQ Plugin Java plugin related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: Tooling Tools make us productive.
Projects
None yet
Development

No branches or pull requests

2 participants