Author: heiko.braun(a)jboss.com
Date: 2008-02-25 09:48:51 -0500 (Mon, 25 Feb 2008)
New Revision: 5799
Added:
stack/native/trunk/src/test/resources/jaxws/jbws771/
stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
Log:
Fix JBWS-771: Added binding customization examples
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-02-25
14:25:31 UTC (rev 5798)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-02-25
14:48:51 UTC (rev 5799)
@@ -25,6 +25,8 @@
import java.net.URL;
import java.util.List;
+import java.io.IOException;
+import java.io.File;
import javax.wsdl.Binding;
import javax.wsdl.BindingOperation;
@@ -42,6 +44,7 @@
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
+import org.jboss.wsf.spi.tools.cmd.WSConsume;
/**
* [JBWS-771] Use part names that are friendly to .NET
@@ -55,6 +58,11 @@
private static URL wsdlURL;
private static IWebsvc port;
+ private String JBOSS_HOME;
+ private String JDK_HOME;
+ private String TEST_EXEC_DIR;
+ private String OS;
+
public static Test suite()
{
return new JBossWSTestSetup(JBWS771TestCase.class, "jaxws-jbws771.jar");
@@ -71,6 +79,11 @@
Service service = Service.create(wsdlURL, serviceName);
port = service.getPort(IWebsvc.class);
}
+
+ JBOSS_HOME = System.getProperty("jboss.home");
+ TEST_EXEC_DIR = System.getProperty("test.execution.dir");
+ JDK_HOME = System.getProperty("jdk.home");
+ OS = System.getProperty("os.name").toLowerCase();
}
public void testSubmit() throws Exception
@@ -136,9 +149,15 @@
}
public void testWSConsume() throws Exception
- {
- System.out.println("FIXME [JBWS-1724] wsconsume cannot use part names that are
friendly to .NET");
- //WSConsume.main(new String[]{"--output=tests/wsconsume",
wsdlURL.toExternalForm()});
+ {
+ // use absolute path for the output to be re-usable
+ String absOutput = new File("wsconsume/java").getAbsolutePath();
+ String command = JBOSS_HOME + "/bin/wsconsume.sh -k -o "+absOutput+"
--binding=resources/jaxws/jbws771/binding.xml "+ wsdlURL.toExternalForm();
+ Process p = executeCommand(command);
+
+ // check status code
+ assertStatusCode(p, "wsconsume");
+
}
private Definition getWSDLDefinition(String wsdlLocation) throws Exception
@@ -149,4 +168,26 @@
Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
return definition;
}
+
+ private Process executeCommand(String command)
+ throws IOException
+ {
+ // be verbose
+ System.out.println("cmd: " + command);
+ System.out.println("test execution dir: " + TEST_EXEC_DIR);
+
+ Process p = Runtime.getRuntime().exec(
+ command,
+ new String[] {"JBOSS_HOME="+ JBOSS_HOME, "JAVA_HOME="+
JDK_HOME}
+ );
+ return p;
+ }
+
+ private void assertStatusCode(Process p, String s)
+ throws InterruptedException
+ {
+ // check status code
+ int status = p.waitFor();
+ assertTrue(s +" did exit with status " + status, status==0);
+ }
}
Added: stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml
(rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml 2008-02-25 14:48:51
UTC (rev 5799)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<jaxws:bindings
wsdlLocation="http://localhost:8080/jaxws-jbws771/IWebsvcImpl?wsdl"
+
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <jaxws:bindings
+
node="wsdl:definitions/wsdl:portType[@name='IWebsvc']/wsdl:operation[@name='cancel']">
+ <jaxws:parameter
+
part="wsdl:definitions/wsdl:message[@name='IWebsvc_cancel']/wsdl:part[@name='parameters']"
+ element="tns:cancel" name="cancelMessage"/>
+ </jaxws:bindings>
+</jaxws:bindings>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/jbws771/binding.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF