Skip to content

Commit

Permalink
try to reproduce reported issues but failed
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA authored and hazendaz committed Aug 29, 2024
1 parent 0486be2 commit 244ef5a
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/it/encoding-aux-classpath/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
invoker.goals = clean compile spotbugs:check -X

# The expected result of the build, possible values are "success" (default) and "failure"
invoker.buildResult = success
Binary file added src/it/encoding-aux-classpath/lib/könig/empty.jar
Binary file not shown.
56 changes: 56 additions & 0 deletions src/it/encoding-aux-classpath/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2006-2007 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.spotbugs.spotbugs-maven-plugin.it</groupId>
<artifactId>common</artifactId>
<version>testing</version>
<relativePath>../common.xml</relativePath>
</parent>
<artifactId>encoding-aux-classpath</artifactId>
<name>encoding-aux-classpath</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>empty</groupId>
<artifactId>empty</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/könig/empty.jar</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<xmlOutput>true</xmlOutput>
<failOnError>false</failOnError>
<debug>@spotbugsTestDebug@</debug>
<threshold>High</threshold>
</configuration>
</plugin>
</plugins>
</build>
</project>
49 changes: 49 additions & 0 deletions src/it/encoding-aux-classpath/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (C) 2006-2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

File spotbugsHtml = new File(basedir, 'target/site/spotbugs.html')
assert !spotbugsHtml.exists()

File spotbugXdoc = new File(basedir, 'target/spotbugs.xml')
assert spotbugXdoc.exists()

File spotbugXml = new File(basedir, 'target/spotbugsXml.xml')
assert spotbugXml.exists()

println '**********************************'
println "Checking Spotbugs Native XML file"
println '**********************************'

path = new XmlSlurper().parse(spotbugXml)

allNodes = path.depthFirst().collect{ it }
def spotbugsXmlErrors = allNodes.findAll {it.name() == 'BugInstance'}.size()
println "BugInstance size is ${spotbugsXmlErrors}"



println '***************************'
println "Checking xDoc file"
println '***************************'

def path = new XmlSlurper().parse(spotbugXdoc)

xNodes = path.depthFirst().collect{ it }
def xdocErrors = xNodes.findAll {it.name() == 'BugInstance'}.size()
println "BugInstance size is ${xdocErrors}"

assert xdocErrors == spotbugsXmlErrors

0 comments on commit 244ef5a

Please sign in to comment.