tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scottk...@apache.org
Subject svn commit: r1153290 - in /tuscany/sca-java-2.x/trunk/testing/itest/data-copy: client/src/main/java/itest/client/impl/ client/src/main/java/itest/privatecopy/intf/ driver/src/test/java/itest/ service/src/main/java/itest/privatecopy/intf/ service/src/ma...
Date Tue, 02 Aug 2011 22:08:18 GMT
Author: scottkurz
Date: Tue Aug  2 22:08:17 2011
New Revision: 1153290

URL: http://svn.apache.org/viewvc?rev=1153290&view=rev
Log:
TUSCANY-3894.  Enable some @Ignore(d) tests along with r1153285.

Modified:
    tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/client/impl/ClientImpl.java
    tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/privatecopy/intf/ServiceIntf.java
    tuscany/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java
    tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java
    tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java

Modified: tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/client/impl/ClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/client/impl/ClientImpl.java?rev=1153290&r1=1153289&r2=1153290&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/client/impl/ClientImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/client/impl/ClientImpl.java
Tue Aug  2 22:08:17 2011
@@ -92,7 +92,7 @@ public class ClientImpl implements Clien
         name.setFirstName("DOM");
         name.setLastName("MOD");
         String retVal = service.greetDOM(name);
-        //assertEquals("good", retVal);
+        assertEquals("SUCCESS", retVal);
     }
     
     @Override

Modified: tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/privatecopy/intf/ServiceIntf.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/privatecopy/intf/ServiceIntf.java?rev=1153290&r1=1153289&r2=1153290&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/privatecopy/intf/ServiceIntf.java
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/data-copy/client/src/main/java/itest/privatecopy/intf/ServiceIntf.java
Tue Aug  2 22:08:17 2011
@@ -33,15 +33,7 @@ public interface ServiceIntf {    
     Name greet(Name name);
     boolean areNamesTheSameObjects(Name name1, Name name2);
     
-    // Use JAXB on input parm on the client side
     String greetJSON(Name name);
-
-//    @RequestWrapper(localName = "greetDOM", targetNamespace = "http://intf/internal/itest/",
className = "org.w3c.dom.Node")
-//    @ResponseWrapper(localName = "greetDOMResponse", targetNamespace = "http://intf/internal/itest/",
className = "org.w3c.dom.Node")
-//    @DataBinding("org.w3c.dom.Node")  
-
-    // Use JAXB on input parm on the client side
-    String greetDOM(Name name);    
-    
+    String greetDOM(Name name);        
     Node returnDOM(Node name);
 }

Modified: tuscany/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java?rev=1153290&r1=1153289&r2=1153290&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/data-copy/driver/src/test/java/itest/CrossContribTestCase.java
Tue Aug  2 22:08:17 2011
@@ -100,16 +100,14 @@ public class CrossContribTestCase {
         client.callObjectGraphCheck(2);
     }
 
-    @Test
-    @Ignore
+    @Test  // Fails for 3894, (rename test)
     public void testDOMSCA() throws Exception {
         ClientIntf client = node.getService(ClientIntf.class, "ClientSCA");
         assertNotNull(client);
         client.callDOM();
     }
 
-    @Test
-    @Ignore
+    @Test    // Output DB treated as DOM, rather than String
     public void testDOMWS() throws Exception {
         ClientIntf client = node.getService(ClientIntf.class, "ClientWS");
         assertNotNull(client);

Modified: tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java?rev=1153290&r1=1153289&r2=1153290&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/privatecopy/intf/ServiceIntf.java
Tue Aug  2 22:08:17 2011
@@ -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);
 

Modified: tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java?rev=1153290&r1=1153289&r2=1153290&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/data-copy/service/src/main/java/itest/service/impl/ServiceImpl.java
Tue Aug  2 22:08:17 2011
@@ -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 Serv
 
 
     @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 Serv
 }
 
 
+



Mime
View raw message