cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r597530 - in /incubator/cxf/trunk/rt/javascript/src: main/java/org/apache/cxf/javascript/service/ main/resources/org/apache/cxf/javascript/ test/java/org/apache/cxf/javascript/ test/resources/ test/resources/org/apache/cxf/javascript/
Date Fri, 23 Nov 2007 03:21:44 GMT
Author: bimargulies
Date: Thu Nov 22 19:21:43 2007
New Revision: 597530

URL: http://svn.apache.org/viewvc?rev=597530&view=rev
Log:
Very close to a successful full turn from javascript. Submit in case cat steps on mouse and
deletes code.

Modified:
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.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/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java?rev=597530&r1=597529&r2=597530&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
Thu Nov 22 19:21:43 2007
@@ -235,7 +235,7 @@
                              + "_serializeInput"
                              + "(args);");
         }
-        utils.appendLine("this.client = new CxfApacheOrgClient(jsutils);");
+        utils.appendLine("this.client = new CxfApacheOrgClient(this.jsutils);");
         // we need to pass the caller's callback functions to our callback
         // functions.
         utils.appendLine("this._onsuccess = successCallback;");
@@ -359,7 +359,8 @@
         
         String serializerFunctionGlobalName = getFunctionGlobalName(msg.getName(), "serializeInput");
         String serializerFunctionPropertyName = 
-            getFunctionPropertyName(inputMessagesWithNameConflicts, msg, msg.getName());
+            getFunctionPropertyName(inputMessagesWithNameConflicts, msg, msg.getName())
+            + "_serializeInput";
 
         code.append("function " + serializerFunctionGlobalName + "(args) {\n");
         getElementsForParts(elements, parts);

Modified: incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js?rev=597530&r1=597529&r2=597530&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
Thu Nov 22 19:21:43 2007
@@ -174,6 +174,7 @@
  */
 	
 function CxfApacheOrgClient(utils) {
+	utils.trace("Client constructor");
     this.utils = utils;
     this.soapAction = "";
     this.messageType = "CALL";
@@ -187,9 +188,9 @@
 // This imposes a relatively straightforward set of HTTP options.
 function org_apache_cxf_client_request(url, requestXML, method, sync, headers)
 {
+	this.utils.trace("request " + url);
+	
     this.url = url;
-    this.onSuccess = onSuccess;
-    this.onError = onError;
     this.sync = sync;
 
     this.req = null;
@@ -197,7 +198,7 @@
     if (method) {
         this.method = method;
     } else {
-        if(!requestXML) 
+        if(requestXML) 
             this.method = "POST";
         else
             this.method="GET";
@@ -221,6 +222,7 @@
         throw "ORG_APACHE_CXF_NO_REQUEST_OBJECT";
     }
 
+	this.utils.trace("about to open " + this.method + " " + this.url);
     this.req.open(this.method, this.url, !this.sync);
 
     this.req.setRequestHeader("Content-Type", "application/xml");   
@@ -243,6 +245,9 @@
     // NOTE: we do not call the onerror callback for a synchronous error
     // at request time. We let the request object throw as it will. 
     // onError will only be called for asynchronous errors.
+    this.utils.trace("about to send " + this.method + " " + this.url);
+    this.utils.trace(requestXML);
+    
     this.req.send(requestXML);
 }
 
@@ -259,9 +264,9 @@
         this.utils.trace("onreadystatechange DONE " + httpStatus);
 
         if (httpStatus==200 || httpStatus==0) {
-            if(this.onSuccess != null) {
+            if(this.onsuccess != null) {
                 // the onSuccess function is generated, and picks apart the response.
-                this.onSuccess(req.responseXML);
+                this.onsuccess(req.responseXML);
             }
 		} else {
             this.utils.trace("onreadystatechange DONE ERROR " + 
@@ -270,8 +275,8 @@
                              + req.statusText 
                              + " " 
                              + req.responseText);
-            if(this.onError != null) 
-                this.onError(this);
+            if(this.onerror != null) 
+                this.onerror(this);
 		}
 	}
 }

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=597530&r1=597529&r2=597530&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
Thu Nov 22 19:21:43 2007
@@ -22,8 +22,10 @@
 import java.io.File;
 import java.net.URL;
 import java.util.List;
+import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
 import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
@@ -38,6 +40,8 @@
 
 @org.junit.Ignore
 public class DocLitWrappedClientTest extends AbstractCXFSpringTest {
+    
+    private static final Logger LOG = LogUtils.getL7dLogger(DocLitWrappedClientTest.class);
 
     // shadow declaration from base class.
     private JavascriptTestUtilities testUtilities;
@@ -74,6 +78,8 @@
         testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
             public Void run(Context context) {
                 EndpointImpl endpoint = getBean(EndpointImpl.class, "dlw-service-endpoint");
+                LOG.info("About to call test1 " + endpoint.getAddress());
+
                 Notifier notifier = 
                     testUtilities.rhinoCallConvert("test1", Notifier.class, 
                                                    testUtilities.javaToJS(endpoint.getAddress()),

@@ -82,7 +88,7 @@
                                                    testUtilities.javaToJS(Integer.valueOf(42)),
                                                    testUtilities.javaToJS(Long.valueOf(240000)),
                                                    "This is the cereal shot from guns");
-                boolean notified = notifier.waitForJavascript(0 /* 1000 * 10 */);
+                boolean notified = notifier.waitForJavascript(1000 * 10);
                 assertTrue(notified);
                 Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus",
Integer.class);
                 assertNull(errorStatus);

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=597530&r1=597529&r2=597530&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/logging.properties Thu Nov 22 19:21:43
2007
@@ -25,4 +25,4 @@
 java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
 org.apache.cxf.javascript.level=INFO
 #org.apache.cxf.javascript.service.ServiceJavascriptBuilder.level=FINE
-org.apache.cxf.javascript.service.JavascriptTestUtilities.level=FINE
+org.apache.cxf.javascript.JavascriptTestUtilities.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=597530&r1=597529&r2=597530&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
Thu Nov 22 19:21:43 2007
@@ -29,6 +29,7 @@
 
 function test1ErrorCallback(httpStatus, httpStatusText) 
 {
+    org_apache_cxf_trace.trace("test1 error");
 	globalErrorStatus = httpStatus;
 	globalStatusText = httpStatusText;
 	globalNotifier.notify();
@@ -39,6 +40,7 @@
 // from Java, I think.
 function test1SuccessCallback(responseObject) 
 {
+    org_apache_cxf_trace.trace("test1 success");
 	globalResponseObject = responseObject;
 	globalNotifier.notify();
 }
@@ -46,7 +48,6 @@
 function test1(url, doubleArg, floatArg, intArg, longArg, stringArg) 
 {
 	org_apache_cxf_trace.trace("Enter test1.");
-	throw "frustration";
 	globalNotifier = new org_apache_cxf_notifier();
 	
 	var intf = new org_apache_cxf_javascript_fortest_SimpleDocLitWrapped();



Mime
View raw message