Author: richard.opalka(a)jboss.com
Date: 2010-03-26 02:37:26 -0400 (Fri, 26 Mar 2010)
New Revision: 11863
Modified:
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderPlugin.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java
Log:
[JBPAPP-3999] implementing support for protocol in wsprovide
Modified:
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderPlugin.java
===================================================================
---
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderPlugin.java 2010-03-26
06:37:07 UTC (rev 11862)
+++
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderPlugin.java 2010-03-26
06:37:26 UTC (rev 11863)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.smoke.tools;
+import org.jboss.ws.Constants;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.spi.tools.WSContractProvider;
import org.jboss.wsf.test.JBossWSTest;
@@ -86,6 +87,20 @@
}
/**
+ * Enables/Disables WSDL generation.
+ *
+ */
+ public void testGenerateWsdlWithExtension() throws Exception
+ {
+ provider.setGenerateWsdl(true);
+ provider.setExtension(true);
+ File outputDir = new File(outputDirectory.getAbsolutePath() + "-soap12");
+ provide(outputDir);
+
+ verifyWSDL(outputDir, true);
+ }
+
+ /**
* Enables/Disables Java source generation.
*
*/
@@ -190,13 +205,18 @@
provider.setResourceDirectory(directory);
provide();
- verifyWSDL(directory);
+ verifyWSDL(outputDirectory);
}
-
+
private void verifyWSDL(File directory) throws Exception
{
+ this.verifyWSDL(directory, false);
+ }
+
+ private void verifyWSDL(File directory, boolean soap12) throws Exception
+ {
File wsdl = new File(
- outputDirectory.getAbsolutePath()+
+ directory.getAbsolutePath()+
FS + "CalculatorBeanService.wsdl"
);
@@ -204,6 +224,16 @@
Element root = DOMUtils.parse( new FileInputStream(wsdl));
Element serviceElement = DOMUtils.getFirstChildElement(root, "service");
assertEquals(serviceElement.getAttribute("name"),
"CalculatorBeanService");
+ Element bindingElement = DOMUtils.getFirstChildElement(root, "binding");
+ Element soapBindingElement =
DOMUtils.getFirstChildElement(bindingElement,"binding");
+ if (soap12)
+ {
+
assertEquals("http://schemas.xmlsoap.org/wsdl/soap12/",
soapBindingElement.getNamespaceURI());
+ }
+ else
+ {
+
assertEquals("http://schemas.xmlsoap.org/wsdl/soap/",
soapBindingElement.getNamespaceURI());
+ }
}
/**
@@ -294,7 +324,11 @@
private void provide() throws Exception
{
- //provider.setGenerateSource(true);
+ this.provide(outputDirectory);
+ }
+
+ private void provide(File outputDirectory)
+ {
provider.setOutputDirectory(outputDirectory);
//JBWS-2479: using different beans because the whole smoke tools test is supposed
to be run for every stack
//and we can't afford excluding it for Metro just because of JBWS-2479
Modified:
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java
===================================================================
---
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java 2010-03-26
06:37:07 UTC (rev 11862)
+++
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java 2010-03-26
06:37:26 UTC (rev 11863)
@@ -50,6 +50,11 @@
{
dispatch("testGenerateWsdl");
}
+
+ public void testGenerateWsdlWithExtension() throws Exception
+ {
+ dispatch("testGenerateWsdlWithExtension");
+ }
public void testGenerateSource() throws Exception
{