From ba2900b27dba97c70d2bdbce043b752907ea7ea3 Mon Sep 17 00:00:00 2001 From: andrealaura Date: Fri, 9 Dec 2016 11:23:58 +0100 Subject: [PATCH] =?UTF-8?q?[FIX=20JENKINS-36044]:=20Added=20default=20loca?= =?UTF-8?q?le=20to=20XMLUtilsTest=20so=20that=20it=20=E2=80=A6=20(#2649)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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. --- core/src/test/java/jenkins/xml/XMLUtilsTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/jenkins/xml/XMLUtilsTest.java b/core/src/test/java/jenkins/xml/XMLUtilsTest.java index aac8ab8e53..55b0d806bb 100644 --- a/core/src/test/java/jenkins/xml/XMLUtilsTest.java +++ b/core/src/test/java/jenkins/xml/XMLUtilsTest.java @@ -42,7 +42,6 @@ import javax.xml.xpath.XPathExpressionException; 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 { @@ -127,10 +126,10 @@ public class XMLUtilsTest { "&xxe;"; 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\"")); } } }