cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r630381 [4/8] - in /incubator/cxf/trunk/rt: bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/ core/src/main/java/org/apache/cxf/databinding/source/mime/ core/src/main/java/org/apache/cxf/interceptor/ core/src/main/java/org/ap...
Date Sat, 23 Feb 2008 02:56:00 GMT
Propchange: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/service/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/cxf/trunk/rt/javascript/src/main/resources/META-INF/cxf/cxf-extension-javascript-client.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/resources/META-INF/cxf/cxf-extension-javascript-client.xml?rev=630381&r1=630380&r2=630381&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/resources/META-INF/cxf/cxf-extension-javascript-client.xml (original)
+++ incubator/cxf/trunk/rt/javascript/src/main/resources/META-INF/cxf/cxf-extension-javascript-client.xml Fri Feb 22 18:55:53 2008
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
- 
-  http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-    
-    <bean class="org.apache.cxf.javascript.JavascriptQueryHandlerRegistry"
-    	id="org.apache.cxf.javascript.JavascriptQueryHandlerRegistry" 
-    	init-method="register"
-    	>
-        <constructor-arg ref="cxf"/>
-    </bean>
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    
+    <bean class="org.apache.cxf.javascript.JavascriptQueryHandlerRegistry"
+    	id="org.apache.cxf.javascript.JavascriptQueryHandlerRegistry" 
+    	init-method="register"
+    	>
+        <constructor-arg ref="cxf"/>
+    </bean>
+</beans>

Propchange: incubator/cxf/trunk/rt/javascript/src/main/resources/META-INF/cxf/cxf-extension-javascript-client.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/javascript/src/main/resources/META-INF/cxf/cxf-extension-javascript-client.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/javascript/src/main/resources/META-INF/cxf/cxf-extension-javascript-client.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitBareClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitBareClientTest.java?rev=630381&r1=630380&r2=630381&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitBareClientTest.java (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitBareClientTest.java Fri Feb 22 18:55:53 2008
@@ -1,275 +1,275 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.javascript;
-
-import java.util.logging.Logger;
-
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
-import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
-import org.apache.cxf.javascript.fortest.SimpleDocLitBareImpl;
-import org.apache.cxf.javascript.fortest.TestBean1;
-import org.apache.cxf.javascript.fortest.TestBean2;
-import org.junit.Before;
-import org.junit.Test;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.Scriptable;
-import org.springframework.context.support.GenericApplicationContext;
-
-/*
- * We end up here with a part with isElement == true, a non-array element, 
- * but a complex type for an array of the element.
- */
-
-public class DocLitBareClientTest extends JavascriptRhinoTest {
-
-    private static final Logger LOG = LogUtils.getL7dLogger(DocLitBareClientTest.class);
-
-    SimpleDocLitBareImpl implementor;
-
-    public DocLitBareClientTest() throws Exception {
-        super();
-    }
-
-    @Override
-    protected void additionalSpringConfiguration(GenericApplicationContext context) throws Exception {
-    }
-    
-    @Override
-    protected String[] getConfigLocations() {
-        return new String[] {"classpath:DocLitBareClientTestBeans.xml"};
-    }
-    
-    @Before
-    public void before() throws Exception {
-        setupRhino("dlb-service-endpoint", 
-                   "/org/apache/cxf/javascript/DocLitBareTests.js",
-                   true);
-        implementor = (SimpleDocLitBareImpl)rawImplementor;
-        implementor.resetLastValues();
-    }
-
-    private Void beanFunctionCaller(Context context) {
-        
-        TestBean1 b1 = new TestBean1(); 
-        b1.stringItem = "strung";
-        TestBean1[] beans = new TestBean1[3];
-        beans[0] = new TestBean1();
-        beans[0].stringItem = "zerobean";
-        beans[0].beanTwoNotRequiredItem = new TestBean2("bean2");
-        beans[1] = null;
-        beans[2] = new TestBean1();
-        beans[2].stringItem = "twobean";
-        beans[2].optionalIntArrayItem = new int[2];
-        beans[2].optionalIntArrayItem[0] = 4;
-        beans[2].optionalIntArrayItem[1] = 6;
-        
-        Object[] jsBeans = new Object[3];
-        jsBeans[0] = testBean1ToJS(testUtilities, context, beans[0]);
-        jsBeans[1] = null;
-        jsBeans[2] = testBean1ToJS(testUtilities, context, beans[2]);
-        
-        Scriptable jsBean1 = testBean1ToJS(testUtilities, context, b1);
-        Scriptable jsBeanArray = context.newArray(testUtilities.getRhinoScope(), jsBeans);
-        
-        LOG.info("About to call beanFunctionTest " + getAddress());
-        Notifier notifier = 
-            testUtilities.rhinoCallConvert("beanFunctionTest", Notifier.class, 
-                                           testUtilities.javaToJS(getAddress()),
-                                           jsBean1,
-                                           jsBeanArray);
-        boolean notified = notifier.waitForJavascript(1000 * 10);
-        assertTrue(notified);
-        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-        assertNull(errorStatus);
-        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-        assertNull(errorText);
-
-        // this method returns void.
-        Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
-        // there is no response, this thing returns 'void'
-        assertNull(responseObject);
-        SimpleDocLitBareImpl impl = (SimpleDocLitBareImpl)rawImplementor;
-        TestBean1 b1returned = impl.getLastBean1();
-        assertEquals(b1, b1returned);
-        // commented out until 
-        //TestBean1[] beansReturned = impl.getLastBean1Array();
-        //assertArrayEquals(beans, beansReturned);
-        return null;
-    }
-    
-    private Void compliantCaller(Context context) {
-        TestBean1 b1 = new TestBean1(); 
-        b1.stringItem = "strung";
-
-        b1.beanTwoNotRequiredItem = new TestBean2("bean2");
-        
-        Scriptable jsBean1 = testBean1ToJS(testUtilities, context, b1);
-        
-        LOG.info("About to call compliant" + getAddress());
-        Notifier notifier = 
-            testUtilities.rhinoCallConvert("compliantTest", Notifier.class, 
-                                           testUtilities.javaToJS(getAddress()),
-                                           jsBean1);
-        boolean notified = notifier.waitForJavascript(1000 * 10);
-        assertTrue(notified);
-        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-        assertNull(errorStatus);
-        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-        assertNull(errorText);
-
-        //This method returns a String
-        String response = (String)testUtilities.rhinoEvaluate("globalResponseObject");
-        assertEquals("strung", response);
-        return null;
-    }
-    
-    private Void actionMethodCaller(Context context) {
-        LOG.info("About to call actionMethod" + getAddress());
-        Notifier notifier = 
-            testUtilities.rhinoCallConvert("actionMethodTest", Notifier.class, 
-                                           testUtilities.javaToJS(getAddress()),
-                                           "wrong");
-        boolean notified = notifier.waitForJavascript(1000 * 10);
-        assertTrue(notified);
-        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-        assertNull(errorStatus);
-        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-        assertNull(errorText);
-
-        //This method returns a String
-        String response = (String)testUtilities.rhinoEvaluate("globalResponseObject");
-        assertEquals("wrong", response);
-        return null;
-    }
-    
-    private Void onewayCaller(Context context) {
-        LOG.info("About to call onewayMethod" + getAddress());
-        testUtilities.rhinoCall("actionMethodTest",  
-                                testUtilities.javaToJS(getAddress()),
-                                "corrigan");
-        assertEquals("corrigan", implementor.getLastString());
-        return null;
-    }
-    
-    private Void compliantNoArgsCaller(Context context) {
-        LOG.info("About to call compliantNoArgs " + getAddress());
-        Notifier notifier = 
-            testUtilities.rhinoCallConvert("compliantNoArgsTest", Notifier.class, 
-                                           testUtilities.javaToJS(getAddress()));
-
-        boolean notified = notifier.waitForJavascript(1000 * 10);
-        assertTrue(notified);
-        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-        assertNull(errorStatus);
-        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-        assertNull(errorText);
-
-        //This method returns a String
-        Scriptable response = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
-        String item = testUtilities.rhinoCallMethodConvert(String.class, response, "getStringItem");
-        assertEquals("horsefeathers", item);
-        return null;
-    }
-    
-    @Test
-    public void callFunctionWithBeans() {
-        LOG.info("about to call beanFunctionTest");
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                return beanFunctionCaller(context);
-            }
-        });
-    }
-
-    @Test
-    public void callCompliant() {
-        LOG.info("about to call compliant");
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                return compliantCaller(context);
-            }
-        });
-    }
-
-    @Test
-    public void callActionMethod() {
-        LOG.info("about to call actionMethod");
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                return actionMethodCaller(context);
-            }
-        });
-    }
-
-    @Test
-    public void callOneway() {
-        LOG.info("about to call oneway");
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                return onewayCaller(context);
-            }
-        });
-    }
-
-    @Test
-    public void callCompliantNoArgs() {
-        LOG.info("about to call compliantNoArg");
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                return compliantNoArgsCaller(context);
-            }
-        });
-    }
-
-    public static Scriptable testBean1ToJS(JavascriptTestUtilities testUtilities,
-                                           Context context, 
-                                           TestBean1 b1) {
-        if (b1 == null) {
-            return null; // black is always in fashion. (Really, we can be called with a null).
-        }
-        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
-                                          "org_apache_cxf_javascript_testns_testBean1");
-        testUtilities.rhinoCallMethod(rv, "setStringItem", testUtilities.javaToJS(b1.stringItem));
-        testUtilities.rhinoCallMethod(rv, "setIntItem", testUtilities.javaToJS(b1.intItem));
-        testUtilities.rhinoCallMethod(rv, "setLongItem", testUtilities.javaToJS(b1.longItem));
-        testUtilities.rhinoCallMethod(rv, "setBase64Item", testUtilities.javaToJS(b1.base64Item));
-        testUtilities.rhinoCallMethod(rv, "setOptionalIntItem", testUtilities.javaToJS(b1.optionalIntItem));
-        testUtilities.rhinoCallMethod(rv, "setOptionalIntArrayItem",
-                                      testUtilities.javaToJS(b1.optionalIntArrayItem));
-        testUtilities.rhinoCallMethod(rv, "setDoubleItem", testUtilities.javaToJS(b1.doubleItem));
-        testUtilities.rhinoCallMethod(rv, "setBeanTwoItem", testBean2ToJS(testUtilities,
-                                                                          context, b1.beanTwoItem));
-        testUtilities.rhinoCallMethod(rv, "setBeanTwoNotRequiredItem", 
-                                      testBean2ToJS(testUtilities, context, b1.beanTwoNotRequiredItem));
-        return rv; 
-    }
-
-    public static Object testBean2ToJS(JavascriptTestUtilities testUtilities,
-                                       Context context, TestBean2 beanTwoItem) {
-        if (beanTwoItem == null) {
-            return null;
-        }
-        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
-                                          "org_apache_cxf_javascript_testns3_testBean2");
-        testUtilities.rhinoCallMethod(rv, "setStringItem", beanTwoItem.stringItem);
-        return rv;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript;
+
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
+import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
+import org.apache.cxf.javascript.fortest.SimpleDocLitBareImpl;
+import org.apache.cxf.javascript.fortest.TestBean1;
+import org.apache.cxf.javascript.fortest.TestBean2;
+import org.junit.Before;
+import org.junit.Test;
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Scriptable;
+import org.springframework.context.support.GenericApplicationContext;
+
+/*
+ * We end up here with a part with isElement == true, a non-array element, 
+ * but a complex type for an array of the element.
+ */
+
+public class DocLitBareClientTest extends JavascriptRhinoTest {
+
+    private static final Logger LOG = LogUtils.getL7dLogger(DocLitBareClientTest.class);
+
+    SimpleDocLitBareImpl implementor;
+
+    public DocLitBareClientTest() throws Exception {
+        super();
+    }
+
+    @Override
+    protected void additionalSpringConfiguration(GenericApplicationContext context) throws Exception {
+    }
+    
+    @Override
+    protected String[] getConfigLocations() {
+        return new String[] {"classpath:DocLitBareClientTestBeans.xml"};
+    }
+    
+    @Before
+    public void before() throws Exception {
+        setupRhino("dlb-service-endpoint", 
+                   "/org/apache/cxf/javascript/DocLitBareTests.js",
+                   true);
+        implementor = (SimpleDocLitBareImpl)rawImplementor;
+        implementor.resetLastValues();
+    }
+
+    private Void beanFunctionCaller(Context context) {
+        
+        TestBean1 b1 = new TestBean1(); 
+        b1.stringItem = "strung";
+        TestBean1[] beans = new TestBean1[3];
+        beans[0] = new TestBean1();
+        beans[0].stringItem = "zerobean";
+        beans[0].beanTwoNotRequiredItem = new TestBean2("bean2");
+        beans[1] = null;
+        beans[2] = new TestBean1();
+        beans[2].stringItem = "twobean";
+        beans[2].optionalIntArrayItem = new int[2];
+        beans[2].optionalIntArrayItem[0] = 4;
+        beans[2].optionalIntArrayItem[1] = 6;
+        
+        Object[] jsBeans = new Object[3];
+        jsBeans[0] = testBean1ToJS(testUtilities, context, beans[0]);
+        jsBeans[1] = null;
+        jsBeans[2] = testBean1ToJS(testUtilities, context, beans[2]);
+        
+        Scriptable jsBean1 = testBean1ToJS(testUtilities, context, b1);
+        Scriptable jsBeanArray = context.newArray(testUtilities.getRhinoScope(), jsBeans);
+        
+        LOG.info("About to call beanFunctionTest " + getAddress());
+        Notifier notifier = 
+            testUtilities.rhinoCallConvert("beanFunctionTest", Notifier.class, 
+                                           testUtilities.javaToJS(getAddress()),
+                                           jsBean1,
+                                           jsBeanArray);
+        boolean notified = notifier.waitForJavascript(1000 * 10);
+        assertTrue(notified);
+        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+        assertNull(errorStatus);
+        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+        assertNull(errorText);
+
+        // this method returns void.
+        Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
+        // there is no response, this thing returns 'void'
+        assertNull(responseObject);
+        SimpleDocLitBareImpl impl = (SimpleDocLitBareImpl)rawImplementor;
+        TestBean1 b1returned = impl.getLastBean1();
+        assertEquals(b1, b1returned);
+        // commented out until 
+        //TestBean1[] beansReturned = impl.getLastBean1Array();
+        //assertArrayEquals(beans, beansReturned);
+        return null;
+    }
+    
+    private Void compliantCaller(Context context) {
+        TestBean1 b1 = new TestBean1(); 
+        b1.stringItem = "strung";
+
+        b1.beanTwoNotRequiredItem = new TestBean2("bean2");
+        
+        Scriptable jsBean1 = testBean1ToJS(testUtilities, context, b1);
+        
+        LOG.info("About to call compliant" + getAddress());
+        Notifier notifier = 
+            testUtilities.rhinoCallConvert("compliantTest", Notifier.class, 
+                                           testUtilities.javaToJS(getAddress()),
+                                           jsBean1);
+        boolean notified = notifier.waitForJavascript(1000 * 10);
+        assertTrue(notified);
+        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+        assertNull(errorStatus);
+        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+        assertNull(errorText);
+
+        //This method returns a String
+        String response = (String)testUtilities.rhinoEvaluate("globalResponseObject");
+        assertEquals("strung", response);
+        return null;
+    }
+    
+    private Void actionMethodCaller(Context context) {
+        LOG.info("About to call actionMethod" + getAddress());
+        Notifier notifier = 
+            testUtilities.rhinoCallConvert("actionMethodTest", Notifier.class, 
+                                           testUtilities.javaToJS(getAddress()),
+                                           "wrong");
+        boolean notified = notifier.waitForJavascript(1000 * 10);
+        assertTrue(notified);
+        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+        assertNull(errorStatus);
+        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+        assertNull(errorText);
+
+        //This method returns a String
+        String response = (String)testUtilities.rhinoEvaluate("globalResponseObject");
+        assertEquals("wrong", response);
+        return null;
+    }
+    
+    private Void onewayCaller(Context context) {
+        LOG.info("About to call onewayMethod" + getAddress());
+        testUtilities.rhinoCall("actionMethodTest",  
+                                testUtilities.javaToJS(getAddress()),
+                                "corrigan");
+        assertEquals("corrigan", implementor.getLastString());
+        return null;
+    }
+    
+    private Void compliantNoArgsCaller(Context context) {
+        LOG.info("About to call compliantNoArgs " + getAddress());
+        Notifier notifier = 
+            testUtilities.rhinoCallConvert("compliantNoArgsTest", Notifier.class, 
+                                           testUtilities.javaToJS(getAddress()));
+
+        boolean notified = notifier.waitForJavascript(1000 * 10);
+        assertTrue(notified);
+        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+        assertNull(errorStatus);
+        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+        assertNull(errorText);
+
+        //This method returns a String
+        Scriptable response = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
+        String item = testUtilities.rhinoCallMethodConvert(String.class, response, "getStringItem");
+        assertEquals("horsefeathers", item);
+        return null;
+    }
+    
+    @Test
+    public void callFunctionWithBeans() {
+        LOG.info("about to call beanFunctionTest");
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                return beanFunctionCaller(context);
+            }
+        });
+    }
+
+    @Test
+    public void callCompliant() {
+        LOG.info("about to call compliant");
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                return compliantCaller(context);
+            }
+        });
+    }
+
+    @Test
+    public void callActionMethod() {
+        LOG.info("about to call actionMethod");
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                return actionMethodCaller(context);
+            }
+        });
+    }
+
+    @Test
+    public void callOneway() {
+        LOG.info("about to call oneway");
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                return onewayCaller(context);
+            }
+        });
+    }
+
+    @Test
+    public void callCompliantNoArgs() {
+        LOG.info("about to call compliantNoArg");
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                return compliantNoArgsCaller(context);
+            }
+        });
+    }
+
+    public static Scriptable testBean1ToJS(JavascriptTestUtilities testUtilities,
+                                           Context context, 
+                                           TestBean1 b1) {
+        if (b1 == null) {
+            return null; // black is always in fashion. (Really, we can be called with a null).
+        }
+        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
+                                          "org_apache_cxf_javascript_testns_testBean1");
+        testUtilities.rhinoCallMethod(rv, "setStringItem", testUtilities.javaToJS(b1.stringItem));
+        testUtilities.rhinoCallMethod(rv, "setIntItem", testUtilities.javaToJS(b1.intItem));
+        testUtilities.rhinoCallMethod(rv, "setLongItem", testUtilities.javaToJS(b1.longItem));
+        testUtilities.rhinoCallMethod(rv, "setBase64Item", testUtilities.javaToJS(b1.base64Item));
+        testUtilities.rhinoCallMethod(rv, "setOptionalIntItem", testUtilities.javaToJS(b1.optionalIntItem));
+        testUtilities.rhinoCallMethod(rv, "setOptionalIntArrayItem",
+                                      testUtilities.javaToJS(b1.optionalIntArrayItem));
+        testUtilities.rhinoCallMethod(rv, "setDoubleItem", testUtilities.javaToJS(b1.doubleItem));
+        testUtilities.rhinoCallMethod(rv, "setBeanTwoItem", testBean2ToJS(testUtilities,
+                                                                          context, b1.beanTwoItem));
+        testUtilities.rhinoCallMethod(rv, "setBeanTwoNotRequiredItem", 
+                                      testBean2ToJS(testUtilities, context, b1.beanTwoNotRequiredItem));
+        return rv; 
+    }
+
+    public static Object testBean2ToJS(JavascriptTestUtilities testUtilities,
+                                       Context context, TestBean2 beanTwoItem) {
+        if (beanTwoItem == null) {
+            return null;
+        }
+        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
+                                          "org_apache_cxf_javascript_testns3_testBean2");
+        testUtilities.rhinoCallMethod(rv, "setStringItem", beanTwoItem.stringItem);
+        return rv;
+    }
+}

Propchange: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitBareClientTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitBareClientTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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=630381&r1=630380&r2=630381&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 Feb 22 18:55:53 2008
@@ -1,301 +1,301 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.javascript;
-
-import java.io.File;
-import java.net.URL;
-import java.util.logging.Logger;
-
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
-import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
-import org.apache.cxf.javascript.fortest.SimpleDocLitWrappedImpl;
-import org.apache.cxf.javascript.fortest.TestBean1;
-import org.apache.cxf.javascript.fortest.TestBean2;
-import org.junit.Before;
-import org.junit.Test;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.Scriptable;
-import org.springframework.context.support.GenericApplicationContext;
-
-public class DocLitWrappedClientTest extends JavascriptRhinoTest {
-
-    private static final Logger LOG = LogUtils.getL7dLogger(DocLitWrappedClientTest.class);
-
-    public DocLitWrappedClientTest() throws Exception {
-        super();
-    }
-
-    public String getStaticResourceURL() throws Exception {
-        File staticFile = new File(this.getClass().getResource("test.html").toURI());
-        staticFile = staticFile.getParentFile();
-        staticFile = staticFile.getAbsoluteFile();
-        URL furl = staticFile.toURI().toURL();
-        return furl.toString();
-    }
-
-    @Before
-    public void before() throws Exception {
-        setupRhino("dlw-service-endpoint", 
-                   "/org/apache/cxf/javascript/DocLitWrappedTests.js", 
-                   false);
-    }
-    
-    @Override
-    protected void additionalSpringConfiguration(GenericApplicationContext context) throws Exception {
-    }
-    
-    @Override
-    protected String[] getConfigLocations() {
-        return new String[] {"classpath:DocLitWrappedClientTestBeans.xml"};
-    }
-
-    private Void beanFunctionCaller(Context context, boolean useWrapper) {
-        TestBean1 b1 = new TestBean1(); 
-        b1.stringItem = "strung";
-        TestBean1[] beans = new TestBean1[3];
-        beans[0] = new TestBean1();
-        beans[0].beanTwoNotRequiredItem = new TestBean2("bean2");
-        beans[1] = null;
-        beans[2] = new TestBean1();
-        beans[2].optionalIntArrayItem = new int[2];
-        beans[2].optionalIntArrayItem[0] = 4;
-        beans[2].optionalIntArrayItem[1] = 6;
-        
-        Object[] jsBeans = new Object[3];
-        jsBeans[0] = testBean1ToJS(testUtilities, context, beans[0]);
-        jsBeans[1] = testBean1ToJS(testUtilities, context, beans[1]);
-        jsBeans[2] = testBean1ToJS(testUtilities, context, beans[2]);
-        
-        Scriptable jsBean1 = testBean1ToJS(testUtilities, context, b1);
-        Scriptable jsBeanArray = context.newArray(testUtilities.getRhinoScope(), jsBeans);
-        
-        LOG.info("About to call test4 " + getAddress());
-        Notifier notifier = 
-            testUtilities.rhinoCallConvert("test4", Notifier.class, 
-                                           testUtilities.javaToJS(getAddress()),
-                                           testUtilities.javaToJS(Boolean.valueOf(useWrapper)),
-                                           jsBean1,
-                                           jsBeanArray);
-        boolean notified = notifier.waitForJavascript(1000 * 10);
-        assertTrue(notified);
-        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-        assertNull(errorStatus);
-        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-        assertNull(errorText);
-
-        // This method returns void, which translated into a Javascript object with no properties.
-        // really. Void.
-        Object responseObject = testUtilities.rhinoEvaluate("globalResponseObject");
-        assertNotNull(responseObject);
-        assertEquals(Context.getUndefinedValue(), responseObject);
-        SimpleDocLitWrappedImpl impl = (SimpleDocLitWrappedImpl)rawImplementor; 
-        TestBean1 b1returned = impl.getLastBean1();
-        assertEquals(b1, b1returned);
-        TestBean1[] beansReturned = impl.getLastBean1Array();
-        assertArrayEquals(beans, beansReturned);
-        return null;
-    }
-    
-    @org.junit.Ignore // problems with names on auto-generated wrappers!
-    @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, 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);
-            }
-        });
-    }
-    
-    @Test
-    public void callIntReturnMethod() {
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                LOG.info("About to call test3/IntFunction" + getAddress());
-                Notifier notifier = 
-                    testUtilities.rhinoCallConvert("test3", Notifier.class, 
-                                                   testUtilities.javaToJS(getAddress()), 
-                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
-                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
-                                                   testUtilities.javaToJS(Integer.valueOf(142)),
-                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
-                                                   null);
-                boolean notified = notifier.waitForJavascript(1000 * 10);
-                assertTrue(notified);
-                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-                assertNull(errorStatus);
-                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-                assertNull(errorText);
-
-                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
-                assertNotNull(responseObject);
-                // by default, for doc/lit/wrapped, we end up with a part object with a slot named 
-                // 'return'.
-                Integer returnValue = testUtilities.rhinoCallMethodInContext(Integer.class, responseObject,
-                                                                             "getReturn");
-                assertEquals(42, returnValue);
-
-                return null; // well, null AND void.
-            }
-        });
-    }
-
-    @Test
-    public void callMethodWithoutWrappers() {
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                LOG.info("About to call test2 " + getAddress());
-                Notifier notifier = 
-                    testUtilities.rhinoCallConvert("test2", Notifier.class, 
-                                                   testUtilities.javaToJS(getAddress()), 
-                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
-                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
-                                                   testUtilities.javaToJS(Integer.valueOf(142)),
-                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
-                                                   "This is the cereal shot from gnus");
-                boolean notified = notifier.waitForJavascript(1000 * 10);
-                assertTrue(notified);
-                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-                assertNull(errorStatus);
-                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-                assertNull(errorText);
-
-                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
-                assertNotNull(responseObject);
-                // by default, for doc/lit/wrapped, we end up with a part object with a slot named 
-                // 'return'.
-                String returnString = testUtilities.rhinoCallMethodInContext(String.class, responseObject,
-                                                                             "getReturn");
-                assertEquals("cetaceans", returnString);
-
-                return null; // well, null AND void.
-            }
-        });
-    }
-
-    @Test
-    public void callMethodWithWrappers() {
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                LOG.info("About to call test1 " + getAddress());
-
-                Notifier notifier = testUtilities.rhinoCallConvert("test1", Notifier.class, testUtilities
-                    .javaToJS(getAddress()), testUtilities.javaToJS(Double.valueOf(7.0)),
-                                                                   testUtilities.javaToJS(Float
-                                                                       .valueOf((float)11.0)), testUtilities
-                                                                       .javaToJS(Integer.valueOf(42)),
-                                                                   testUtilities.javaToJS(Long
-                                                                       .valueOf(240000)),
-                                                                   "This is the cereal shot from guns");
-                boolean notified = notifier.waitForJavascript(1000 * 10);
-                assertTrue(notified);
-                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-                assertNull(errorStatus);
-                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-                assertNull(errorText);
-
-                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
-                assertNotNull(responseObject);
-                String returnString = testUtilities.rhinoCallMethodInContext(String.class, responseObject,
-                                                                             "getReturnValue");
-                assertEquals("eels", returnString);
-                return null;
-            }
-        });
-    }
-    
-    @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" + getAddress());
-                Notifier notifier = 
-                    testUtilities.rhinoCallConvert("test2", Notifier.class, 
-                                                   testUtilities.javaToJS(getAddress()), 
-                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
-                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
-                                                   testUtilities.javaToJS(Integer.valueOf(142)),
-                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
-                                                   null);
-                boolean notified = notifier.waitForJavascript(1000 * 10);
-                assertTrue(notified);
-                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-                assertNull(errorStatus);
-                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-                assertNull(errorText);
-
-                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
-                assertNotNull(responseObject);
-                // by default, for doc/lit/wrapped, we end up with a part object with a slot named 
-                // 'return'.
-                String returnString = testUtilities.rhinoCallMethodInContext(String.class, responseObject,
-                                                                             "getReturn");
-                assertEquals("cetaceans", returnString);
-
-                return null; // well, null AND void.
-            }
-        });
-    }
-
-    public static Scriptable testBean1ToJS(JavascriptTestUtilities testUtilities,
-                                           Context context, 
-                                           TestBean1 b1) {
-        if (b1 == null) {
-            return null; // black is always in fashion. (Really, we can be called with a null).
-        }
-        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
-                                          "org_apache_cxf_javascript_testns_testBean1");
-        testUtilities.rhinoCallMethod(rv, "setStringItem", testUtilities.javaToJS(b1.stringItem));
-        testUtilities.rhinoCallMethod(rv, "setIntItem", testUtilities.javaToJS(b1.intItem));
-        testUtilities.rhinoCallMethod(rv, "setLongItem", testUtilities.javaToJS(b1.longItem));
-        testUtilities.rhinoCallMethod(rv, "setBase64Item", testUtilities.javaToJS(b1.base64Item));
-        testUtilities.rhinoCallMethod(rv, "setOptionalIntItem", testUtilities.javaToJS(b1.optionalIntItem));
-        testUtilities.rhinoCallMethod(rv, "setOptionalIntArrayItem",
-                                      testUtilities.javaToJS(b1.optionalIntArrayItem));
-        testUtilities.rhinoCallMethod(rv, "setDoubleItem", testUtilities.javaToJS(b1.doubleItem));
-        testUtilities.rhinoCallMethod(rv, "setBeanTwoItem", testBean2ToJS(testUtilities,
-                                                                          context, b1.beanTwoItem));
-        testUtilities.rhinoCallMethod(rv, "setBeanTwoNotRequiredItem", 
-                                      testBean2ToJS(testUtilities, context, b1.beanTwoNotRequiredItem));
-        return rv; 
-    }
-
-    public static Object testBean2ToJS(JavascriptTestUtilities testUtilities,
-                                       Context context, TestBean2 beanTwoItem) {
-        if (beanTwoItem == null) {
-            return null;
-        }
-        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
-                                          "org_apache_cxf_javascript_testns3_testBean2");
-        testUtilities.rhinoCallMethod(rv, "setStringItem", beanTwoItem.stringItem);
-        return rv;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript;
+
+import java.io.File;
+import java.net.URL;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
+import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
+import org.apache.cxf.javascript.fortest.SimpleDocLitWrappedImpl;
+import org.apache.cxf.javascript.fortest.TestBean1;
+import org.apache.cxf.javascript.fortest.TestBean2;
+import org.junit.Before;
+import org.junit.Test;
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Scriptable;
+import org.springframework.context.support.GenericApplicationContext;
+
+public class DocLitWrappedClientTest extends JavascriptRhinoTest {
+
+    private static final Logger LOG = LogUtils.getL7dLogger(DocLitWrappedClientTest.class);
+
+    public DocLitWrappedClientTest() throws Exception {
+        super();
+    }
+
+    public String getStaticResourceURL() throws Exception {
+        File staticFile = new File(this.getClass().getResource("test.html").toURI());
+        staticFile = staticFile.getParentFile();
+        staticFile = staticFile.getAbsoluteFile();
+        URL furl = staticFile.toURI().toURL();
+        return furl.toString();
+    }
+
+    @Before
+    public void before() throws Exception {
+        setupRhino("dlw-service-endpoint", 
+                   "/org/apache/cxf/javascript/DocLitWrappedTests.js", 
+                   false);
+    }
+    
+    @Override
+    protected void additionalSpringConfiguration(GenericApplicationContext context) throws Exception {
+    }
+    
+    @Override
+    protected String[] getConfigLocations() {
+        return new String[] {"classpath:DocLitWrappedClientTestBeans.xml"};
+    }
+
+    private Void beanFunctionCaller(Context context, boolean useWrapper) {
+        TestBean1 b1 = new TestBean1(); 
+        b1.stringItem = "strung";
+        TestBean1[] beans = new TestBean1[3];
+        beans[0] = new TestBean1();
+        beans[0].beanTwoNotRequiredItem = new TestBean2("bean2");
+        beans[1] = null;
+        beans[2] = new TestBean1();
+        beans[2].optionalIntArrayItem = new int[2];
+        beans[2].optionalIntArrayItem[0] = 4;
+        beans[2].optionalIntArrayItem[1] = 6;
+        
+        Object[] jsBeans = new Object[3];
+        jsBeans[0] = testBean1ToJS(testUtilities, context, beans[0]);
+        jsBeans[1] = testBean1ToJS(testUtilities, context, beans[1]);
+        jsBeans[2] = testBean1ToJS(testUtilities, context, beans[2]);
+        
+        Scriptable jsBean1 = testBean1ToJS(testUtilities, context, b1);
+        Scriptable jsBeanArray = context.newArray(testUtilities.getRhinoScope(), jsBeans);
+        
+        LOG.info("About to call test4 " + getAddress());
+        Notifier notifier = 
+            testUtilities.rhinoCallConvert("test4", Notifier.class, 
+                                           testUtilities.javaToJS(getAddress()),
+                                           testUtilities.javaToJS(Boolean.valueOf(useWrapper)),
+                                           jsBean1,
+                                           jsBeanArray);
+        boolean notified = notifier.waitForJavascript(1000 * 10);
+        assertTrue(notified);
+        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+        assertNull(errorStatus);
+        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+        assertNull(errorText);
+
+        // This method returns void, which translated into a Javascript object with no properties.
+        // really. Void.
+        Object responseObject = testUtilities.rhinoEvaluate("globalResponseObject");
+        assertNotNull(responseObject);
+        assertEquals(Context.getUndefinedValue(), responseObject);
+        SimpleDocLitWrappedImpl impl = (SimpleDocLitWrappedImpl)rawImplementor; 
+        TestBean1 b1returned = impl.getLastBean1();
+        assertEquals(b1, b1returned);
+        TestBean1[] beansReturned = impl.getLastBean1Array();
+        assertArrayEquals(beans, beansReturned);
+        return null;
+    }
+    
+    @org.junit.Ignore // problems with names on auto-generated wrappers!
+    @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, 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);
+            }
+        });
+    }
+    
+    @Test
+    public void callIntReturnMethod() {
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                LOG.info("About to call test3/IntFunction" + getAddress());
+                Notifier notifier = 
+                    testUtilities.rhinoCallConvert("test3", Notifier.class, 
+                                                   testUtilities.javaToJS(getAddress()), 
+                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
+                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
+                                                   testUtilities.javaToJS(Integer.valueOf(142)),
+                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
+                                                   null);
+                boolean notified = notifier.waitForJavascript(1000 * 10);
+                assertTrue(notified);
+                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+                assertNull(errorStatus);
+                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+                assertNull(errorText);
+
+                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
+                assertNotNull(responseObject);
+                // by default, for doc/lit/wrapped, we end up with a part object with a slot named 
+                // 'return'.
+                Integer returnValue = testUtilities.rhinoCallMethodInContext(Integer.class, responseObject,
+                                                                             "getReturn");
+                assertEquals(42, returnValue);
+
+                return null; // well, null AND void.
+            }
+        });
+    }
+
+    @Test
+    public void callMethodWithoutWrappers() {
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                LOG.info("About to call test2 " + getAddress());
+                Notifier notifier = 
+                    testUtilities.rhinoCallConvert("test2", Notifier.class, 
+                                                   testUtilities.javaToJS(getAddress()), 
+                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
+                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
+                                                   testUtilities.javaToJS(Integer.valueOf(142)),
+                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
+                                                   "This is the cereal shot from gnus");
+                boolean notified = notifier.waitForJavascript(1000 * 10);
+                assertTrue(notified);
+                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+                assertNull(errorStatus);
+                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+                assertNull(errorText);
+
+                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
+                assertNotNull(responseObject);
+                // by default, for doc/lit/wrapped, we end up with a part object with a slot named 
+                // 'return'.
+                String returnString = testUtilities.rhinoCallMethodInContext(String.class, responseObject,
+                                                                             "getReturn");
+                assertEquals("cetaceans", returnString);
+
+                return null; // well, null AND void.
+            }
+        });
+    }
+
+    @Test
+    public void callMethodWithWrappers() {
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                LOG.info("About to call test1 " + getAddress());
+
+                Notifier notifier = testUtilities.rhinoCallConvert("test1", Notifier.class, testUtilities
+                    .javaToJS(getAddress()), testUtilities.javaToJS(Double.valueOf(7.0)),
+                                                                   testUtilities.javaToJS(Float
+                                                                       .valueOf((float)11.0)), testUtilities
+                                                                       .javaToJS(Integer.valueOf(42)),
+                                                                   testUtilities.javaToJS(Long
+                                                                       .valueOf(240000)),
+                                                                   "This is the cereal shot from guns");
+                boolean notified = notifier.waitForJavascript(1000 * 10);
+                assertTrue(notified);
+                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+                assertNull(errorStatus);
+                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+                assertNull(errorText);
+
+                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
+                assertNotNull(responseObject);
+                String returnString = testUtilities.rhinoCallMethodInContext(String.class, responseObject,
+                                                                             "getReturnValue");
+                assertEquals("eels", returnString);
+                return null;
+            }
+        });
+    }
+    
+    @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" + getAddress());
+                Notifier notifier = 
+                    testUtilities.rhinoCallConvert("test2", Notifier.class, 
+                                                   testUtilities.javaToJS(getAddress()), 
+                                                   testUtilities.javaToJS(Double.valueOf(17.0)),
+                                                   testUtilities.javaToJS(Float.valueOf((float)111.0)),
+                                                   testUtilities.javaToJS(Integer.valueOf(142)),
+                                                   testUtilities.javaToJS(Long.valueOf(1240000)),
+                                                   null);
+                boolean notified = notifier.waitForJavascript(1000 * 10);
+                assertTrue(notified);
+                Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+                assertNull(errorStatus);
+                String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+                assertNull(errorText);
+
+                Scriptable responseObject = (Scriptable)testUtilities.rhinoEvaluate("globalResponseObject");
+                assertNotNull(responseObject);
+                // by default, for doc/lit/wrapped, we end up with a part object with a slot named 
+                // 'return'.
+                String returnString = testUtilities.rhinoCallMethodInContext(String.class, responseObject,
+                                                                             "getReturn");
+                assertEquals("cetaceans", returnString);
+
+                return null; // well, null AND void.
+            }
+        });
+    }
+
+    public static Scriptable testBean1ToJS(JavascriptTestUtilities testUtilities,
+                                           Context context, 
+                                           TestBean1 b1) {
+        if (b1 == null) {
+            return null; // black is always in fashion. (Really, we can be called with a null).
+        }
+        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
+                                          "org_apache_cxf_javascript_testns_testBean1");
+        testUtilities.rhinoCallMethod(rv, "setStringItem", testUtilities.javaToJS(b1.stringItem));
+        testUtilities.rhinoCallMethod(rv, "setIntItem", testUtilities.javaToJS(b1.intItem));
+        testUtilities.rhinoCallMethod(rv, "setLongItem", testUtilities.javaToJS(b1.longItem));
+        testUtilities.rhinoCallMethod(rv, "setBase64Item", testUtilities.javaToJS(b1.base64Item));
+        testUtilities.rhinoCallMethod(rv, "setOptionalIntItem", testUtilities.javaToJS(b1.optionalIntItem));
+        testUtilities.rhinoCallMethod(rv, "setOptionalIntArrayItem",
+                                      testUtilities.javaToJS(b1.optionalIntArrayItem));
+        testUtilities.rhinoCallMethod(rv, "setDoubleItem", testUtilities.javaToJS(b1.doubleItem));
+        testUtilities.rhinoCallMethod(rv, "setBeanTwoItem", testBean2ToJS(testUtilities,
+                                                                          context, b1.beanTwoItem));
+        testUtilities.rhinoCallMethod(rv, "setBeanTwoNotRequiredItem", 
+                                      testBean2ToJS(testUtilities, context, b1.beanTwoNotRequiredItem));
+        return rv; 
+    }
+
+    public static Object testBean2ToJS(JavascriptTestUtilities testUtilities,
+                                       Context context, TestBean2 beanTwoItem) {
+        if (beanTwoItem == null) {
+            return null;
+        }
+        Scriptable rv = context.newObject(testUtilities.getRhinoScope(), 
+                                          "org_apache_cxf_javascript_testns3_testBean2");
+        testUtilities.rhinoCallMethod(rv, "setStringItem", beanTwoItem.stringItem);
+        return rv;
+    }
+}

Propchange: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/DocLitWrappedClientTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/GreeterClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/GreeterClientTest.java?rev=630381&r1=630380&r2=630381&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/GreeterClientTest.java (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/GreeterClientTest.java Fri Feb 22 18:55:53 2008
@@ -1,94 +1,94 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.javascript;
-
-import java.io.File;
-import java.net.URL;
-
-import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
-import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
-import org.junit.Before;
-import org.junit.Test;
-import org.mozilla.javascript.Context;
-import org.springframework.context.support.GenericApplicationContext;
-
-/**
- *  Test the same schema used in the samples.
- */
-public class GreeterClientTest extends JavascriptRhinoTest {
-
-    public GreeterClientTest() throws Exception {
-        super();
-    }
-    
-    @Override
-    protected String[] getConfigLocations() {
-        return new String[] {"classpath:GreeterClientTestBeans.xml"};
-    }
-    
-    
-    @Before
-    public 
-    void before() throws Exception {
-        setupRhino("greeter-service-endpoint",  
-                   "/org/apache/cxf/javascript/GreeterTests.js",
-                   true);
-    }
-    
-    private Void sayHiCaller(Context context) {
-        Notifier notifier = 
-            testUtilities.rhinoCallConvert("sayHiTest", Notifier.class, 
-                                           testUtilities.javaToJS(getAddress()));
-        
-        boolean notified = notifier.waitForJavascript(1000 * 10);
-        assertTrue(notified);
-        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
-        assertNull(errorStatus);
-        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
-        assertNull(errorText);
-
-        // this method returns a String inside of an object, since there's an @WebResponse
-        String responseObject = testUtilities.rhinoEvaluateConvert("globalResponseObject.getResponseType()", 
-                                                                   String.class);
-        assertEquals("Bonjour", responseObject);
-        return null;
-    }
-    
-    @Test
-    public void testCallSayHi() throws Exception {
-        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
-            public Void run(Context context) {
-                return sayHiCaller(context);
-            }
-        });
-    }
-
-    public String getStaticResourceURL() throws Exception {
-        File staticFile = new File(this.getClass().getResource("test.html").toURI());
-        staticFile = staticFile.getParentFile();
-        staticFile = staticFile.getAbsoluteFile();
-        URL furl = staticFile.toURI().toURL();
-        return furl.toString();
-    }
-
-    @Override
-    protected void additionalSpringConfiguration(GenericApplicationContext context) throws Exception {
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript;
+
+import java.io.File;
+import java.net.URL;
+
+import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
+import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
+import org.junit.Before;
+import org.junit.Test;
+import org.mozilla.javascript.Context;
+import org.springframework.context.support.GenericApplicationContext;
+
+/**
+ *  Test the same schema used in the samples.
+ */
+public class GreeterClientTest extends JavascriptRhinoTest {
+
+    public GreeterClientTest() throws Exception {
+        super();
+    }
+    
+    @Override
+    protected String[] getConfigLocations() {
+        return new String[] {"classpath:GreeterClientTestBeans.xml"};
+    }
+    
+    
+    @Before
+    public 
+    void before() throws Exception {
+        setupRhino("greeter-service-endpoint",  
+                   "/org/apache/cxf/javascript/GreeterTests.js",
+                   true);
+    }
+    
+    private Void sayHiCaller(Context context) {
+        Notifier notifier = 
+            testUtilities.rhinoCallConvert("sayHiTest", Notifier.class, 
+                                           testUtilities.javaToJS(getAddress()));
+        
+        boolean notified = notifier.waitForJavascript(1000 * 10);
+        assertTrue(notified);
+        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+        assertNull(errorStatus);
+        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+        assertNull(errorText);
+
+        // this method returns a String inside of an object, since there's an @WebResponse
+        String responseObject = testUtilities.rhinoEvaluateConvert("globalResponseObject.getResponseType()", 
+                                                                   String.class);
+        assertEquals("Bonjour", responseObject);
+        return null;
+    }
+    
+    @Test
+    public void testCallSayHi() throws Exception {
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                return sayHiCaller(context);
+            }
+        });
+    }
+
+    public String getStaticResourceURL() throws Exception {
+        File staticFile = new File(this.getClass().getResource("test.html").toURI());
+        staticFile = staticFile.getParentFile();
+        staticFile = staticFile.getAbsoluteFile();
+        URL furl = staticFile.toURI().toURL();
+        return furl.toString();
+    }
+
+    @Override
+    protected void additionalSpringConfiguration(GenericApplicationContext context) throws Exception {
+    }
+}

Propchange: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/GreeterClientTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/GreeterClientTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message