Author: richard.opalka(a)jboss.com
Date: 2010-02-19 05:24:28 -0500 (Fri, 19 Feb 2010)
New Revision: 11628
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java
Log:
refactoring XML helper methods in NativeEndpointReferenceTestCase
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java 2010-02-19
10:18:49 UTC (rev 11627)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/NativeEndpointReferenceTestCase.java 2010-02-19
10:24:28 UTC (rev 11628)
@@ -71,26 +71,18 @@
public void testNativeEndpointReferenceFromSource() throws Exception
{
- System.out.println(getXml(DOMUtils.parse(XML)));
+ System.out.println(DOMUtils.node2String(DOMUtils.parse(XML)));
final Source xml = new DOMSource(DOMUtils.parse(XML));
NativeEndpointReference epr = new NativeEndpointReference(xml);
DOMResult dr = new DOMResult();
epr.writeTo(dr);
Node endpointReferenceElement = dr.getNode();
- System.out.println(getXml(endpointReferenceElement));
+ System.out.println(DOMUtils.node2String(endpointReferenceElement));
assertMetaData(endpointReferenceElement);
assertRefParam(endpointReferenceElement, PARAM1_QNAME, "Hello");
assertRefParam(endpointReferenceElement, PARAM2_QNAME, "World");
}
- private static String getXml(final Node node) throws Exception
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintWriter pw = new PrintWriter(baos);
- new DOMWriter(pw, Constants.DEFAULT_XML_CHARSET).setPrettyprint(true).print(node);
- return baos.toString("utf-8");
- }
-
private static void assertRefParam(final Node root, final QName nodeName, final String
refParamValue)
{
Element e = (Element)DOMUtils.getFirstChildElement(root, nodeName, true);