Browse Source

Fix failing test

pull/455/head
Rossen Stoyanchev 11 years ago
parent
commit
1a8629d408
  1. 2
      spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java
  2. 3
      spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverterTests.java

2
spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java

@ -229,7 +229,7 @@ public class Jaxb2CollectionHttpMessageConverter<T extends Collection> @@ -229,7 +229,7 @@ public class Jaxb2CollectionHttpMessageConverter<T extends Collection>
*/
protected XMLInputFactory createXmlInputFactory() {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
return inputFactory;
}

3
spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverterTests.java

@ -126,7 +126,7 @@ public class Jaxb2CollectionHttpMessageConverterTests { @@ -126,7 +126,7 @@ public class Jaxb2CollectionHttpMessageConverterTests {
@Test
@SuppressWarnings("unchecked")
public void readXmlRootElementWithExternalEntity() throws Exception {
public void readXmlRootElementExternalEntityDisabled() throws Exception {
Resource external = new ClassPathResource("external.txt", getClass());
String content = "<!DOCTYPE root [" +
@ -151,7 +151,6 @@ public class Jaxb2CollectionHttpMessageConverterTests { @@ -151,7 +151,6 @@ public class Jaxb2CollectionHttpMessageConverterTests {
" <list><rootElement><type s=\"1\"/><external>&ext;</external></rootElement></list>";
MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8"));
// Now read with
Jaxb2CollectionHttpMessageConverter<?> c = new Jaxb2CollectionHttpMessageConverter<Collection<Object>>() {
@Override
protected XMLInputFactory createXmlInputFactory() {

Loading…
Cancel
Save