From 19cc4c333ae3b67a481d394f3782c77bd0da7e8e Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Thu, 12 Oct 2017 07:35:13 +0800 Subject: [PATCH] try to reproduce reported issues but failed https://github.com/spotbugs/spotbugs/issues/420 --- .../encoding-aux-classpath/invoker.properties | 4 ++ .../lib/k\303\266nig/empty.jar" | Bin 0 -> 136 bytes src/it/encoding-aux-classpath/pom.xml | 56 ++++++++++++++++++ src/it/encoding-aux-classpath/verify.groovy | 49 +++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 src/it/encoding-aux-classpath/invoker.properties create mode 100644 "src/it/encoding-aux-classpath/lib/k\303\266nig/empty.jar" create mode 100644 src/it/encoding-aux-classpath/pom.xml create mode 100644 src/it/encoding-aux-classpath/verify.groovy diff --git a/src/it/encoding-aux-classpath/invoker.properties b/src/it/encoding-aux-classpath/invoker.properties new file mode 100644 index 000000000..45e8f54e3 --- /dev/null +++ b/src/it/encoding-aux-classpath/invoker.properties @@ -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 diff --git "a/src/it/encoding-aux-classpath/lib/k\303\266nig/empty.jar" "b/src/it/encoding-aux-classpath/lib/k\303\266nig/empty.jar" new file mode 100644 index 0000000000000000000000000000000000000000..09b21e20d7d2bd0981d0641030c18501a92f5f13 GIT binary patch literal 136 zcmWIWW@h1H0D(u{Zr)%9lwf5LU`Wj^D5(sM;9-dHy&eg|Ul~Oh0=yZSM454E;(?jr du%r>hgc`vCHzL5Bl?^1p2!!@P+8D%P001Ul7B~O^ literal 0 HcmV?d00001 diff --git a/src/it/encoding-aux-classpath/pom.xml b/src/it/encoding-aux-classpath/pom.xml new file mode 100644 index 000000000..9056c5390 --- /dev/null +++ b/src/it/encoding-aux-classpath/pom.xml @@ -0,0 +1,56 @@ + + + + + 4.0.0 + + com.github.spotbugs.spotbugs-maven-plugin.it + common + testing + ../common.xml + + encoding-aux-classpath + encoding-aux-classpath + jar + + UTF-8 + + + + empty + empty + 1.0 + system + ${project.basedir}/lib/könig/empty.jar + + + + + + com.github.spotbugs + spotbugs-maven-plugin + + true + false + @spotbugsTestDebug@ + High + + + + + diff --git a/src/it/encoding-aux-classpath/verify.groovy b/src/it/encoding-aux-classpath/verify.groovy new file mode 100644 index 000000000..d7e39fd95 --- /dev/null +++ b/src/it/encoding-aux-classpath/verify.groovy @@ -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 +