cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r597780 - in /incubator/cxf/trunk/rt/javascript/src/test: java/org/apache/cxf/javascript/ java/org/apache/cxf/javascript/fortest/ resources/ resources/org/apache/cxf/javascript/
Date Sat, 24 Nov 2007 01:09:57 GMT
Author: bimargulies
Date: Fri Nov 23 17:09:55 2007
New Revision: 597780

URL: http://svn.apache.org/viewvc?rev=597780&view=rev
Log:
Pass several more cases of full web service interaction. @Ignore case that seems to indicate
possible JAXB+JAXWS trouble.

Modified:
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean2.java
    incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties
    incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/DocLitWrappedTests.js

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java?rev=597780&r1=597779&r2=597780&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java
Fri Nov 23 17:09:55 2007
@@ -42,7 +42,6 @@
 import org.mozilla.javascript.Scriptable;
 import org.springframework.context.support.GenericApplicationContext;
 
-@org.junit.Ignore
 public class DocLitWrappedClientTest extends AbstractCXFSpringTest {
 
     private static final Logger LOG = LogUtils.getL7dLogger(DocLitWrappedClientTest.class);
@@ -146,6 +145,7 @@
         return null;
     }
     
+    @org.junit.Ignore
     @Test
     public void callFunctionWithBeans() {
         LOG.info("about to call test4/beanFunction");

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java?rev=597780&r1=597779&r2=597780&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
Fri Nov 23 17:09:55 2007
@@ -369,7 +369,18 @@
         StringBuilder builder = new StringBuilder();
         for (Object propid : scriptable.getIds()) {
             String propIdString = Context.toString(propid);
-            String propValue = Context.toString(scriptable.get(propIdString, scriptable));
+            int propIntKey = -1;
+            try {
+                propIntKey = Integer.parseInt(propIdString);
+            } catch (NumberFormatException nfe) {
+                // dummy.
+            }
+            String propValue;
+            if (propIntKey >= 0) {
+                propValue = Context.toString(scriptable.get(propIntKey, scriptable));
+            } else {
+                propValue = Context.toString(scriptable.get(propIdString, scriptable));
+            }
             builder.append(propIdString);
             builder.append(": ");
             builder.append(propValue);

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java?rev=597780&r1=597779&r2=597780&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
Fri Nov 23 17:09:55 2007
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.javascript.fortest;
 
+import java.util.Arrays;
+
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
@@ -64,21 +66,105 @@
             return false;
         }
         TestBean1 other = (TestBean1) obj;
-        return stringItem.equals(other.stringItem) 
-            && intItem == other.intItem
+        boolean equalSoFar = 
+            intItem == other.intItem
             && longItem == other.longItem
-            && base64Item == other.base64Item
             && optionalIntItem == other.optionalIntItem
-            && optionalIntArrayItem == other.optionalIntArrayItem
             && doubleItem == other.doubleItem
-            && beanTwoItem.equals(other.beanTwoItem)
-            && beanTwoNotRequiredItem.equals(other.beanTwoNotRequiredItem);
+            && beanTwoItem.equals(other.beanTwoItem);
+        if (!equalSoFar) {
+            return false;
+        }
+        
+        if (null == base64Item) {
+            if (null != other.base64Item) {
+                return false;
+            }
+        } else {
+            if (!base64Item.equals(other.base64Item)) {
+                return false;
+            }
+        }
+
+        if (null == stringItem) {
+            if (null != other.stringItem) {
+                return false;
+            }
+        } else {
+            if (!stringItem.equals(other.stringItem)) {
+                return false;
+            }
+        }
+
+        if (null == optionalIntArrayItem) {
+            if (null != other.optionalIntArrayItem) {
+                return false;
+            }
+        } else {
+            if (!Arrays.equals(optionalIntArrayItem, other.optionalIntArrayItem)) {
+                return false;
+            }
+        }
+
+        // decisions are simpler for the last one.
+        if (null == beanTwoNotRequiredItem) {
+            return other.beanTwoNotRequiredItem == null;
+        } else {
+            return beanTwoNotRequiredItem.equals(other.beanTwoNotRequiredItem);
+        }
     }
 
     @Override
     public int hashCode() {
         // intentionally stupid. We don't use this object in collections.
         return super.hashCode();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("TestBean1");
+        builder.append(" stringItem ");
+        builder.append(stringItem == null ? "Null" : stringItem);
+        builder.append(" intItem ");
+        builder.append(intItem);
+        builder.append(" longItem ");
+        builder.append(longItem);
+        builder.append(" base64Item ");
+        if (base64Item == null) {
+            builder.append("Null");
+        } else {
+            for (byte b : base64Item) {
+                builder.append(" ");
+                builder.append(Integer.toHexString(b));
+            }
+        }
+        
+        builder.append(" optionalIntItem ");
+        builder.append(optionalIntItem);
+        builder.append(" optionalIntArrayItem ");
+        if (optionalIntArrayItem == null) {
+            builder.append("Null");
+        } else {
+            for (int i : optionalIntArrayItem) {
+                builder.append(" ");
+                builder.append(i);
+            }
+        }
+        builder.append(" beanTwoItem ");
+        if (beanTwoItem == null) {
+            builder.append("Null");
+        } else {
+            builder.append(beanTwoItem.toString()); 
+        }
+        builder.append(" beanTwoNotRequiredItem ");
+        if (beanTwoNotRequiredItem == null) {
+            builder.append("Null");
+        } else {
+            builder.append(beanTwoNotRequiredItem.toString()); 
+        }
+        
+        return builder.toString();
     }
     
 }

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean2.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean2.java?rev=597780&r1=597779&r2=597780&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean2.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean2.java
Fri Nov 23 17:09:55 2007
@@ -26,6 +26,7 @@
  */
 @XmlType(namespace = "uri:org.apache.cxf.javascript.testns3")
 public class TestBean2 {
+ 
     public TestBean2() {
         stringItem = "testBean2.stringItem";
     }
@@ -33,6 +34,12 @@
     public TestBean2(String id) {
         stringItem = id;
     }
+    
+    @Override
+    public String toString() {
+        return "TestBean2 " + stringItem;
+    }
+
     //CHECKSTYLE:OFF
     public String stringItem;
     //CHECKSTYLE:ON

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties?rev=597780&r1=597779&r2=597780&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties Fri Nov 23 17:09:55
2007
@@ -23,9 +23,9 @@
 .level= INFO
 java.util.logging.ConsoleHandler.level = FINEST
 java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-org.apache.cxf.javascript.service.ServiceJavascriptBuilder.level=WARNING
-org.apache.cxf.javascript.types.SchemaJavascriptBuilder.level=WARNING
-org.apache.cxf.javascript.JavascriptTestUtilities.level=FINE
-org.apache.cxf.javascript.JsXMLHttpRequest.level = WARNING
-org.apache.cxf.javascript.service.DocLitWrappedTest.level=FINE
+#org.apache.cxf.javascript.service.ServiceJavascriptBuilder.level=WARNING
+#org.apache.cxf.javascript.types.SchemaJavascriptBuilder.level=WARNING
+#org.apache.cxf.javascript.JavascriptTestUtilities.level=FINE
+#org.apache.cxf.javascript.JsXMLHttpRequest.level = WARNING
+#org.apache.cxf.javascript.service.DocLitWrappedTest.level=FINE
 

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/DocLitWrappedTests.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/DocLitWrappedTests.js?rev=597780&r1=597779&r2=597780&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/DocLitWrappedTests.js
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/DocLitWrappedTests.js
Fri Nov 23 17:09:55 2007
@@ -106,12 +106,13 @@
 	
 	var intf;
     intf = new org_apache_cxf_javascript_fortest_SimpleDocLitWrapped();
-	else
-	  intf = new org_apache_cxf_javascript_fortest_SimpleDocLitWrapped();
 	  
 	intf.url = url;
 	// param order from the interface
-	intf.beanFunction(test1SuccessCallback, test1ErrorCallback, beanArg, beansArg); 
+	if(wrap)
+		intf.beanFunctionWithWrapper(test1SuccessCallback, test1ErrorCallback, beanArg, beansArg);

+    else	
+	  intf.beanFunction(test1SuccessCallback, test1ErrorCallback, beanArg, beansArg); 
     // Return the notifier as a convenience to the Java code.
 	return globalNotifier;
 }



Mime
View raw message