Fork me on GitHub

Surefire Report

Summary

[Summary] [Package List] [Test Cases]


Tests Errors Failures Skipped Success Rate Time
207 0 0 0 100% 8.287 s

Note: failures are anticipated and checked for with assertions while errors are unanticipated.


Package List

[Summary] [Package List] [Test Cases]


Package Tests Errors Failures Skipped Success Rate Time
(default package) 185 0 0 0 100% 2.586 s
org.codehaus.mojo.spotbugs 22 0 0 0 100% 5.701 s

Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.

(default package)

- Class Tests Errors Failures Skipped Success Rate Time
HelpMojoTest 7 0 0 0 100% 0.341 s
StubOverrideFixerTest 4 0 0 0 100% 0.236 s
BaseViolationCheckMojoTest 22 0 0 0 100% 0.178 s
CheckMojoTest 2 0 0 0 100% 0.004 s
PluginArtifactTest 1 0 0 0 100% 0.042 s
ResourceHelperTest 9 0 0 0 100% 0.132 s
SourceFileIndexerTest 7 0 0 0 100% 0.352 s
SpotBugsAggregateMojoTest 19 0 0 0 100% 0.336 s
SpotBugsGuiTest 2 0 0 0 100% 0.036 s
SpotBugsInfoTest 10 0 0 0 100% 0.008 s
SpotBugsMojoTest 55 0 0 0 100% 0.488 s
SpotBugsPluginsTraitTest 23 0 0 0 100% 0.248 s
SpotbugsReportGeneratorTest 8 0 0 0 100% 0.086 s
VerifyMojoTest 2 0 0 0 100% 0.001 s
XDocsReporterTest 14 0 0 0 100% 0.098 s

org.codehaus.mojo.spotbugs

- Class Tests Errors Failures Skipped Success Rate Time
CheckMojoHarnessTest 11 0 0 0 100% 4.516 s
VerifyMojoHarnessTest 11 0 0 0 100% 1.185 s

Test Cases

[Summary] [Package List] [Test Cases]

HelpMojoTest

execute completes without error using default parameters 0.240 s
execute with detail=true lists all goals and parameters 0.019 s
execute with a specific goal name does not throw 0.008 s
execute with detail=true and specific goal does not throw 0.009 s
execute warns and resets lineLength when it is zero or negative 0.042 s
execute warns and resets indentSize when it is zero or negative 0.019 s
execute with unknown goal name does not throw 0.004 s

StubOverrideFixerTest

main adds @Override annotation to Groovy methods in stub files 0.215 s
main processes all .java files in directory recursively 0.007 s
main ignores non-.java files 0.007 s
main does not add @Override to non-Groovy methods 0.007 s

BaseViolationCheckMojoTest

should extend AbstractMojo 0.003 s
should have default property values not injected 0.004 s
should allow setting properties 0.002 s
should not throw when execute is called 0.001 s
execute() returns early and logs info when skip=true 0.011 s
execute() exits early when class files directory does not exist 0.004 s
execute() exits early when class files directory is empty 0.004 s
execute() scans test classes when includeTests=true 0.007 s
execute() warns and returns when XML output file is missing 0.005 s
execute() logs no-bugs message when XML contains zero bugs 0.011 s
execute() throws MojoExecutionException when bugs exist and failOnError=true 0.011 s
execute() does not throw when bugs exist and failOnError=false 0.010 s
execute() suppresses build failure when bug count is within maxAllowedViolations 0.009 s
execute() throws when bug count exceeds maxAllowedViolations 0.015 s
execute() throws for invalid failThreshold value 0.010 s
execute() does not throw when all bugs are below failThreshold 0.011 s
execute() does not log individual bugs when quiet=true 0.011 s
execute() logs file-walking details when debug is enabled 0.015 s
bugLog formats bug message using LongMessage, classname, source message and type 0.005 s
execute() throws when error count is non-zero and failOnError=true 0.010 s
execute() does not fail when errors present but failOnError=false 0.012 s
execute() creates output directory if it does not exist 0.007 s

CheckMojoHarnessTest

executeWithInvalidFailThreshold(CheckMojo, File) 2.855 s
executeWithBugsWithinMaxAllowedViolations(CheckMojo, File) 0.245 s
executeWithMissingOutputFile(CheckMojo, File) 0.151 s
mojoLoadedWithDefaults(CheckMojo) 0.122 s
executeWithEmptyClassDirectory(CheckMojo, File) 0.118 s
executeWithFailThresholdLow(CheckMojo, File) 0.148 s
executeWithNoBugsInReport(CheckMojo, File) 0.114 s
executeWithMissingClassDirectory(CheckMojo, File) 0.121 s
executeWithBugsAndFailOnError(CheckMojo, File) 0.129 s
executeWithSkipEnabled(CheckMojo, File) 0.129 s
executeWithBugsAndNoFailOnError(CheckMojo, File) 0.115 s

CheckMojoTest

should extend BaseViolationCheckMojo 0.001 s
should skip execution 0.003 s

PluginArtifactTest

should satisfy JavaBean contract 0.042 s

ResourceHelperTest

getResourceFile returns a file with content from resource and logs debug info 0.053 s
getResourceFile returns an existing file in output directory 0.015 s
getResourceFile sanitizes special characters in path components 0.008 s
constructor throws NullPointerException when log is null 0.003 s
constructor throws NullPointerException when resourceManager is null 0.003 s
getResourceFile throws NullPointerException when resource is null 0.002 s
getResourceFile handles resource without path separator 0.015 s
getResourceFile throws MojoExecutionException when reading the resource stream throws IOException 0.020 s
getResourceFile works without debug logging enabled 0.013 s

SourceFileIndexerTest

buildListSourceFiles and searchActualFilesLocation work as expected 0.287 s
searchActualFilesLocation throws if not initialized 0.001 s
buildListSourceFiles scans nested subdirectories 0.019 s
searchActualFilesLocation returns null when file is not found 0.010 s
buildListSourceFiles indexes test compile source roots 0.010 s
buildListSourceFiles handles non-existent source directories gracefully 0.006 s
buildListSourceFiles can be called multiple times resetting the cache each time 0.019 s

SpotBugsAggregateMojoTest

canGenerateReport returns false when skip=true 0.015 s
canGenerateReport returns false when no reactor projects have XML results 0.010 s
canGenerateReport returns false when XML file exists but is empty 0.009 s
canGenerateReport returns true when at least one reactor project has a non-empty XML 0.015 s
buildAggregatedXml returns null when no reactor projects have XML 0.023 s
buildAggregatedXml merges XML from multiple modules 0.194 s
buildAggregatedXml skips module XML that cannot be parsed 0.028 s
executeReport returns early when canGenerateReport is false 0.005 s
executeReport warns when buildAggregatedXml returns null 0.006 s
executeReport with debug enabled logs preamble message 0.004 s
SpotBugsAggregateMojo extends AbstractMavenReport 0.001 s
mojo has expected default property values 0.001 s
properties can be set and read back 0.002 s
canGenerateReport returns true when only some reactor projects have XML files 0.005 s
getDescription returns value from resource bundle for given locale 0.011 s
getName returns value from resource bundle for given locale 0.002 s
getBundle returns a non-null ResourceBundle for the English locale 0.001 s
getOutputDirectory returns the outputDirectory absolute path 0.002 s
setReportOutputDirectory updates the outputDirectory field 0.002 s

SpotBugsGuiTest

execute logs encoding and skips launch in headless mode when explicit encoding is set 0.027 s
execute uses default encoding and skips launch in headless mode when encoding is not set 0.009 s

SpotBugsInfoTest

should have correct static constants 0.001 s
should have correct EOL 0.001 s
should have correct spotbugsEfforts map 0.002 s
should have correct spotbugsThresholds map 0.001 s
should have correct spotbugsPriority list 0.001 s
should have correct suffix and aggregate key constants 0 s
spotbugsThresholds contains exactly five entries 0.001 s
spotbugsEfforts contains exactly three entries 0 s
spotbugsPriority has unknown at index 0 0.001 s
spotbugsPriority indexOf works correctly for valid priorities 0 s

SpotBugsMojoTest

should extend AbstractMojo 0.002 s
should skip generate report 0.040 s
containsJdkClasses returns true for a JAR with java.* classes 0.026 s
containsJdkClasses returns false for a JAR without java.* classes 0.018 s
containsJdkClasses returns false for a non-jar path 0.006 s
canGenerateReport returns false when skip=true 0.002 s
canGenerateReport returns false when class directory does not exist 0.005 s
canGenerateReport returns false when class directory is empty and noClassOk=false 0.004 s
canGenerateReport returns true when noClassOk=true and class directory exists 0.004 s
canGenerateReport returns false when class directory is empty and noClassOk=false and includeTests=true but test dir empty 0.004 s
getOutputName returns spotbugs plugin name 0.001 s
getOutputPath returns spotbugs plugin name 0.001 s
getJavaExecutable returns null when no toolchain is configured 0.006 s
getJavaExecutable returns null when toolchainManager is null 0.001 s
getJavaExecutable returns java executable from configured toolchain 0.008 s
getThresholdParameter returns -high for threshold High 0.004 s
getThresholdParameter returns -experimental for threshold Exp 0.003 s
getThresholdParameter returns -low for threshold Low 0.004 s
getThresholdParameter returns -high for lowercase threshold high 0.003 s
getThresholdParameter returns -medium for unknown threshold 0.003 s
getName returns SpotBugs in English 0.001 s
getDescription returns non-empty description in English 0.001 s
getOutputDirectory returns absolute path of outputDirectory 0.001 s
setReportOutputDirectory sets outputDirectory 0.001 s
isJxrPluginEnabled returns true when xrefLocation exists 0.003 s
isJxrPluginEnabled returns false when xrefLocation missing and no report plugins 0.066 s
isJxrPluginEnabled returns true when maven-jxr-plugin is in report plugins 0.028 s
canGenerateReport with nested=true and JAR covers nested file detection 0.024 s
canGenerateReport covers site lifecycle detection via session goals 0.006 s
getSpotbugsArgs includes basic required args for a simple configuration 0.019 s
getSpotbugsArgs includes -html arg when htmlOutput is true 0.009 s
getSpotbugsArgs includes -sarif arg when sarifOutput is true 0.012 s
getSpotbugsArgs includes auxclasspathFromFile when auxClasspathFile is provided 0.010 s
getSpotbugsArgs includes -progress when debug is true 0.006 s
getSpotbugsArgs includes -nested:true when nested is enabled 0.003 s
getSpotbugsArgs includes visitors when set 0.004 s
getSpotbugsArgs includes omitVisitors when set 0.004 s
getSpotbugsArgs includes chooseVisitors when set 0.004 s
getSpotbugsArgs includes -relaxed when relaxed is true 0.005 s
getSpotbugsArgs includes -maxRank when maxRank is set 0.004 s
getSpotbugsArgs includes -noClassOk when noClassOk is true 0.005 s
getSpotbugsArgs includes class directory when it exists 0.004 s
getSpotbugsArgs includes test class directory when includeTests=true and dir exists 0.003 s
getSpotbugsArgs includes addSourceDirs args when addSourceDirs=true 0.012 s
getSpotbugsArgs uses -high threshold parameter 0.004 s
getSpotbugsArgs uses -effort:max when effort is Max 0.003 s
createSpotbugsAuxClasspathFile returns null when classpath elements are null 0.013 s
createSpotbugsAuxClasspathFile returns null when classpath elements are empty 0.011 s
createSpotbugsAuxClasspathFile creates file with filtered classpath 0.021 s
createSpotbugsAuxClasspathFile uses testClasspathElements when includeTests=true 0.017 s
createSpotbugsAuxClasspathFile excludes JARs containing java.* classes 0.026 s
forceFileCreation creates file and parent directories 0.004 s
forceFileCreation replaces an existing file 0.003 s
getEffortParameter returns -effort:min for Min 0.003 s
getEffortParameter returns -effort:default for Default 0.003 s

SpotBugsPluginsTraitTest

getEffortParameter returns correct effort string [effort: Max, expected: -effort:max, #0] 0.014 s
getEffortParameter returns correct effort string [effort: Min, expected: -effort:min, #1] 0.001 s
getEffortParameter returns correct effort string [effort: Normal, expected: -effort:default, #2] 0 s
getEffortParameter returns correct effort string [effort: null, expected: -effort:default, #3] 0.001 s
getEffortParameter returns correct effort string 0.027 s
isSpotBugsPlugin returns true for JAR containing findbugs.xml at root 0.012 s
isSpotBugsPlugin returns false for JAR without findbugs.xml 0.010 s
isSpotBugsPlugin returns false for null file 0.001 s
isSpotBugsPlugin returns false for non-JAR file 0.002 s
buildBugTypeUrlMap returns empty map when no plugins are configured 0.007 s
buildBugTypeUrlMap maps bug types from a known plugin using built-in defaults 0.024 s
buildBugTypeUrlMap respects user-supplied URL override for a known plugin 0.010 s
buildBugTypeUrlMap supports user-supplied URL for an unknown plugin 0.011 s
buildBugTypeUrlMap ignores plugin JARs without a configured URL 0.012 s
buildBugTypeUrlMap with pluginArtifacts maps bug types from non-spotbugs artifact 0.019 s
buildBugTypeUrlMap skips artifacts from com.github.spotbugs group 0.010 s
getSpotbugsPlugins returns empty string when no plugins configured 0.007 s
getSpotbugsPlugins includes JAR from pluginList 0.018 s
getSpotbugsPlugins includes plugin JAR from non-spotbugs pluginArtifacts 0.018 s
getSpotbugsPlugins skips pluginArtifacts from com.github.spotbugs group 0.012 s
getSpotbugsPlugins skips non-spotbugs artifact without findbugs.xml 0.011 s
buildBugTypeUrlMap logs warning for corrupt JAR covers catch block 0.007 s
getSpotbugsPlugins with debug logging covers debug paths in pluginList handling 0.014 s

SpotbugsReportGeneratorTest

generateReport calls all main report sections 0.067 s
getBugDetailsUrl returns default SpotBugs URL when bugTypeUrlMap is empty 0.001 s
getBugDetailsUrl returns mapped URL for a known addon bug type 0 s
getBugDetailsUrl falls back to default URL for a type not in the map 0 s
generateReport with JXR enabled covers assembleJxrHyperlink path 0.009 s
generateReport with debug logging enabled covers debug paths 0.007 s
SpotbugsReportGenerator constructor rejects null sink 0.001 s
SpotbugsReportGenerator constructor rejects null bundle 0.001 s

VerifyMojoHarnessTest

executeWithInvalidFailThreshold(VerifyMojo, File) 0.120 s
executeWithBugsWithinMaxAllowedViolations(VerifyMojo, File) 0.100 s
executeWithMissingOutputFile(VerifyMojo, File) 0.113 s
mojoLoadedWithDefaults(VerifyMojo) 0.107 s
executeWithEmptyClassDirectory(VerifyMojo, File) 0.102 s
mojoLoadedSuccessfully(VerifyMojo) 0.114 s
executeWithNoBugsInReport(VerifyMojo, File) 0.102 s
executeWithMissingClassDirectory(VerifyMojo, File) 0.098 s
executeWithBugsAndFailOnError(VerifyMojo, File) 0.101 s
executeWithSkipEnabled(VerifyMojo, File) 0.099 s
executeWithBugsAndNoFailOnError(VerifyMojo, File) 0.119 s

VerifyMojoTest

should extend BaseViolationCheckMojo 0 s
should skip execution 0.001 s

XDocsReporterTest

evaluateThresholdParameter returns correct threshold name [input: 1, expected: High, #0] 0.016 s
evaluateThresholdParameter returns correct threshold name [input: 2, expected: Normal, #1] 0 s
evaluateThresholdParameter returns correct threshold name [input: 3, expected: Low, #2] 0.001 s
evaluateThresholdParameter returns correct threshold name [input: 4, expected: Exp, #3] 0 s
evaluateThresholdParameter returns correct threshold name [input: 5, expected: Ignore, #4] 0.001 s
evaluateThresholdParameter returns correct threshold name [input: 99, expected: Invalid Priority, #5] 0 s
evaluateThresholdParameter returns correct threshold name 0.020 s
generateReport writes XML output 0.033 s
generateReport with BugInstance covers bug processing closures 0.012 s
generateReport with debug logging enabled covers debug paths 0.008 s
generateReport with test source roots covers testSourceRoots iteration 0.005 s
XDocsReporter constructor rejects null bundle 0.001 s
XDocsReporter constructor rejects null log 0 s
XDocsReporter constructor rejects null threshold 0.001 s