You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
I wrote a detector and some test classes for it. Also, I migrated the test code to JUnit5, using SpotBugsExtension class from the test-harness-jupiter artifact. Everything worked as expected until I tried to change the category of the detected bug, by changing the value of the category attribute of the BugPattern tag for the bug type reported by my detector in findbugs.xml.
The bugs in the "bad case" classes are in fact detected in my tests if the category is the default CORRECTNESS, but not, for example, if I set it to BAD_PRACTICE or STYLE.
Is it possible to instruct the SpotBugsRunner which the JUnit extension injects in my test methods to also detect bugs of these categories?
The text was updated successfully, but these errors were encountered:
The problem comes if your custom detector tries to refer to any of the "built-in" categories other thanCORRECTNESS.
Not sure why this is happening but it seems to be some interaction between the way the test harness AnalysisRunner is constructing a UserPreferences instance to pass to the engine.
I'm writing a SpotBugs plugin, starting from the maven archetype as suggested in the documentation.
I wrote a detector and some test classes for it. Also, I migrated the test code to JUnit5, using
SpotBugsExtension
class from thetest-harness-jupiter
artifact. Everything worked as expected until I tried to change the category of the detected bug, by changing the value of thecategory
attribute of theBugPattern
tag for the bug type reported by my detector infindbugs.xml
.The bugs in the "bad case" classes are in fact detected in my tests if the category is the default
CORRECTNESS
, but not, for example, if I set it toBAD_PRACTICE
orSTYLE
.Is it possible to instruct the
SpotBugsRunner
which the JUnit extension injects in my test methods to also detect bugs of these categories?The text was updated successfully, but these errors were encountered: