Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions quickfixj-base/src/test/java/quickfix/DataDictionaryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.ByteArrayInputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Locale;

import javax.xml.parsers.DocumentBuilderFactory;

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

@Test
public void shouldFailToLoadDictionaryWhenExternalDTDisDisabled() {
Locale originalLocale = Locale.getDefault();
Locale.setDefault(Locale.US);
try {
new DataDictionary("FIX_External_DTD.xml");
fail("should fail to load dictionary with external DTD");
} catch (ConfigError e) {
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());
try {
new DataDictionary("FIX_External_DTD.xml");
fail("should fail to load dictionary with external DTD");
} catch (ConfigError e) {
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());
}
} finally {
Locale.setDefault(originalLocale);
}
}

Expand Down