From b909f6e7777875fb5099a2509ebdc8e8ecbecce0 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Tue, 26 Dec 2006 12:15:00 +0000 Subject: [PATCH] fixed #SWS-70: AbstractMarshallerTestCase.testMarshalDOMResult() builds a DOM object that does not retain namespace --- .../org/springframework/oxm/AbstractMarshallerTestCase.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTestCase.java b/oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTestCase.java index e24bd2dc..09e64e55 100644 --- a/oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTestCase.java +++ b/oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTestCase.java @@ -31,6 +31,7 @@ import org.springframework.xml.transform.StaxResult; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text; +import org.w3c.dom.Attr; public abstract class AbstractMarshallerTestCase extends XMLTestCase { @@ -61,6 +62,9 @@ public abstract class AbstractMarshallerTestCase extends XMLTestCase { marshaller.marshal(flights, domResult); Document expected = builder.newDocument(); Element flightsElement = expected.createElementNS("http://samples.springframework.org/flight", "tns:flights"); + Attr namespace = expected.createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:tns"); + namespace.setNodeValue("http://samples.springframework.org/flight"); + flightsElement.setAttributeNode(namespace); expected.appendChild(flightsElement); Element flightElement = expected.createElementNS("http://samples.springframework.org/flight", "tns:flight"); flightsElement.appendChild(flightElement);