You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ri...@apache.org on 2007/02/05 17:04:55 UTC
svn commit: r503748 - in
/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient: ./
src/main/java/org/apache/tuscany/sca/itest/exceptionsws/
src/main/resources/META-INF/sca/ src/main/resources/wsdl/ src/main/webapp/
src/main/webapp/WEB-INF/ s...
Author: rineholt
Date: Mon Feb 5 08:04:53 2007
New Revision: 503748
URL: http://svn.apache.org/viewvc?view=rev&rev=503748
Log:
help drive business exceptions
Added:
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/
- copied from r503622, incubator/tuscany/java/testing/sca/itest/bindingsTest/bindingsclient/
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/InvalidSymbolException.java
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/MarketClosedException.java
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTest.java
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestComponent.java
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockOffer.java
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/wsdl/StockExceptionTest.wsdl
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/exceptionsws/
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestClient.java
Removed:
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/wsdl/testtool.wsdl
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/webapp/SCATestTool.jsp
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/webapp/WEB-INF/
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsITest.java
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsTestClient.java
Modified:
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/pom.xml
incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/META-INF/sca/default.scdl
Modified: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/pom.xml?view=diff&rev=503748&r1=503622&r2=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/pom.xml (original)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/pom.xml Mon Feb 5 08:04:53 2007
@@ -20,11 +20,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.tuscany.testing.bindingstest</groupId>
- <artifactId>iTest-Bindings-bindingsclient</artifactId>
+ <groupId>org.apache.tuscany.testing.exceptionsws</groupId>
+ <artifactId>exceptionTests-WSClient</artifactId>
<packaging>jar</packaging>
<version>SNAPSHOT</version>
- <name>SCA FVT Bindings Test Tool JSP Client</name>
+ <name>Test Suite Exception Handling Web Services - client</name>
<properties>
<!-- The installation folder of Tomcat -->
@@ -56,20 +56,6 @@
<version>1.0-incubator-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>org.apache.tuscany.testing.bindingstest</groupId>
- <artifactId>iTest-Bindings-bindingscomposite</artifactId>
- <version>SNAPSHOT</version>
- <type>war</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.testing.bindingstest</groupId>
- <artifactId>iTest-Bindings-bindingsutility</artifactId>
- <version>SNAPSHOT</version>
- <type>war</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>test</artifactId>
<version>0.1-pre-spec-SNAPSHOT</version>
@@ -128,15 +114,16 @@
<!-- Configuration to use with the container -->
<configuration>
<home>${project.build.directory}/tomcat5x</home>
+<!--
<deployables>
<deployable>
<groupId>org.apache.tuscany.testing.bindingstest</groupId>
<artifactId>iTest-Bindings-bindingscomposite</artifactId>
<type>war</type>
<properties>
- <context>/testtool</context>
+ <context>/StockExceptionTestService</context>
</properties>
- <pingURL>http://localhost:8080/testtool/services</pingURL>
+ <pingURL>http://localhost:8080/StockExceptionTestService/services</pingURL>
</deployable>
<deployable>
<groupId>org.apache.tuscany.testing.bindingstest</groupId>
@@ -148,6 +135,7 @@
<pingURL>http://localhost:8080/testutil/services</pingURL>
</deployable>
</deployables>
+-->
</configuration>
</configuration>
Added: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/InvalidSymbolException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/InvalidSymbolException.java?view=auto&rev=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/InvalidSymbolException.java (added)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/InvalidSymbolException.java Mon Feb 5 08:04:53 2007
@@ -0,0 +1,68 @@
+/*
+ * 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.sca.itest.exceptionsws;
+
+public class InvalidSymbolException extends Exception {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3980929786960646346L;
+ /**
+ *
+ */
+
+ protected StockOffer stockoffer;
+
+ public InvalidSymbolException() {
+ super();
+
+ }
+
+ public InvalidSymbolException(String message) {
+ super(message);
+
+ }
+
+ public InvalidSymbolException(Throwable cause) {
+ super(cause);
+ if(cause instanceof InvalidSymbolException ) {
+ setStockoffer(((InvalidSymbolException)cause).getStockoffer());
+ }
+
+ }
+
+ public InvalidSymbolException(String message, Throwable cause) {
+ super(message, cause);
+
+ if(cause instanceof InvalidSymbolException ) {
+ setStockoffer(((InvalidSymbolException)cause).getStockoffer());
+ }
+
+ }
+
+ public StockOffer getStockoffer() {
+ return stockoffer;
+ }
+
+ public void setStockoffer(final StockOffer stockoffer) {
+ this.stockoffer = stockoffer;
+ }
+
+}
Added: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/MarketClosedException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/MarketClosedException.java?view=auto&rev=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/MarketClosedException.java (added)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/MarketClosedException.java Mon Feb 5 08:04:53 2007
@@ -0,0 +1,48 @@
+/*
+ * 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.sca.itest.exceptionsws;
+
+public class MarketClosedException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5313242606285171780L;
+
+ public MarketClosedException() {
+ super();
+ }
+
+ public MarketClosedException(String message) {
+ super(message);
+
+ }
+
+ public MarketClosedException(Throwable cause) {
+ super(cause);
+
+ }
+
+ public MarketClosedException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+
+}
Added: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTest.java?view=auto&rev=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTest.java (added)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTest.java Mon Feb 5 08:04:53 2007
@@ -0,0 +1,33 @@
+/*
+ * 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.sca.itest.exceptionsws;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * SCA Test Tool Service
+ */
+
+@Remotable
+public interface StockExceptionTest {
+
+ StockOffer stockQuoteOffer(StockOffer input) throws InvalidSymbolException, MarketClosedException;
+
+}
Added: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestComponent.java?view=auto&rev=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestComponent.java (added)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestComponent.java Mon Feb 5 08:04:53 2007
@@ -0,0 +1,43 @@
+/*
+ * 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.sca.itest.exceptionsws;
+
+public class StockExceptionTestComponent implements StockExceptionTest {
+
+ protected StockExceptionTest serviceReference;
+
+ // public StockExceptionTest getServiceReference() {
+ // return serviceReference;
+ // }
+
+ public StockExceptionTestComponent() {
+ super();
+ }
+
+ public void setServiceReference(final StockExceptionTest serviceReference) {
+ this.serviceReference = serviceReference;
+ }
+
+ public StockOffer stockQuoteOffer(final StockOffer input) throws InvalidSymbolException, MarketClosedException {
+
+ return serviceReference.stockQuoteOffer(input);
+ }
+
+}
Added: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockOffer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockOffer.java?view=auto&rev=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockOffer.java (added)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/java/org/apache/tuscany/sca/itest/exceptionsws/StockOffer.java Mon Feb 5 08:04:53 2007
@@ -0,0 +1,52 @@
+/*
+ * 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.sca.itest.exceptionsws;
+
+public class StockOffer {
+
+ protected String symbol;
+ protected float price; /* <!-- max price reqested, actual response */
+ protected String name;
+
+ public StockOffer(){
+ super();
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+ public void setSymbol(final String symbol) {
+ this.symbol = symbol;
+ }
+ public float getPrice() {
+ return price;
+ }
+ public void setPrice(final float price) {
+ this.price = price;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+
+}
Modified: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/META-INF/sca/default.scdl?view=diff&rev=503748&r1=503622&r2=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/META-INF/sca/default.scdl (original)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/META-INF/sca/default.scdl Mon Feb 5 08:04:53 2007
@@ -1,3 +1,4 @@
+
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,30 +19,23 @@
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:v="http://www.osoa.org/xmlns/sca/values/1.0"
- xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
- xmlns:dbsdo="http://incubator.apache.org/tuscany/xmlns/databinding/sdo/1.0-incubator-M2"
- name="SCATestToolClientComposite">
-
- <!--
- <reference name="SCATestToolSCAReference">
- <interface.java interface="org.apache.tuscany.sca.itest.SCATestToolService"/>
- <binding.sca uri="SCATestToolSCAServiceComponent"/>
- </reference>
- -->
-
- <reference name="SCATestToolWSReference">
- <interface.java interface="org.apache.tuscany.sca.itest.SCATestToolService" />
- <binding.ws endpoint="http://scatesttool.scabeta1fvt#wsdl.endpoint(SCATestToolService/SCATestToolServiceSoapPort)"
- location="wsdl/testtool.wsdl" />
+<?xml version="1.0" encoding="UTF-8"?>
+
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:dbsdo="http://incubator.apache.org/tuscany/xmlns/databinding/sdo/1.0-incubator-M2"
+ name="StockExceptionTestClientComposite">
+
+ <!-- needed cause of a bug -->
+ <component name="StockExceptionTestClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.exceptionsws.StockExceptionTestComponent"/>
+ <reference name="serviceReference">StockExceptionTestWSReference</reference>
+ </component>
+
+ <reference name="StockExceptionTestWSReference">
+ <interface.java interface="org.apache.tuscany.sca.itest.exceptionsws.StockExceptionTest"/>
+ <binding.ws endpoint="http://scatesttool.stockexceptiontestservice#wsdl.endpoint(StockExceptionTestService/StockExceptionTestServiceSoapPort)"
+ location="wsdl/StockExceptionTest.wsdl" />
</reference>
- <!--
- <reference name="SCATestToolEJBReference">
- <interface.java interface="org.apache.tuscany.sca.itest.SCATestToolService"/>
- <binding.ejb uri="corbaname:iiop:localhost:2811/NameServiceServerRoot#ejb/scabeta1fvt/scatesttool/SCATestToolServiceHome"/>
- </reference>
-
- -->
</composite>
-
Added: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/wsdl/StockExceptionTest.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/wsdl/StockExceptionTest.wsdl?view=auto&rev=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/wsdl/StockExceptionTest.wsdl (added)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/main/resources/wsdl/StockExceptionTest.wsdl Mon Feb 5 08:04:53 2007
@@ -0,0 +1,141 @@
+<?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.
+ -->
+<wsdl:definitions targetNamespace="http://scatesttool.stockexceptiontestservice" xmlns:impl="http://scatesttool.stockexceptiontestservice"
+ xmlns:tns="http://scatesttool.stockexceptiontestservice" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockExceptionTest">
+ <wsdl:types>
+ <schema targetNamespace="http://scatesttool.stockexceptiontestservice" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <complexType name=StockOffer>
+ <sequence>
+ <element name="symbol" minOccurs="1" type="xsd:string" />
+ <element name="price" minOccurs="1" type="xsd:float nillable="true" /> <!-- max price reqested, actual response -->
+ <element name="name" minOccurs="0" type="xsd:string" />
+ </sequence>
+ </complexType>
+
+ <element name="stockQuoteOffer">
+ <complexType>
+ <sequence>
+ <element name="input" minOccurs="0" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="stockQuoteOfferResponse">
+ <complexType>
+ <sequence>
+ <element name="stockQuoteOfferReturn" minOccurs="0" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <!- Faults -->
+ <element name="InvalidSymbolFault">
+ <complexType>
+ <sequence>
+ element name="message" minOccurs="1" type="xsd:string" />
+ <element name="offer" minOccurs="1" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="MarketClosedFault">
+ <complexType>
+ <sequence>
+ element name="message" minOccurs="1" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+
+ <wsdl:message name="stockQuoteOfferRequest">
+ <wsdl:part element="tns:stockQuoteOffer" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="stockQuoteOfferResponse">
+ <wsdl:part element="tns:stockQuoteOfferResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="InvalidSymbolFault">
+ <wsdl:part element="tns:InvalidSymbolFault" name="fault" />
+ </wsdl:message>
+
+ <wsdl:message name="MarketClosedFault">
+ <wsdl:part element="tns:MarketClosedFault" name="fault" />
+ </wsdl:message>
+
+
+ <wsdl:portType name="StockExceptionTest">
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdl:input message="tns:stockQuoteOfferRequest" name="stockQuoteOfferRequest" />
+
+ <wsdl:output message="tns:stockQuoteOfferResponse" name="stockQuoteOfferResponse" />
+
+ <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException" />
+
+ <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
+
+ </wsdl:operation>
+
+
+ </wsdl:portType>
+
+ <wsdl:binding name="StockExceptionTestServiceSoapBinding" type="tns:StockExceptionTest">
+ <!-- <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> -->
+
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdlsoap:operation soapAction="" />
+
+ <wsdl:input name="stockQuoteOfferRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+
+ <wsdl:output name="stockQuoteOfferResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+
+ <wsdl:fault name="InvalidSymbolException">
+ <wsdlsoap:fault use="literal" />
+ </wsdl:fault>
+
+ <wsdl:fault name="MarketClosedException">
+ <wsdlsoap:fault use="literal" />
+ </wsdl:fault>
+
+ </wsdl:operation>
+
+
+ </wsdl:binding>
+
+ <wsdl:service name="StockExceptionTestService">
+ <wsdl:port binding="tns:StockExceptionTestServiceSoapBinding" name="StockExceptionTestServiceSoapPort">
+ <wsdlsoap:address location="http://localhost:8080/StockExceptionTestService/services/StockExceptionTestService" />
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
Added: incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestClient.java?view=auto&rev=503748
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestClient.java (added)
+++ incubator/tuscany/java/testing/sca/itest/exceptionTestsWSClient/src/test/java/org/apache/tuscany/sca/itest/exceptionsws/StockExceptionTestClient.java Mon Feb 5 08:04:53 2007
@@ -0,0 +1,96 @@
+/*
+ * 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.sca.itest.exceptionsws;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class StockExceptionTestClient extends TestCase {
+ private StockExceptionTest stockExceptionTest;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ CompositeContext currentCompositeContext = CurrentCompositeContext.getContext();
+ assertNotNull(currentCompositeContext);
+ System.out.println("Composite Name = " + currentCompositeContext.getName());
+ System.out.println(CurrentCompositeContext.getContext());
+ stockExceptionTest =
+ CurrentCompositeContext.getContext().locateService(StockExceptionTest.class,
+ "StockExceptionTestClientComponent");
+ assertNotNull(stockExceptionTest);
+ }
+
+ public void testALL() {
+
+ StockOffer offer = new StockOffer();
+ offer.setSymbol("IBM");
+ offer.setName("International Business Machines");
+ offer.setPrice(100.0F);
+ StockOffer resp = null;
+ try {
+ resp = stockExceptionTest.stockQuoteOffer(offer );
+ assertNotNull(resp);
+ } catch (InvalidSymbolException e) {
+ e.printStackTrace();
+ throw new AssertionFailedError("Should NOT have received " +e.getClass().getName());
+ } catch (MarketClosedException e) {
+ e.printStackTrace();
+ throw new AssertionFailedError("Should NOT have received " +e.getClass().getName());
+ }
+
+ offer = new StockOffer();
+ offer.setSymbol("*");
+ offer.setName("Bad Symbol");
+ offer.setPrice(1.0F);
+
+ resp = null;
+ try {
+ resp = stockExceptionTest.stockQuoteOffer(offer );
+ throw new AssertionFailedError("Should receive InvalidSymbolException");
+ } catch (InvalidSymbolException e) {
+ assertNull(resp);
+ } catch (MarketClosedException e) {
+ e.printStackTrace();
+ throw new AssertionFailedError("Should receive InvalidSymbolException");
+ }
+
+ offer = new StockOffer();
+ offer.setSymbol("ORG");
+ offer.setName("CLOSED");
+ offer.setPrice(1.0F);
+
+ resp = null;
+ try {
+ resp = stockExceptionTest.stockQuoteOffer(offer );
+ throw new AssertionFailedError("Should receive MarketClosedException");
+ } catch (InvalidSymbolException e) {
+ e.printStackTrace();
+ throw new AssertionFailedError("Should receive MarketClosedException");
+ } catch (MarketClosedException e) {
+ assertNull(resp);
+ }
+
+ }
+
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org