Author: amilas Date: Sat May 1 06:00:35 2010 New Revision: 939927 URL: http://svn.apache.org/viewvc?rev=939927&view=rev Log: applied the patch for AXIS2-3461
Modified: axis/axis2/java/core/trunk/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java Modified: axis/axis2/java/core/trunk/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java?rev=939927&r1=939926&r2=939927&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java (original) +++ axis/axis2/java/core/trunk/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java Sat May 1 06:00:35 2010 @@ -39,6 +39,8 @@ import org.apache.axis2.description.Axis import org.apache.axis2.description.Parameter; import org.apache.axis2.engine.AxisConfiguration; import org.apache.axis2.handlers.util.TestUtil; +import org.custommonkey.xmlunit.XMLTestCase; +import org.custommonkey.xmlunit.XMLUnit; import javax.xml.namespace.QName; @@ -47,7 +49,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -public class AddressingOutHandlerTest extends TestCase implements AddressingConstants { +public class AddressingOutHandlerTest extends XMLTestCase implements AddressingConstants { private AddressingOutHandler outHandler; private MessageContext msgCtxt; private TestUtil testUtil; @@ -106,11 +108,8 @@ public class AddressingOutHandlerTest ex StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder("eprTest.xml"); - XMLComparator xmlComparator = new XMLComparator(); - - assertTrue( - xmlComparator.compare(omBuilder.getDocumentElement(), - defaultEnvelope)); + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(omBuilder.getDocumentElement().toString(), defaultEnvelope.toString()); } @@ -149,11 +148,10 @@ public class AddressingOutHandlerTest ex OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope()); outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue( - xmlComparator.compare(msgCtxt.getEnvelope(), - testUtil.getOMBuilder("OutHandlerTest.xml") - .getDocumentElement())); + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), + testUtil.getOMBuilder("OutHandlerTest.xml") + .getDocumentElement().toString()); } public void testMustUnderstandSupport() throws Exception { @@ -194,11 +192,10 @@ public class AddressingOutHandlerTest ex OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope()); outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue( - xmlComparator.compare(msgCtxt.getEnvelope(), - testUtil.getOMBuilder("mustUnderstandTest.xml") - .getDocumentElement())); + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), + testUtil.getOMBuilder("mustUnderstandTest.xml") + .getDocumentElement().toString()); } public void testSOAPRoleSupport() throws Exception { @@ -239,11 +236,9 @@ public class AddressingOutHandlerTest ex OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope()); outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue( - xmlComparator.compare(msgCtxt.getEnvelope(), - testUtil.getOMBuilder("soap11roleTest.xml") - .getDocumentElement())); + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), + testUtil.getOMBuilder("soap11roleTest.xml").getDocumentElement().toString()); } public void testSOAP12RoleSupport() throws Exception { @@ -284,11 +279,10 @@ public class AddressingOutHandlerTest ex OMAbstractFactory.getSOAP12Factory().getDefaultEnvelope()); outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue( - xmlComparator.compare(msgCtxt.getEnvelope(), - testUtil.getOMBuilder("soap12roleTest.xml") - .getDocumentElement())); + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), + testUtil.getOMBuilder("soap12roleTest.xml") + .getDocumentElement().toString()); } public void testDuplicateHeaders() throws Exception { @@ -425,10 +419,10 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("addressingDisabledTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } public void testAxis2DisableAddressingForOutMessagesFalse() throws Exception { @@ -451,10 +445,10 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("addressingEnabledTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } public void testAxis2IncludeOptionalHeadersTrue() throws Exception { @@ -477,10 +471,10 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("withOptionalHeadersTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } public void testAxis2IncludeOptionalHeadersFalse() throws Exception { @@ -503,10 +497,10 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("addressingEnabledTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } public void testModuleDisableAddressingForOutMessagesTrue() throws Exception { @@ -534,10 +528,10 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("addressingDisabledTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } public void testModuleDisableAddressingForOutMessagesFalse() throws Exception { @@ -567,10 +561,10 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("addressingEnabledTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } public void testModuleIncludeOptionalHeadersTrue() throws Exception { @@ -600,10 +594,10 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("withOptionalHeadersTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } public void testModuleIncludeOptionalHeadersFalse() throws Exception { @@ -633,9 +627,9 @@ public class AddressingOutHandlerTest ex outHandler.invoke(msgCtxt); - XMLComparator xmlComparator = new XMLComparator(); - assertTrue(xmlComparator.compare(msgCtxt.getEnvelope(), testUtil + XMLUnit.setIgnoreWhitespace(true); + assertXMLEqual(msgCtxt.getEnvelope().toString(), testUtil .getOMBuilder("addressingEnabledTest.xml") - .getDocumentElement())); + .getDocumentElement().toString()); } }