[FIX JENKINS-36044]: Added default locale to XMLUtilsTest so that it … (#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.
This commit is contained in:
andrealaura authored and Daniel Beck committed 2016-12-09 11:23:58 +01:00
1 parent 7292c91ea0
commit ba2900b27d
1 file changed
+2 -3
@@ -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 {
"<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\""));
}
}
}