提交 ba2900b2 编写于 作者: A andrealaura 提交者: Daniel Beck

[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.
上级 7292c91e
......@@ -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\""));
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册