[jboss-svn-commits] JBL Code SVN: r29460 - in labs/jbossesb/trunk: product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Sep 25 04:30:14 EDT 2009
Author: kevin.conner at jboss.com
Date: 2009-09-25 04:30:14 -0400 (Fri, 25 Sep 2009)
New Revision: 29460
Removed:
labs/jbossesb/trunk/testlib/xmlunit-1.2.jar
Modified:
labs/jbossesb/trunk/product/install/build.xml
labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/AbstractWsdlContractPublisherUnitTest.java
labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java
Log:
Check in missing XMLUnit changes: JBESB-2833
Modified: labs/jbossesb/trunk/product/install/build.xml
===================================================================
--- labs/jbossesb/trunk/product/install/build.xml 2009-09-24 19:59:34 UTC (rev 29459)
+++ labs/jbossesb/trunk/product/install/build.xml 2009-09-25 08:30:14 UTC (rev 29460)
@@ -223,7 +223,6 @@
<include name="stax-api-*.jar"/>
<include name="wstx-asl-*.jar"/>
<include name="xbean-*.jar"/>
- <include name="xmlunit*.jar"/>
<include name="xstream-*.jar"/>
</fileset>
<fileset dir="${org.jboss.esb.dist.lib}">
@@ -278,7 +277,6 @@
<exclude name="lib/stax-api-*.jar"/>
<exclude name="lib/wstx-asl-*.jar"/>
<exclude name="lib/xbean-*.jar"/>
- <exclude name="lib/xmlunit-*.jar"/>
<exclude name="lib/xstream-*.jar"/>
<exclude name="META-INF/jboss-service.xml"/>
<exclude name="actionArtifactMap.properties"/>
Modified: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/AbstractWsdlContractPublisherUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/AbstractWsdlContractPublisherUnitTest.java 2009-09-24 19:59:34 UTC (rev 29459)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/AbstractWsdlContractPublisherUnitTest.java 2009-09-25 08:30:14 UTC (rev 29460)
@@ -29,16 +29,14 @@
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.jboss.soa.esb.listeners.config.Action;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.internal.soa.esb.publish.ContractInfo;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.custommonkey.xmlunit.XMLUnit;
-import org.custommonkey.xmlunit.XMLAssert;
+import org.jboss.internal.soa.esb.util.XMLHelper;
import org.xml.sax.SAXException;
/**
@@ -46,7 +44,7 @@
*/
public class AbstractWsdlContractPublisherUnitTest extends TestCase {
- public void test_transform_01() throws ConfigurationException, IOException, SAXException {
+ public void test_transform_01() throws Exception {
Action actionConfig = new Action(null, null, null, new Properties());
actionConfig.getProperties().setProperty("rewrite-endpoint-url", "true");
@@ -54,7 +52,7 @@
execTransformTest(actionConfig, "wsdl-transform.expected-01.xml"); // Both transforms
}
- public void test_transform_02() throws ConfigurationException, IOException, SAXException {
+ public void test_transform_02() throws Exception {
Action actionConfig = new Action(null, null, null, new Properties());
actionConfig.getProperties().setProperty("rewrite-endpoint-url", "false");
@@ -62,27 +60,26 @@
execTransformTest(actionConfig, "wsdl-transform.expected-02.xml"); // Just the user defined transform
}
- public void test_transform_03() throws ConfigurationException, IOException, SAXException {
+ public void test_transform_03() throws Exception {
Action actionConfig = new Action(null, null, null, new Properties());
actionConfig.getProperties().setProperty("rewrite-endpoint-url", "false");
execTransformTest(actionConfig, "/test-in.wsdl"); // Neither transforms - should be unchanged from the in-wsdl
}
- public void test_transform_04() throws ConfigurationException, IOException, SAXException {
+ public void test_transform_04() throws Exception {
Action actionConfig = new Action(null, null, null, new Properties());
actionConfig.getProperties().setProperty("rewrite-endpoint-url", "true");
execTransformTest(actionConfig, "wsdl-transform.expected-04.xml"); // Just the url rewriting transform
}
- private void execTransformTest(Action actionConfig, String expected) throws ConfigurationException, SAXException, IOException {
+ private void execTransformTest(Action actionConfig, String expected) throws ConfigurationException, SAXException, IOException, ParserConfigurationException {
TestWsdlContractPublisher publisher = new TestWsdlContractPublisher();
publisher.setActionConfig(actionConfig);
ContractInfo contractInfo = publisher.getContractInfo(new EPR(URI.create("http://x.y.x:8989/")));
- XMLUnit.setIgnoreWhitespace( true );
- XMLAssert.assertXMLEqual(new InputStreamReader(getClass().getResourceAsStream(expected)), new StringReader(contractInfo.getData()));
+ assertTrue("XML Comparison", XMLHelper.compareXMLContent(new InputStreamReader(getClass().getResourceAsStream(expected)), new StringReader(contractInfo.getData())));
}
private class TestWsdlContractPublisher extends AbstractWsdlContractPublisher {
Modified: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java 2009-09-24 19:59:34 UTC (rev 29459)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java 2009-09-25 08:30:14 UTC (rev 29460)
@@ -22,17 +22,10 @@
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.internal.soa.esb.util.XMLHelper;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.listeners.config.Action;
-import org.jboss.soa.esb.testutils.StringUtils;
-import org.xml.sax.SAXException;
-import org.custommonkey.xmlunit.XMLUnit;
-import org.custommonkey.xmlunit.XMLAssert;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.StringReader;
import java.net.URI;
import java.util.Properties;
@@ -42,7 +35,7 @@
public class JBossWSAdapterContractPublisherUnitTest extends TestCase {
private Logger log = Logger .getLogger( JBossWSAdapterContractPublisherUnitTest.class );
- public void test() throws ConfigurationException, IOException, SAXException {
+ public void test() throws Exception {
JBossWSWebserviceContractPublisher publisher = new JBossWSWebserviceContractPublisher();
String wsdlIn = new String(StreamUtils.readStream(getClass().getResourceAsStream("/test-in.wsdl")));
String wsdlOutExpected = new String(StreamUtils.readStream(getClass().getResourceAsStream("test-out-expected.wsdl")));
@@ -53,11 +46,10 @@
String wsdlOut = publisher.updateWsdl(wsdlIn, epr, "myServiceCat", "myServiceName", "socket");
log.debug(wsdlOut);
- XMLUnit.setIgnoreWhitespace( true );
- XMLAssert.assertXMLEqual(new StringReader(wsdlOutExpected), new StringReader(wsdlOut));
+ assertTrue("XML Comparison", XMLHelper.compareXMLContent(wsdlOutExpected, wsdlOut));
}
- public void test_http_rewrite() throws ConfigurationException, IOException, SAXException {
+ public void test_http_rewrite() throws Exception {
JBossWSWebserviceContractPublisher publisher = new JBossWSWebserviceContractPublisher();
String wsdlIn = new String(StreamUtils.readStream(getClass().getResourceAsStream("/test-in.wsdl")));
String wsdlOutExpected = new String(StreamUtils.readStream(getClass().getResourceAsStream("test-out-expected-http-rewrite.wsdl")));
@@ -69,11 +61,10 @@
String wsdlOut = publisher.updateWsdl(wsdlIn, epr, "myServiceCat", "myServiceName", "http");
log.debug(wsdlOut);
- XMLUnit.setIgnoreWhitespace( true );
- XMLAssert.assertXMLEqual(new StringReader(wsdlOutExpected), new StringReader(wsdlOut));
+ assertTrue("XML Comparison", XMLHelper.compareXMLContent(wsdlOutExpected, wsdlOut));
}
- public void test_http_norewrite() throws ConfigurationException, IOException, SAXException {
+ public void test_http_norewrite() throws Exception {
JBossWSWebserviceContractPublisher publisher = new JBossWSWebserviceContractPublisher();
String wsdlIn = new String(StreamUtils.readStream(getClass().getResourceAsStream("/test-in.wsdl")));
String wsdlOutExpected = new String(StreamUtils.readStream(getClass().getResourceAsStream("/test-in.wsdl"))); // expected same as input wsdl
@@ -84,8 +75,7 @@
publisher.initializeTransformer();
String wsdlOut = publisher.updateWsdl(wsdlIn, epr, "myServiceCat", "myServiceName", "http");
log.debug(wsdlOut);
- XMLUnit.setIgnoreWhitespace( true );
- XMLAssert.assertXMLEqual(new StringReader(wsdlOutExpected), new StringReader(wsdlOut));
+ assertTrue("XML Comparison", XMLHelper.compareXMLContent(wsdlOutExpected, wsdlOut));
}
private Action buildActionConfig(boolean rewriteUrls) {
Deleted: labs/jbossesb/trunk/testlib/xmlunit-1.2.jar
===================================================================
(Binary files differ)
More information about the jboss-svn-commits
mailing list