<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 4050377ffb9220600a13044673a4f9e842e76b10 Mon Sep 17 00:00:00 2001
From: Steven Aerts &lt;steven.aerts@removed.com&gt;
Date: Thu, 25 Aug 2011 11:37:48 +0200
Subject: [PATCH] Fixed JENKINS-1073

Update xml schema to conform command line xml output of klocwork.
Add tests.
---
 .../plugins/klocwork/model/xsd/klocwork-9.2.xsd    |   25 ++++++++++++++++---
 .../plugins/klocwork/KlocworkParserTest.java       |    1 +
 .../hudson/plugins/klocwork/bug-jenkins-10735.xml  |   22 +++++++++++++++++
 3 files changed, 44 insertions(+), 4 deletions(-)
 create mode 100644 src/test/resources/com/thalesgroup/hudson/plugins/klocwork/bug-jenkins-10735.xml

diff --git a/src/main/resources/com/thalesgroup/hudson/plugins/klocwork/model/xsd/klocwork-9.2.xsd b/src/main/resources/com/thalesgroup/hudson/plugins/klocwork/model/xsd/klocwork-9.2.xsd
index 28cdf65..1946bd5 100755
--- a/src/main/resources/com/thalesgroup/hudson/plugins/klocwork/model/xsd/klocwork-9.2.xsd
+++ b/src/main/resources/com/thalesgroup/hudson/plugins/klocwork/model/xsd/klocwork-9.2.xsd
@@ -148,6 +148,21 @@
 
     &lt;xs:element name="owner" type="xs:string"/&gt;
 
+    &lt;xs:element name="taxonomy"&gt;
+        &lt;xs:complexType&gt;
+            &lt;xs:attribute name="name" type="xs:string"/&gt;
+            &lt;xs:attribute name="metaInf" type="xs:string"/&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
+    &lt;xs:element name="taxonomies"&gt;
+        &lt;xs:complexType&gt;
+            &lt;xs:sequence maxOccurs="unbounded"&gt;
+                &lt;xs:element ref="tag:taxonomy"/&gt;
+            &lt;/xs:sequence&gt;
+        &lt;/xs:complexType&gt;
+    &lt;/xs:element&gt;
+
     &lt;!-- Main tags --&gt;
     &lt;xs:element name="problem"&gt;
         &lt;xs:complexType&gt;
@@ -166,9 +181,10 @@
                 &lt;xs:element ref="tag:severitylevel"/&gt;
                 &lt;xs:element ref="tag:displayAs"/&gt;
                 &lt;xs:element ref="tag:citingStatus"/&gt;
-                &lt;xs:element ref="tag:state"/&gt;
-                &lt;xs:element ref="tag:dateOriginated"/&gt;
-                &lt;xs:element ref="tag:url"/&gt;
+
+                &lt;xs:element ref="tag:state" minOccurs="0"/&gt;
+                &lt;xs:element ref="tag:dateOriginated" minOccurs="0"/&gt;
+                &lt;xs:element ref="tag:url" minOccurs="0"/&gt;
 
 
                 &lt;xs:element ref="tag:comment" minOccurs="0"/&gt;
@@ -178,6 +194,7 @@
                 &lt;xs:element ref="tag:dateFixed" minOccurs="0"/&gt;
                 &lt;xs:element ref="tag:category" minOccurs="0"/&gt;
                 &lt;xs:element ref="tag:lastCommit" minOccurs="0"/&gt;
+                &lt;xs:element ref="tag:taxonomies" minOccurs="0"/&gt;
 
 
             &lt;/xs:all&gt;
@@ -194,4 +211,4 @@
         &lt;/xs:complexType&gt;
     &lt;/xs:element&gt;
 
-&lt;/xs:schema&gt;
\ No newline at end of file
+&lt;/xs:schema&gt;
diff --git a/src/test/java/com/thalesgroup/hudson/plugins/klocwork/KlocworkParserTest.java b/src/test/java/com/thalesgroup/hudson/plugins/klocwork/KlocworkParserTest.java
index 6d5e54e..daaaf48 100755
--- a/src/test/java/com/thalesgroup/hudson/plugins/klocwork/KlocworkParserTest.java
+++ b/src/test/java/com/thalesgroup/hudson/plugins/klocwork/KlocworkParserTest.java
@@ -92,6 +92,7 @@ public class KlocworkParserTest {
     //Warning : the version of Klocwork used was 9.0 and no custom java checker were used in Klocwork
     public void testCsvToSQLProject() {
         analyzeFiles("report-csvtosql.xml", 66, 18);
+        analyzeFiles("bug-jenkins-10735.xml", 1, 0);
     }
     //TO BE COMPLETED (with other files to test)...
 }
diff --git a/src/test/resources/com/thalesgroup/hudson/plugins/klocwork/bug-jenkins-10735.xml b/src/test/resources/com/thalesgroup/hudson/plugins/klocwork/bug-jenkins-10735.xml
new file mode 100644
index 0000000..689c619
--- /dev/null
+++ b/src/test/resources/com/thalesgroup/hudson/plugins/klocwork/bug-jenkins-10735.xml
@@ -0,0 +1,22 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;errorList xmlns="http://www.klocwork.com/inForce/report/1.0"&gt;
+&lt;problem&gt;
+ &lt;problemID&gt;2&lt;/problemID&gt;
+ &lt;file&gt;C:\Jenkins_Home\jobs\NUnit Quick Learning\workspace\NUnit_Quick_Learn_1\AccountTest.cs&lt;/file&gt;
+ &lt;method&gt;AccountTest.cs&lt;/method&gt;
+ &lt;line&gt;64&lt;/line&gt;
+ &lt;column&gt;20&lt;/column&gt;
+ &lt;code&gt;CS.FLOAT.EQCHECK&lt;/code&gt;
+ &lt;message&gt;Equality check on floating point type&lt;/message&gt;
+ &lt;anchor&gt;0&lt;/anchor&gt;
+ &lt;prefix&gt;result=0;doublestep=(x2-x1)/700;&lt;/prefix&gt;
+ &lt;postfix&gt;{result=result+x*step;x=x+step;b&lt;/postfix&gt;
+ &lt;citingStatus&gt;Analyze&lt;/citingStatus&gt;
+ &lt;severity&gt;Style&lt;/severity&gt;
+ &lt;severitylevel&gt;8&lt;/severitylevel&gt;
+ &lt;displayAs&gt;Warning&lt;/displayAs&gt;
+ &lt;taxonomies&gt;
+  &lt;taxonomy name="C#" metaInf=""/&gt;
+ &lt;/taxonomies&gt;
+&lt;/problem&gt;
+&lt;/errorList&gt;
\ No newline at end of file
-- 
1.7.5.2

</pre></body></html>