You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2015/06/15 22:27:18 UTC
svn commit: r1685662 -
/xerces/java/trunk/tests/jaxp/JAXPSecureProcessingTest.java
Author: mrglavas
Date: Mon Jun 15 20:27:18 2015
New Revision: 1685662
URL: http://svn.apache.org/r1685662
Log:
JIRA Issue #1659: https://issues.apache.org/jira/browse/XERCESJ-1659. Need to ensure that the test uses an English locale so that the number formatting matches in the exception messages. Fix thanks to Matthias Krueger.
Modified:
xerces/java/trunk/tests/jaxp/JAXPSecureProcessingTest.java
Modified: xerces/java/trunk/tests/jaxp/JAXPSecureProcessingTest.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/tests/jaxp/JAXPSecureProcessingTest.java?rev=1685662&r1=1685661&r2=1685662&view=diff
==============================================================================
--- xerces/java/trunk/tests/jaxp/JAXPSecureProcessingTest.java (original)
+++ xerces/java/trunk/tests/jaxp/JAXPSecureProcessingTest.java Mon Jun 15 20:27:18 2015
@@ -18,6 +18,7 @@
package jaxp;
import java.io.IOException;
+import java.util.Locale;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
@@ -55,6 +56,8 @@ public class JAXPSecureProcessingTest ex
private static final String MAX_PARAMETER_ENTITY_SIZE_LIMIT_PROPERTY_NAME = "jdk.xml.maxParameterEntitySizeLimit";
private static final String RESOLVE_EXTERNAL_ENTITIES_PROPERTY_NAME = "jdk.xml.resolveExternalEntities";
+ private static final Locale DEFAULT_LOCALE = Locale.getDefault();
+
protected void setUp() throws Exception {
super.setUp();
System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl");
@@ -69,10 +72,13 @@ public class JAXPSecureProcessingTest ex
System.setProperty(MAX_GENERAL_ENTITY_SIZE_LIMIT_PROPERTY_NAME, "0");
System.setProperty(MAX_PARAMETER_ENTITY_SIZE_LIMIT_PROPERTY_NAME, "0");
System.setProperty(RESOLVE_EXTERNAL_ENTITIES_PROPERTY_NAME, "true");
+ // English Locale required for the exception message assertions to match the correct number format
+ Locale.setDefault(Locale.ENGLISH);
}
protected void tearDown() throws Exception {
super.tearDown();
+ Locale.setDefault(DEFAULT_LOCALE);
}
public void testSAXEntityExpansionLimitSG() throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org