Skip to content

Commit

Permalink
[FIX JENKINS-36044]: Added default locale to XMLUtilsTest so that it … (
Browse files Browse the repository at this point in the history
#2649)

* [FIX JENKINS-36044]: Added default locale to XMLUtilsTest so that it runs independent from the host OS locale.

* [FIX JENKINS-36044]: Cleanup default-locale after test, to avoid impact to other tests.

*  [FIX JENKINS-36044]: Make test language indepedent.

* [FIX JENKINS-36044]: Cleanup unused imports.
  • Loading branch information
andrealaura authored and daniel-beck committed Dec 9, 2016
1 parent 7292c91 commit ba2900b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/test/java/jenkins/xml/XMLUtilsTest.java
Expand Up @@ -42,7 +42,6 @@
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.Assert.assertThat;
import org.jvnet.hudson.test.Issue;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

public class XMLUtilsTest {
Expand Down Expand Up @@ -127,10 +126,10 @@ public void testParse_with_XXE() throws IOException, XPathExpressionException {
"<foo>&xxe;</foo>";

StringReader stringReader = new StringReader(xml);
Document doc = XMLUtils.parse(stringReader);
XMLUtils.parse(stringReader);
Assert.fail("Expecting SAXException for XXE.");
} catch (SAXException e) {
assertThat(e.getMessage(), containsString("DOCTYPE is disallowed"));
assertThat(e.getMessage(), containsString("\"http://apache.org/xml/features/disallow-doctype-decl\""));
}
}
}

0 comments on commit ba2900b

Please sign in to comment.