Skip to content

Commit 08ecd5f

Browse files
authored
Merge pull request #1091 from wilson-zh/fix-443
Make `DataDictionaryTest` external DTD error assertion locale-independent
2 parents 7bbf17d + 55a38fa commit 08ecd5f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

quickfixj-base/src/test/java/quickfix/DataDictionaryTest.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.io.ByteArrayInputStream;
2929
import java.net.URL;
3030
import java.net.URLClassLoader;
31+
import java.util.Locale;
3132

3233
import javax.xml.parsers.DocumentBuilderFactory;
3334

@@ -677,11 +678,17 @@ public void shouldLoadDictionaryWhenExternalDTDisEnabled() throws ConfigError {
677678

678679
@Test
679680
public void shouldFailToLoadDictionaryWhenExternalDTDisDisabled() {
681+
Locale originalLocale = Locale.getDefault();
682+
Locale.setDefault(Locale.US);
680683
try {
681-
new DataDictionary("FIX_External_DTD.xml");
682-
fail("should fail to load dictionary with external DTD");
683-
} catch (ConfigError e) {
684-
assertEquals("External DTD: Failed to read external DTD 'mathml.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property.", e.getCause().getCause().getMessage());
684+
try {
685+
new DataDictionary("FIX_External_DTD.xml");
686+
fail("should fail to load dictionary with external DTD");
687+
} catch (ConfigError e) {
688+
assertEquals("External DTD: Failed to read external DTD 'mathml.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property.", e.getCause().getCause().getMessage());
689+
}
690+
} finally {
691+
Locale.setDefault(originalLocale);
685692
}
686693
}
687694

0 commit comments

Comments
 (0)