tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r529605 - in /incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test: java/org/apache/tuscany/binding/axis2/itests/endpoints/ resources/org/apache/tuscany/binding/axis2/itests/endpoints/
Date Tue, 17 Apr 2007 13:59:17 GMT
Author: antelder
Date: Tue Apr 17 06:59:16 2007
New Revision: 529605

URL: http://svn.apache.org/viewvc?view=rev&rev=529605
Log:
Start adding WS endpoint tests 

Added:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
  (with props)
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/Endpoint1TestCase.java
  (with props)
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/endpoints/endpoint1.composite

Added: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java?view=auto&rev=529605
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
(added)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
Tue Apr 17 06:59:16 2007
@@ -0,0 +1,62 @@
+/*
+ * 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.tuscany.binding.axis2.itests.endpoints;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.binding.axis2.itests.HelloWorldOM;
+import org.apache.tuscany.host.embedded.SCARuntime;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
+
+public abstract class AbstractHelloWorldOMTestCase extends TestCase {
+
+    private HelloWorldOM helloWorld;
+
+    public void testCalculator() throws Exception {
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om",
"helloworld");
+        OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+        requestOM.addChild(parmE);
+        parmE.addChild(fac.createOMText("petra"));
+        OMElement responseOM = helloWorld.getGreetings(requestOM);
+        OMElement child = (OMElement)responseOM.getFirstElement();
+        Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+    }
+
+    protected void setUp() throws Exception {
+        SCARuntime.start(getCompositeName());
+        ComponentContext context = SCARuntime.getComponentContext("HelloWorldComponent");
+        ServiceReference<HelloWorldOM> service = context.createSelfReference(HelloWorldOM.class);
+        helloWorld = service.getService();
+    }
+    
+    protected void tearDown() throws Exception {
+        SCARuntime.stop();
+    }
+    
+    abstract String getCompositeName();
+
+}

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/Endpoint1TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/Endpoint1TestCase.java?view=auto&rev=529605
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/Endpoint1TestCase.java
(added)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/Endpoint1TestCase.java
Tue Apr 17 06:59:16 2007
@@ -0,0 +1,29 @@
+/*
+ * 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.tuscany.binding.axis2.itests.endpoints;
+
+public class Endpoint1TestCase extends AbstractHelloWorldOMTestCase {
+
+    @Override
+    String getCompositeName() {
+        return "org/apache/tuscany/binding/axis2/itests/endpoints/endpoint1.composite";
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/Endpoint1TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/binding/axis2/itests/endpoints/Endpoint1TestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/endpoints/endpoint1.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/endpoints/endpoint1.composite?view=auto&rev=529605
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/endpoints/endpoint1.composite
(added)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/binding/axis2/itests/endpoints/endpoint1.composite
Tue Apr 17 06:59:16 2007
@@ -0,0 +1,49 @@
+<?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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+
+           name="endpoint1">
+           
+    <!-- 
+    exposing a component with a WS binding, endpoint should be <componentURI>/<serviceName>
+    so for this composite: http://localhost:8080/HelloWorldService/helloWorld 
+    -->      
+
+    <service name="helloWorld" promote="HelloWorldService">
+        <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+        <binding.ws wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"/>
+    </service>
+
+    <component name="HelloWorldService">
+		<implementation.java class="org.apache.tuscany.binding.axis2.itests.HelloWorldOMService"/>
+    </component>
+
+    <component name="HelloWorldComponent">
+		<implementation.java class="org.apache.tuscany.binding.axis2.itests.HelloWorldOMComponent"/>
+        <reference name="helloWorldWS" />
+    </component>
+
+    <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS">
+        <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+        <binding.ws wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"
+                    uri="http://localhost:8080/helloWorld"/>
+    </reference>
+
+</composite>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message