Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-20070] Clear SAX system property afterwards.
  • Loading branch information
uhafner committed Jan 31, 2014
1 parent c28a396 commit 9dbc731
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -10,6 +10,7 @@
import java.util.Iterator;
import java.util.Map;

import hudson.plugins.analysis.util.SaxSetup;
import org.apache.commons.io.IOUtils;
import org.dom4j.DocumentException;
import org.junit.Test;
Expand Down Expand Up @@ -178,10 +179,10 @@ public void issue7312and7932() throws IOException, SAXException, DocumentExcepti
FindBugsMessages.getInstance().initialize();

String saxParser = this.getClass().getName();
System.setProperty(FindBugsParser.SAX_DRIVER_PROPERTY, saxParser);
System.setProperty(SaxSetup.SAX_DRIVER_PROPERTY, saxParser);
MavenModule module = parseFile("issue7312.xml", false);
assertEquals("Wrong number of warnings", 0, module.getNumberOfAnnotations());
assertEquals("Wrong sax parser property", saxParser, System.getProperty(FindBugsParser.SAX_DRIVER_PROPERTY));
assertEquals("Wrong sax parser property", saxParser, System.getProperty(SaxSetup.SAX_DRIVER_PROPERTY));
}

/**
Expand All @@ -196,13 +197,13 @@ public void issue7312and7932() throws IOException, SAXException, DocumentExcepti
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-7932">Issue 7932</a>
*/
@Test
public void issue7932OOnNull() throws IOException, SAXException, DocumentException {
public void issue7932Null() throws IOException, SAXException, DocumentException {
FindBugsMessages.getInstance().initialize();

System.clearProperty(FindBugsParser.SAX_DRIVER_PROPERTY);
System.clearProperty(SaxSetup.SAX_DRIVER_PROPERTY);
MavenModule module = parseFile("issue7312.xml", false);
assertEquals("Wrong number of warnings", 0, module.getNumberOfAnnotations());
assertNull("Wrong sax parser property", System.getProperty(FindBugsParser.SAX_DRIVER_PROPERTY));
assertNull("Wrong sax parser property", System.getProperty(SaxSetup.SAX_DRIVER_PROPERTY));
}

/**
Expand Down

0 comments on commit 9dbc731

Please sign in to comment.