diff options
author | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-02 22:08:17 +0000 |
---|---|---|
committer | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-02 22:08:17 +0000 |
commit | 2dbc247eb83dadcfddfbbb95a1440c8b90d3bd82 (patch) | |
tree | b4b5cc9458544ae69b98e8aa1b394fdd077f50b7 /sca-java-2.x/trunk/testing/itest/data-copy/service | |
parent | 024cdd6f7359eaa15f960b345bc24ed0a6de4fdf (diff) |
TUSCANY-3894. Enable some @Ignore(d) tests along with r1153285.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1153290 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest/data-copy/service')
2 files changed, 34 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java b/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java index 1b8145520f..dc25eb07b1 100644 --- a/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java +++ b/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java @@ -38,12 +38,13 @@ public interface ServiceIntf { Name greet(Name name);
//@RequestWrapper(localName = "greetJSON", targetNamespace = "http://intf.privatecopy.itest/", className = "org.codehaus.jettison.json.JSONObject")
- //@ResponseWrapper(localName = "greetJSONResponse", targetNamespace = "http://intf.privatecopy.itest/", className = "org.codehaus.jettison.json.JSONObject")
String greetJSON(JSONObject name);
- //@RequestWrapper(localName = "greetDOM", targetNamespace = "http://intf.privatecopy.itest/", className = "org.w3c.dom.Node")
- //@ResponseWrapper(localName = "greetDOMResponse", targetNamespace = "http://intf.privatecopy.itest/", className = "org.w3c.dom.Node")
- String greetDOM(Node name);
+ @RequestWrapper(localName = "greetDOM", targetNamespace = "http://intf.privatecopy.itest/", className = "org.w3c.dom.Node")
+ // Won't work because of 2931 - lack of separation of req. vs. resp
+ //String greetDOM(Node name);
+ @ResponseWrapper(localName = "greetDOMResponse", targetNamespace = "http://intf.privatecopy.itest/", className = "org.w3c.dom.Node")
+ Node greetDOM(Node name);
Node returnDOM(Node name);
diff --git a/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java b/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java index 435c6c93d9..b8fe5eb018 100644 --- a/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java +++ b/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java @@ -19,11 +19,18 @@ package itest.service.impl;
-import java.util.List;
+import java.io.StringReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+
import commonj.sdo.DataObject;
@@ -63,10 +70,27 @@ public class ServiceImpl implements ServiceIntf { @Override
- public String greetDOM(Node name) {
- return "fail";
+ //public String greetDOM(Node name) {
+ public Node greetDOM(Node name) {
+ Node retVal = null;
+
+ try {
+ assertEquals("DOMMOD", name.getTextContent());
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+
+ String retString = "<?xml version=\"1.0\" ?>" +
+ "<return>SUCCESS</return>";
+ InputSource is = new InputSource( new StringReader(retString) );
+ Document doc = builder.parse(is);
+ retVal = doc.getDocumentElement();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ return retVal;
}
-
+
@Override
public Node returnDOM(Node name) {
return name;
@@ -75,3 +99,4 @@ public class ServiceImpl implements ServiceIntf { }
+
|