You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bi...@apache.org on 2007/11/24 00:26:41 UTC

svn commit: r597760 - in /incubator/cxf/trunk/rt/javascript/src/test: java/org/apache/cxf/javascript/DocLitWrappedClientTest.java resources/deserializationTests.js resources/org/apache/cxf/javascript/DocLitWrappedTests.js

Author: bimargulies
Date: Fri Nov 23 15:26:32 2007
New Revision: 597760

URL: http://svn.apache.org/viewvc?rev=597760&view=rev
Log:
Fix oops in recent checkin.

Modified:
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java
    incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js
    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=597760&r1=597759&r2=597760&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 15:26:32 2007
@@ -66,9 +66,9 @@
     }
 
     // just one test function to avoid muddles with engine startup/shutdown
-    @Test
+    //@Test
     public void runTests() throws Exception {
-        endpoint = getBean(EndpointImpl.class, "dlw-service-endpoint");
+
         callMethodWithWrappers();
         callMethodWithoutWrappers();
         callTest2WithNullString();
@@ -89,6 +89,7 @@
         ServiceInfo serviceInfo = serviceInfos.get(0);
         testUtilities.loadJavascriptForService(serviceInfo);
         testUtilities.readResourceIntoRhino("/org/apache/cxf/javascript/DocLitWrappedTests.js");
+        endpoint = getBean(EndpointImpl.class, "dlw-service-endpoint");
     }
     
     @Override
@@ -100,7 +101,7 @@
         return new String[] {"classpath:DocLitWrappedClientTestBeans.xml"};
     }
 
-    private Void beanFunctionCaller(Context context) {
+    private Void beanFunctionCaller(Context context, boolean useWrapper) {
         TestBean1 b1 = new TestBean1(); 
         b1.stringItem = "strung";
         TestBean1[] beans = new TestBean1[3];
@@ -123,7 +124,8 @@
         LOG.info("About to call test4 " + endpoint.getAddress());
         Notifier notifier = 
             testUtilities.rhinoCallConvert("test4", Notifier.class, 
-                                           testUtilities.javaToJS(endpoint.getAddress()), 
+                                           testUtilities.javaToJS(endpoint.getAddress()),
+                                           testUtilities.javaToJS(Boolean.valueOf(useWrapper)),
                                            jsBean1,
                                            jsBeanArray);
         boolean notified = notifier.waitForJavascript(1000 * 10);
@@ -144,16 +146,28 @@
         return null;
     }
     
-    private void callFunctionWithBeans() {
+    @Test
+    public void callFunctionWithBeans() {
         LOG.info("about to call test4/beanFunction");
         testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
             public Void run(Context context) {
-                return beanFunctionCaller(context);
+                return beanFunctionCaller(context, false);
+            }
+        });
+    }
+
+    @Test
+    public void callFunctionWithBeansWrapped() {
+        LOG.info("about to call test4/beanFunction");
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                return beanFunctionCaller(context, true);
             }
         });
     }
     
-    private void callIntReturnMethod() {
+    @Test
+    public void callIntReturnMethod() {
         testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
             public Void run(Context context) {
                 LOG.info("About to call test3/IntFunction" + endpoint.getAddress());
@@ -185,7 +199,8 @@
         });
     }
 
-    private void callMethodWithoutWrappers() {
+    @Test
+    public void callMethodWithoutWrappers() {
         testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
             public Void run(Context context) {
                 LOG.info("About to call test2 " + endpoint.getAddress());
@@ -217,7 +232,8 @@
         });
     }
 
-    private void callMethodWithWrappers() {
+    @Test
+    public void callMethodWithWrappers() {
         testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
             public Void run(Context context) {
                 LOG.info("About to call test1 " + endpoint.getAddress());
@@ -247,7 +263,8 @@
         });
     }
 
-    private void callTest2WithNullString() {
+    @Test
+    public void callTest2WithNullString() {
         testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
             public Void run(Context context) {
                 LOG.info("About to call test2 with null string" + endpoint.getAddress());

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js?rev=597760&r1=597759&r2=597760&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js Fri Nov 23 15:26:32 2007
@@ -36,7 +36,7 @@
 	var bean = org_apache_cxf_javascript_testns_testBean1_deserialize(jsutils, dom);
 	if(bean.getStringItem() != "bean1>stringItem")
 		assertionFailed("deserializeTestBean1_1 stringItem " + bean.getStringItem());
-	if(bean.getIntItem() != 0)
+	if(bean.getIntItem() != 43)
 		assertionFailed("deserializeTestBean1_1 intItem " + bean.getIntItem());
 	if(bean.getLongItem() != 0)
 		assertionFailed("deserializeTestBean1_1 longItem " + bean.getLongItem());

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=597760&r1=597759&r2=597760&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 15:26:32 2007
@@ -98,13 +98,17 @@
 	return globalNotifier;
 }
 
-function test4(url, beanArg, beansArg)
+function test4(url, wrap, beanArg, beansArg)
 {
 	org_apache_cxf_trace.trace("Enter test4.");
 	resetGlobals();
 	globalNotifier = new org_apache_cxf_notifier();
 	
-	var intf = new org_apache_cxf_javascript_fortest_SimpleDocLitWrapped();
+	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);