tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r577067 - in /incubator/tuscany/branches/sca-java-1.0: modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/ samples/quote-xquery/ samples/quote-xquery/src/main/java/xquery/quote/ samples/quote-xquery/src/test/java...
Date Tue, 18 Sep 2007 21:10:04 GMT
Author: rfeng
Date: Tue Sep 18 14:10:03 2007
New Revision: 577067

URL: http://svn.apache.org/viewvc?rev=577067&view=rev
Log:
Fix for TUSCANY-1752

Added:
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/QuoteDataUtil.java
      - copied, changed from r576974, incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/TestHelper.java
Removed:
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/TestHelper.java
Modified:
    incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
    incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/README
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/build.xml
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/AvailQuoteProviderImpl.java
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/PriceQuoteProviderImpl.java
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteClient.java
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteServer.java
    incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java

Modified: incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java Tue Sep 18 14:10:03 2007
@@ -19,6 +19,7 @@
 package org.apache.tuscany.sca.binding.ws.axis2;
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.List;
 
 import javax.wsdl.Binding;
@@ -45,15 +46,21 @@
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisEndpoint;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
+import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.tuscany.sca.assembly.AbstractContract;
 import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.DeployedArtifact;
 import org.apache.tuscany.sca.host.http.ServletHost;
 import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.XMLDocumentHelper;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.invocation.MessageFactory;
 import org.apache.tuscany.sca.policy.Intent;
@@ -62,6 +69,8 @@
 import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
 import org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.ws.commons.schema.resolver.URIResolver;
+import org.xml.sax.InputSource;
 
 public class Axis2ServiceClient {
 
@@ -97,13 +106,73 @@
             QName serviceQName = wsBinding.getServiceName();
             String portName = wsBinding.getPortName();
             AxisService axisService =
-                AxisService.createClientSideAxisService(wsdlDefinition, serviceQName, portName, new Options());
+                createClientSideAxisService(wsdlDefinition, serviceQName, portName, new Options());
 
             return new ServiceClient(configContext, axisService);
         } catch (AxisFault e) {
             throw new RuntimeException(e); // TODO: better exception
         }
     }
+    
+    /**
+     * URI resolver implementation for xml schema
+     */
+    public static class URIResolverImpl implements URIResolver {
+        private Definition definition;
+
+        public URIResolverImpl(Definition definition) {
+            this.definition = definition;
+        }
+
+        public org.xml.sax.InputSource resolveEntity(java.lang.String targetNamespace,
+                                                     java.lang.String schemaLocation,
+                                                     java.lang.String baseUri) {
+            try {
+                if (baseUri == null) {
+                    baseUri = definition.getDocumentBaseURI();
+                }
+                URL url = new URL(new URL(baseUri), schemaLocation);
+                return XMLDocumentHelper.getInputSource(url);
+            } catch (IOException e) {
+                return null;
+            }
+        }
+    }
+    
+    /**
+     * This method is copied from AxisService.createClientSideAxisService to
+     * work around http://issues.apache.org/jira/browse/WSCOMMONS-228
+     * 
+     * @param wsdlDefinition
+     * @param wsdlServiceName
+     * @param portName
+     * @param options
+     * @return
+     * @throws AxisFault
+     */
+    @Deprecated
+    public static AxisService createClientSideAxisService(Definition wsdlDefinition,
+                                                          QName wsdlServiceName,
+                                                          String portName,
+                                                          Options options) throws AxisFault {
+        WSDL11ToAxisServiceBuilder serviceBuilder =
+                new WSDL11ToAxisServiceBuilder(wsdlDefinition, wsdlServiceName, portName);
+        serviceBuilder.setServerSide(false);
+        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
+        serviceBuilder.setCustomResolver(new URIResolverImpl(wsdlDefinition));
+        serviceBuilder.setBaseUri(wsdlDefinition.getDocumentBaseURI());
+        // [rfeng]
+        AxisService axisService = serviceBuilder.populateService();
+        AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoints()
+                .get(axisService.getEndpointName());
+        options.setTo(new EndpointReference(axisEndpoint.getEndpointURL()));
+        if (axisEndpoint != null) {
+            options.setSoapVersionURI((String) axisEndpoint.getBinding()
+                    .getProperty(WSDL2Constants.ATTR_WSOAP_VERSION));
+        }
+        return axisService;
+    }
+
 
     /**
      * Ensure the WSDL definition contains a suitable service and port

Modified: incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java Tue Sep 18 14:10:03 2007
@@ -66,6 +66,7 @@
 import org.apache.tuscany.sca.assembly.AbstractContract;
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceClient.URIResolverImpl;
 import org.apache.tuscany.sca.core.assembly.EndpointReferenceImpl;
 import org.apache.tuscany.sca.host.http.ServletHost;
 import org.apache.tuscany.sca.interfacedef.Interface;
@@ -330,11 +331,15 @@
 
         WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(definition, serviceQName, portName);
         builder.setServerSide(true);
+        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
+        builder.setCustomResolver(new URIResolverImpl(definition));
+        builder.setBaseUri(definition.getDocumentBaseURI());
+        // [rfeng]
         AxisService axisService = builder.populateService();
 
         String path = URI.create(wsBinding.getURI()).getPath();
         axisService.setName(path);
-        axisService.setServiceDescription("Tuscany configured AxisService for service: " + wsBinding.getURI());
+        axisService.setDocumentation("Tuscany configured AxisService for service: " + wsBinding.getURI());
 
         // Use the existing WSDL
         Parameter wsdlParam = new Parameter(WSDLConstants.WSDL_4_J_DEFINITION, null);

Modified: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/README?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/README (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/README Tue Sep 18 14:10:03 2007
@@ -25,231 +25,444 @@
 The sample when run should simply display on the standard output some startup messages followed by:
 
 The service side:
-Sep 18, 2007 12:28:57 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
-INFO: Added Servlet mapping: http://localhost:8085/QuoteJoinService
-Sep 18, 2007 12:28:57 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
-INFO: Added Servlet mapping: http://localhost:8085/AvailQuoteProviderService
-XQuery Quote server started (press enter to shutdown)
+Buildfile: build.xml
+
+init:
+
+generate-sdo:
+     [java] >>  Generating code
+     [java] >>  Generating packages
+     [java] >>  Generating package QuotePackageImpl
+     [java] >>  Generating Java interface org.example.quote.QuoteFactory
+     [java] >>  Generating /TargetProject/org/example/quote/QuoteFactory.java
+     [java] >>  Examining old /TargetProject/org/example/quote/QuoteFactory.java
+     [java] >>  Generating Java class org.example.quote.impl.QuoteFactoryImpl
+     [java] >>  Generating /TargetProject/org/example/quote/impl/QuoteFactoryImpl.java
+     [java] >>  Examining old /TargetProject/org/example/quote/impl/QuoteFactoryImpl.java
+     [java] >>  Generating Quote
+     [java] >>  Generating Java interface org.example.quote.Quote
+     [java] >>  Generating /TargetProject/org/example/quote/Quote.java
+     [java] >>  Examining old /TargetProject/org/example/quote/Quote.java
+     [java] >>  Generating Java class org.example.quote.impl.QuoteImpl
+     [java] >>  Generating /TargetProject/org/example/quote/impl/QuoteImpl.java
+     [java] >>  Examining old /TargetProject/org/example/quote/impl/QuoteImpl.java
+     [java] >>  Generating Response
+     [java] >>  Generating Java interface org.example.quote.QuoteResponse
+     [java] >>  Generating /TargetProject/org/example/quote/QuoteResponse.java
+     [java] >>  Examining old /TargetProject/org/example/quote/QuoteResponse.java
+     [java] >>  Generating Java class org.example.quote.impl.QuoteResponseImpl
+     [java] >>  Generating /TargetProject/org/example/quote/impl/QuoteResponseImpl.java
+     [java] >>  Examining old /TargetProject/org/example/quote/impl/QuoteResponseImpl.java
+     [java] >>  Generating code
+     [java] >>  Generating packages
+     [java] >>  Generating package AvailPackageImpl
+     [java] >>  Generating Java interface org.example.avail.AvailFactory
+     [java] >>  Generating /TargetProject/org/example/avail/AvailFactory.java
+     [java] >>  Examining old /TargetProject/org/example/avail/AvailFactory.java
+     [java] >>  Generating Java class org.example.avail.impl.AvailFactoryImpl
+     [java] >>  Generating /TargetProject/org/example/avail/impl/AvailFactoryImpl.java
+     [java] >>  Examining old /TargetProject/org/example/avail/impl/AvailFactoryImpl.java
+     [java] >>  Generating Quote
+     [java] >>  Generating Java interface org.example.avail.AvailQuote
+     [java] >>  Generating /TargetProject/org/example/avail/AvailQuote.java
+     [java] >>  Examining old /TargetProject/org/example/avail/AvailQuote.java
+     [java] >>  Generating Java class org.example.avail.impl.AvailQuoteImpl
+     [java] >>  Generating /TargetProject/org/example/avail/impl/AvailQuoteImpl.java
+     [java] >>  Examining old /TargetProject/org/example/avail/impl/AvailQuoteImpl.java
+     [java] >>  Generating Request
+     [java] >>  Generating Java interface org.example.avail.AvailRequest
+     [java] >>  Generating /TargetProject/org/example/avail/AvailRequest.java
+     [java] >>  Examining old /TargetProject/org/example/avail/AvailRequest.java
+     [java] >>  Generating Java class org.example.avail.impl.AvailRequestImpl
+     [java] >>  Generating /TargetProject/org/example/avail/impl/AvailRequestImpl.java
+     [java] >>  Examining old /TargetProject/org/example/avail/impl/AvailRequestImpl.java
+     [java] >>  Generating code
+     [java] >>  Generating packages
+     [java] >>  Generating package PricePackageImpl
+     [java] >>  Generating Java interface org.example.price.PriceFactory
+     [java] >>  Generating /TargetProject/org/example/price/PriceFactory.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceFactory.java
+     [java] >>  Generating Java class org.example.price.impl.PriceFactoryImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceFactoryImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceFactoryImpl.java
+     [java] >>  Generating Quote
+     [java] >>  Generating Java interface org.example.price.PriceQuote
+     [java] >>  Generating /TargetProject/org/example/price/PriceQuote.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceQuote.java
+     [java] >>  Generating Java class org.example.price.impl.PriceQuoteImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceQuoteImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceQuoteImpl.java
+     [java] >>  Generating Request
+     [java] >>  Generating Java interface org.example.price.PriceRequest
+     [java] >>  Generating /TargetProject/org/example/price/PriceRequest.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceRequest.java
+     [java] >>  Generating Java class org.example.price.impl.PriceRequestImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceRequestImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceRequestImpl.java
+     [java] >>  Generating Requests
+     [java] >>  Generating Java interface org.example.price.PriceRequests
+     [java] >>  Generating /TargetProject/org/example/price/PriceRequests.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceRequests.java
+     [java] >>  Generating Java class org.example.price.impl.PriceRequestsImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceRequestsImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceRequestsImpl.java
+     [java] >>  Generating Ship Address
+     [java] >>  Generating Java interface org.example.price.ShipAddress
+     [java] >>  Generating /TargetProject/org/example/price/ShipAddress.java
+     [java] >>  Examining old /TargetProject/org/example/price/ShipAddress.java
+     [java] >>  Generating Java class org.example.price.impl.ShipAddressImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/ShipAddressImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/ShipAddressImpl.java
+
+compile:
+      [jar] Building jar: C:\Apache\tuscany-sca-1.0-incubating-SNAPSHOT\samples\quote-xquery\target\sample-quote-xquery.jar
+
+run-server:
+     [java] Sep 18, 2007 1:14:16 PM org.apache.catalina.core.StandardEngine start
+     [java] INFO: Starting Servlet Engine: Apache Tomcat/6.0.10
+     [java] Sep 18, 2007 1:14:16 PM org.apache.catalina.startup.ContextConfig defaultWebConfig
+     [java] INFO: No default web.xml
+     [java] Sep 18, 2007 1:14:16 PM org.apache.catalina.startup.DigesterFactory register
+     [java] WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0.xsd
+     [java] Sep 18, 2007 1:14:16 PM org.apache.catalina.startup.DigesterFactory register
+     [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd
+     [java] Sep 18, 2007 1:14:16 PM org.apache.catalina.startup.DigesterFactory register
+     [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd
+     [java] Sep 18, 2007 1:14:16 PM org.apache.catalina.startup.DigesterFactory register
+     [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd
+     [java] Sep 18, 2007 1:14:16 PM org.apache.catalina.startup.DigesterFactory register
+     [java] WARNING: Could not get url for /javax/servlet/resources/j2ee_web_services_1_1.xsd
+     [java] Sep 18, 2007 1:14:17 PM org.apache.coyote.http11.Http11Protocol init
+     [java] INFO: Initializing Coyote HTTP/1.1 on http-8085
+     [java] Sep 18, 2007 1:14:17 PM org.apache.coyote.http11.Http11Protocol start
+     [java] INFO: Starting Coyote HTTP/1.1 on http-8085
+     [java] Sep 18, 2007 1:14:17 PM org.apache.tuscany.sca.http.tomcat.TomcatServer addServletMapping
+     [java] INFO: Added Servlet mapping: http://localhost:8085/QuoteJoinService
+     [java] Sep 18, 2007 1:14:17 PM org.apache.tuscany.sca.http.tomcat.TomcatServer addServletMapping
+     [java] INFO: Added Servlet mapping: http://localhost:8085/AvailQuoteProviderService
+     [java] XQuery Quote server started (press enter to shutdown)
+     [java] Sep 18, 2007 1:16:54 PM org.apache.coyote.http11.Http11Protocol destroy
+     [java] INFO: Stopping Coyote HTTP/1.1 on http-8085
+
+BUILD SUCCESSFUL
+Total time: 2 minutes 51 seconds
+
 
 The client side:
-Input quote for the price list:
-<?xml version="1.0" encoding="ASCII"?>
-<priceQuote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pri="http://www.example.org/price" xsi:type="pri:PriceQuote">
-  <customerName>Acme Inc</customerName>
-  <shipAddress street="12 Springs Rd" city="Morris Plains" state="nj" zip="07960"/>
-  <priceRequests>
-    <priceRequest>
-      <widgetId>12</widgetId>
-      <price>1.0</price>
-    </priceRequest>
-    <priceRequest>
-      <widgetId>134</widgetId>
-      <price>34.1</price>
-    </priceRequest>
-    <priceRequest>
-      <widgetId>211</widgetId>
-      <price>10.0</price>
-    </priceRequest>
-  </priceRequests>
-</priceQuote>
-
-Input quote for the availability:
-<?xml version="1.0" encoding="ASCII"?>
-<availQuote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ava="http://www.example.org/avail" xsi:type="ava:AvailQuote">
-  <availRequest>
-    <widgetId>12</widgetId>
-    <requestedQuantity>10</requestedQuantity>
-    <quantityAvail>true</quantityAvail>
-    <shipDate>2003-03-22</shipDate>
-  </availRequest>
-  <availRequest>
-    <widgetId>134</widgetId>
-    <requestedQuantity>345</requestedQuantity>
-    <quantityAvail>false</quantityAvail>
-    <shipDate>BackOrder</shipDate>
-  </availRequest>
-  <availRequest>
-    <widgetId>211</widgetId>
-    <requestedQuantity>100</requestedQuantity>
-    <quantityAvail>true</quantityAvail>
-    <shipDate>2003-04-21</shipDate>
-  </availRequest>
-</availQuote>
-
-
-Output quote from local join:
-<?xml version="1.0" encoding="ASCII"?>
-<quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
-  <name>Acme Inc</name>
-  <address>12 Springs Rd,Morris Plains,NJ,07960</address>
-  <quoteResponse>
-    <widgetId>12</widgetId>
-    <unitPrice>1.0</unitPrice>
-    <requestedQuantity>10</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-03-22</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>11.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>134</widgetId>
-    <unitPrice>34.1</unitPrice>
-    <requestedQuantity>345</requestedQuantity>
-    <fillOrder>false</fillOrder>
-    <shipDate>BackOrder</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>0.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>211</widgetId>
-    <unitPrice>10.0</unitPrice>
-    <requestedQuantity>100</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-04-21</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>1100.0</totalCost>
-  </quoteResponse>
-</quote>
-
-
-Output quote from local join (second invokation):
-<?xml version="1.0" encoding="ASCII"?>
-<quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
-  <name>Acme Inc</name>
-  <address>12 Springs Rd,Morris Plains,NJ,07960</address>
-  <quoteResponse>
-    <widgetId>12</widgetId>
-    <unitPrice>1.0</unitPrice>
-    <requestedQuantity>10</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-03-22</shipDate>
-    <taxRate>0.2</taxRate>
-    <totalCost>12.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>134</widgetId>
-    <unitPrice>34.1</unitPrice>
-    <requestedQuantity>345</requestedQuantity>
-    <fillOrder>false</fillOrder>
-    <shipDate>BackOrder</shipDate>
-    <taxRate>0.2</taxRate>
-    <totalCost>0.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>211</widgetId>
-    <unitPrice>10.0</unitPrice>
-    <requestedQuantity>100</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-04-21</shipDate>
-    <taxRate>0.2</taxRate>
-    <totalCost>1200.0</totalCost>
-  </quoteResponse>
-</quote>
-
-
-Output quote from web service join:
-<?xml version="1.0" encoding="ASCII"?>
-<quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
-  <name>Acme Inc</name>
-  <address>12 Springs Rd,Morris Plains,NJ,07960</address>
-  <quoteResponse>
-    <widgetId>12</widgetId>
-    <unitPrice>1.0</unitPrice>
-    <requestedQuantity>10</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-03-22</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>11.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>134</widgetId>
-    <unitPrice>34.1</unitPrice>
-    <requestedQuantity>345</requestedQuantity>
-    <fillOrder>false</fillOrder>
-    <shipDate>BackOrder</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>0.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>211</widgetId>
-    <unitPrice>10.0</unitPrice>
-    <requestedQuantity>100</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-04-21</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>1100.0</totalCost>
-  </quoteResponse>
-</quote>
-
-
-Output quote from properties join:
-<?xml version="1.0" encoding="ASCII"?>
-<quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
-  <name>Acme Inc</name>
-  <address>12 Springs Rd,Morris Plains,NJ,07960</address>
-  <quoteResponse>
-    <widgetId>12</widgetId>
-    <unitPrice>1.0</unitPrice>
-    <requestedQuantity>10</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-03-22</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>11.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>134</widgetId>
-    <unitPrice>34.1</unitPrice>
-    <requestedQuantity>345</requestedQuantity>
-    <fillOrder>false</fillOrder>
-    <shipDate>BackOrder</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>0.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>211</widgetId>
-    <unitPrice>10.0</unitPrice>
-    <requestedQuantity>100</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-04-21</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>1100.0</totalCost>
-  </quoteResponse>
-</quote>
-
-
-Output quote from external references join:
-<?xml version="1.0" encoding="ASCII"?>
-<quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
-  <name>Acme Inc</name>
-  <address>12 Springs Rd,Morris Plains,NJ,07960</address>
-  <quoteResponse>
-    <widgetId>12</widgetId>
-    <unitPrice>1.0</unitPrice>
-    <requestedQuantity>10</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-03-22</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>11.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>134</widgetId>
-    <unitPrice>34.1</unitPrice>
-    <requestedQuantity>345</requestedQuantity>
-    <fillOrder>false</fillOrder>
-    <shipDate>BackOrder</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>0.0</totalCost>
-  </quoteResponse>
-  <quoteResponse>
-    <widgetId>211</widgetId>
-    <unitPrice>10.0</unitPrice>
-    <requestedQuantity>100</requestedQuantity>
-    <fillOrder>true</fillOrder>
-    <shipDate>2003-04-21</shipDate>
-    <taxRate>0.1</taxRate>
-    <totalCost>1100.0</totalCost>
-  </quoteResponse>
-</quote>
+Buildfile: build.xml
+
+init:
+
+generate-sdo:
+     [java] >>  Generating code
+     [java] >>  Generating packages
+     [java] >>  Generating package QuotePackageImpl
+     [java] >>  Generating Java interface org.example.quote.QuoteFactory
+     [java] >>  Generating /TargetProject/org/example/quote/QuoteFactory.java
+     [java] >>  Examining old /TargetProject/org/example/quote/QuoteFactory.java
+     [java] >>  Generating Java class org.example.quote.impl.QuoteFactoryImpl
+     [java] >>  Generating /TargetProject/org/example/quote/impl/QuoteFactoryImpl.java
+     [java] >>  Examining old /TargetProject/org/example/quote/impl/QuoteFactoryImpl.java
+     [java] >>  Generating Quote
+     [java] >>  Generating Java interface org.example.quote.Quote
+     [java] >>  Generating /TargetProject/org/example/quote/Quote.java
+     [java] >>  Examining old /TargetProject/org/example/quote/Quote.java
+     [java] >>  Generating Java class org.example.quote.impl.QuoteImpl
+     [java] >>  Generating /TargetProject/org/example/quote/impl/QuoteImpl.java
+     [java] >>  Examining old /TargetProject/org/example/quote/impl/QuoteImpl.java
+     [java] >>  Generating Response
+     [java] >>  Generating Java interface org.example.quote.QuoteResponse
+     [java] >>  Generating /TargetProject/org/example/quote/QuoteResponse.java
+     [java] >>  Examining old /TargetProject/org/example/quote/QuoteResponse.java
+     [java] >>  Generating Java class org.example.quote.impl.QuoteResponseImpl
+     [java] >>  Generating /TargetProject/org/example/quote/impl/QuoteResponseImpl.java
+     [java] >>  Examining old /TargetProject/org/example/quote/impl/QuoteResponseImpl.java
+     [java] >>  Generating code
+     [java] >>  Generating packages
+     [java] >>  Generating package AvailPackageImpl
+     [java] >>  Generating Java interface org.example.avail.AvailFactory
+     [java] >>  Generating /TargetProject/org/example/avail/AvailFactory.java
+     [java] >>  Examining old /TargetProject/org/example/avail/AvailFactory.java
+     [java] >>  Generating Java class org.example.avail.impl.AvailFactoryImpl
+     [java] >>  Generating /TargetProject/org/example/avail/impl/AvailFactoryImpl.java
+     [java] >>  Examining old /TargetProject/org/example/avail/impl/AvailFactoryImpl.java
+     [java] >>  Generating Quote
+     [java] >>  Generating Java interface org.example.avail.AvailQuote
+     [java] >>  Generating /TargetProject/org/example/avail/AvailQuote.java
+     [java] >>  Examining old /TargetProject/org/example/avail/AvailQuote.java
+     [java] >>  Generating Java class org.example.avail.impl.AvailQuoteImpl
+     [java] >>  Generating /TargetProject/org/example/avail/impl/AvailQuoteImpl.java
+     [java] >>  Examining old /TargetProject/org/example/avail/impl/AvailQuoteImpl.java
+     [java] >>  Generating Request
+     [java] >>  Generating Java interface org.example.avail.AvailRequest
+     [java] >>  Generating /TargetProject/org/example/avail/AvailRequest.java
+     [java] >>  Examining old /TargetProject/org/example/avail/AvailRequest.java
+     [java] >>  Generating Java class org.example.avail.impl.AvailRequestImpl
+     [java] >>  Generating /TargetProject/org/example/avail/impl/AvailRequestImpl.java
+     [java] >>  Examining old /TargetProject/org/example/avail/impl/AvailRequestImpl.java
+     [java] >>  Generating code
+     [java] >>  Generating packages
+     [java] >>  Generating package PricePackageImpl
+     [java] >>  Generating Java interface org.example.price.PriceFactory
+     [java] >>  Generating /TargetProject/org/example/price/PriceFactory.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceFactory.java
+     [java] >>  Generating Java class org.example.price.impl.PriceFactoryImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceFactoryImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceFactoryImpl.java
+     [java] >>  Generating Quote
+     [java] >>  Generating Java interface org.example.price.PriceQuote
+     [java] >>  Generating /TargetProject/org/example/price/PriceQuote.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceQuote.java
+     [java] >>  Generating Java class org.example.price.impl.PriceQuoteImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceQuoteImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceQuoteImpl.java
+     [java] >>  Generating Request
+     [java] >>  Generating Java interface org.example.price.PriceRequest
+     [java] >>  Generating /TargetProject/org/example/price/PriceRequest.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceRequest.java
+     [java] >>  Generating Java class org.example.price.impl.PriceRequestImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceRequestImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceRequestImpl.java
+     [java] >>  Generating Requests
+     [java] >>  Generating Java interface org.example.price.PriceRequests
+     [java] >>  Generating /TargetProject/org/example/price/PriceRequests.java
+     [java] >>  Examining old /TargetProject/org/example/price/PriceRequests.java
+     [java] >>  Generating Java class org.example.price.impl.PriceRequestsImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/PriceRequestsImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/PriceRequestsImpl.java
+     [java] >>  Generating Ship Address
+     [java] >>  Generating Java interface org.example.price.ShipAddress
+     [java] >>  Generating /TargetProject/org/example/price/ShipAddress.java
+     [java] >>  Examining old /TargetProject/org/example/price/ShipAddress.java
+     [java] >>  Generating Java class org.example.price.impl.ShipAddressImpl
+     [java] >>  Generating /TargetProject/org/example/price/impl/ShipAddressImpl.java
+     [java] >>  Examining old /TargetProject/org/example/price/impl/ShipAddressImpl.java
+
+compile:
+
+run:
+     [java] Input quote for the price list:
+     [java] <?xml version="1.0" encoding="ASCII"?>
+     [java] <priceQuote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pri="http://www.example.org/price" xsi:type="pri:PriceQuote">
+     [java]   <customerName>Acme Inc</customerName>
+     [java]   <shipAddress street="12 Springs Rd" city="Morris Plains" state="nj" zip="07960"/>
+     [java]   <priceRequests>
+     [java]     <priceRequest>
+     [java]       <widgetId>12</widgetId>
+     [java]       <price>1.0</price>
+     [java]     </priceRequest>
+     [java]     <priceRequest>
+     [java]       <widgetId>134</widgetId>
+     [java]       <price>34.1</price>
+     [java]     </priceRequest>
+     [java]     <priceRequest>
+     [java]       <widgetId>211</widgetId>
+     [java]       <price>10.0</price>
+     [java]     </priceRequest>
+     [java]   </priceRequests>
+     [java] </priceQuote>
+     [java] 
+     [java] Input quote for the availability:
+     [java] <?xml version="1.0" encoding="ASCII"?>
+     [java] <availQuote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ava="http://www.example.org/avail" xsi:type="ava:AvailQuote">
+     [java]   <availRequest>
+     [java]     <widgetId>12</widgetId>
+     [java]     <requestedQuantity>10</requestedQuantity>
+     [java]     <quantityAvail>true</quantityAvail>
+     [java]     <shipDate>2003-03-22</shipDate>
+     [java]   </availRequest>
+     [java]   <availRequest>
+     [java]     <widgetId>134</widgetId>
+     [java]     <requestedQuantity>345</requestedQuantity>
+     [java]     <quantityAvail>false</quantityAvail>
+     [java]     <shipDate>BackOrder</shipDate>
+     [java]   </availRequest>
+     [java]   <availRequest>
+     [java]     <widgetId>211</widgetId>
+     [java]     <requestedQuantity>100</requestedQuantity>
+     [java]     <quantityAvail>true</quantityAvail>
+     [java]     <shipDate>2003-04-21</shipDate>
+     [java]   </availRequest>
+     [java] </availQuote>
+     [java] 
+     [java] 
+     [java] Output quote from local join:
+     [java] <?xml version="1.0" encoding="ASCII"?>
+     [java] <quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
+     [java]   <name>Acme Inc</name>
+     [java]   <address>12 Springs Rd,Morris Plains,NJ,07960</address>
+     [java]   <quoteResponse>
+     [java]     <widgetId>12</widgetId>
+     [java]     <unitPrice>1.0</unitPrice>
+     [java]     <requestedQuantity>10</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-03-22</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>11.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>134</widgetId>
+     [java]     <unitPrice>34.1</unitPrice>
+     [java]     <requestedQuantity>345</requestedQuantity>
+     [java]     <fillOrder>false</fillOrder>
+     [java]     <shipDate>BackOrder</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>0.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>211</widgetId>
+     [java]     <unitPrice>10.0</unitPrice>
+     [java]     <requestedQuantity>100</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-04-21</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>1100.0</totalCost>
+     [java]   </quoteResponse>
+     [java] </quote>
+     [java] 
+     [java] 
+     [java] Output quote from local join (second invokation):
+     [java] <?xml version="1.0" encoding="ASCII"?>
+     [java] <quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
+     [java]   <name>Acme Inc</name>
+     [java]   <address>12 Springs Rd,Morris Plains,NJ,07960</address>
+     [java]   <quoteResponse>
+     [java]     <widgetId>12</widgetId>
+     [java]     <unitPrice>1.0</unitPrice>
+     [java]     <requestedQuantity>10</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-03-22</shipDate>
+     [java]     <taxRate>0.2</taxRate>
+     [java]     <totalCost>12.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>134</widgetId>
+     [java]     <unitPrice>34.1</unitPrice>
+     [java]     <requestedQuantity>345</requestedQuantity>
+     [java]     <fillOrder>false</fillOrder>
+     [java]     <shipDate>BackOrder</shipDate>
+     [java]     <taxRate>0.2</taxRate>
+     [java]     <totalCost>0.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>211</widgetId>
+     [java]     <unitPrice>10.0</unitPrice>
+     [java]     <requestedQuantity>100</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-04-21</shipDate>
+     [java]     <taxRate>0.2</taxRate>
+     [java]     <totalCost>1200.0</totalCost>
+     [java]   </quoteResponse>
+     [java] </quote>
+     [java] 
+     [java] 
+     [java] Output quote from web service join:
+     [java] <?xml version="1.0" encoding="ASCII"?>
+     [java] <quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
+     [java]   <name>Acme Inc</name>
+     [java]   <address>12 Springs Rd,Morris Plains,NJ,07960</address>
+     [java]   <quoteResponse>
+     [java]     <widgetId>12</widgetId>
+     [java]     <unitPrice>1.0</unitPrice>
+     [java]     <requestedQuantity>10</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-03-22</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>11.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>134</widgetId>
+     [java]     <unitPrice>34.1</unitPrice>
+     [java]     <requestedQuantity>345</requestedQuantity>
+     [java]     <fillOrder>false</fillOrder>
+     [java]     <shipDate>BackOrder</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>0.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>211</widgetId>
+     [java]     <unitPrice>10.0</unitPrice>
+     [java]     <requestedQuantity>100</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-04-21</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>1100.0</totalCost>
+     [java]   </quoteResponse>
+     [java] </quote>
+     [java] 
+     [java] 
+     [java] Output quote from properties join:
+     [java] <?xml version="1.0" encoding="ASCII"?>
+     [java] <quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
+     [java]   <name>Acme Inc</name>
+     [java]   <address>12 Springs Rd,Morris Plains,NJ,07960</address>
+     [java]   <quoteResponse>
+     [java]     <widgetId>12</widgetId>
+     [java]     <unitPrice>1.0</unitPrice>
+     [java]     <requestedQuantity>10</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-03-22</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>11.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>134</widgetId>
+     [java]     <unitPrice>34.1</unitPrice>
+     [java]     <requestedQuantity>345</requestedQuantity>
+     [java]     <fillOrder>false</fillOrder>
+     [java]     <shipDate>BackOrder</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>0.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>211</widgetId>
+     [java]     <unitPrice>10.0</unitPrice>
+     [java]     <requestedQuantity>100</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-04-21</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>1100.0</totalCost>
+     [java]   </quoteResponse>
+     [java] </quote>
+     [java] 
+     [java] 
+     [java] Output quote from external references join:
+     [java] <?xml version="1.0" encoding="ASCII"?>
+     [java] <quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:quo="http://www.example.org/quote" xsi:type="quo:Quote">
+     [java]   <name>Acme Inc</name>
+     [java]   <address>12 Springs Rd,Morris Plains,NJ,07960</address>
+     [java]   <quoteResponse>
+     [java]     <widgetId>12</widgetId>
+     [java]     <unitPrice>1.0</unitPrice>
+     [java]     <requestedQuantity>10</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-03-22</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>11.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>134</widgetId>
+     [java]     <unitPrice>34.1</unitPrice>
+     [java]     <requestedQuantity>345</requestedQuantity>
+     [java]     <fillOrder>false</fillOrder>
+     [java]     <shipDate>BackOrder</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>0.0</totalCost>
+     [java]   </quoteResponse>
+     [java]   <quoteResponse>
+     [java]     <widgetId>211</widgetId>
+     [java]     <unitPrice>10.0</unitPrice>
+     [java]     <requestedQuantity>100</requestedQuantity>
+     [java]     <fillOrder>true</fillOrder>
+     [java]     <shipDate>2003-04-21</shipDate>
+     [java]     <taxRate>0.1</taxRate>
+     [java]     <totalCost>1100.0</totalCost>
+     [java]   </quoteResponse>
+     [java] </quote>
+     [java] 
+
+BUILD SUCCESSFUL
+Total time: 16 seconds
 
 
 

Modified: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/build.xml?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/build.xml (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/build.xml Tue Sep 18 14:10:03 2007
@@ -25,11 +25,52 @@
 		<mkdir dir="target/classes" />
 	</target>
 
-	<target name="compile" depends="init">
+	<property name="tuscany.sca.manifest.location" value="../../lib/tuscany-sca-manifest.jar" />
+
+	<path id="project.classpath">
+		<pathelement path="target/classes" />
+		<pathelement path="target/sdo-source" />
+		<pathelement location="${tuscany.sca.manifest.location}" />
+	</path>
+
+	<target name="generate-sdo" depends="init">
+		<java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="true">
+			<arg value="-targetDirectory" />
+			<arg value="target/sdo-source" />
+			<arg value="-noNotification" />
+			<arg value="-noContainment" />
+			<arg value="-noUnsettable" />
+			<arg value="src/main/resources/wsdl/Quote.xsd" />
+
+			<classpath refid="project.classpath" />
+		</java>
+		<java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="true">
+			<arg value="-targetDirectory" />
+			<arg value="target/sdo-source" />
+			<arg value="-noNotification" />
+			<arg value="-noContainment" />
+			<arg value="-noUnsettable" />
+			<arg value="src/main/resources/wsdl/AvailQuote.xsd" />
+
+			<classpath refid="project.classpath" />
+		</java>
+		<java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="true">
+			<arg value="-targetDirectory" />
+			<arg value="target/sdo-source" />
+			<arg value="-noNotification" />
+			<arg value="-noContainment" />
+			<arg value="-noUnsettable" />
+			<arg value="src/main/resources/wsdl/PriceQuote.xsd" />
+
+			<classpath refid="project.classpath" />
+		</java>
+
+	</target>
+
+
+	<target name="compile" depends="init, generate-sdo">
 		<javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5">
-			<classpath>
-				<pathelement location="../../lib/tuscany-sca-manifest.jar" />
-			</classpath>
+			<classpath refid="project.classpath" />
 		</javac>
 		<copy todir="target/classes">
 			<fileset dir="src/main/resources" />
@@ -46,8 +87,8 @@
 		<java classname="${test.class}" fork="true">
 			<classpath>
 				<pathelement path="target/classes" />
-				<pathelement location="../../lib/tuscany-sca-manifest.jar" />
 			</classpath>
+			<classpath refid="project.classpath" />
 		</java>
 	</target>
 
@@ -55,20 +96,20 @@
 		<java classname="${test.class}" fork="true">
 			<classpath>
 				<pathelement path="target/${test.jar}" />
-				<pathelement location="../../lib/tuscany-sca-manifest.jar" />
 			</classpath>
+			<classpath refid="project.classpath" />
+		</java>
+	</target>
+
+	<target name="run-server" depends="compile">
+		<java classname="${test.server.class}" fork="true">
+			<classpath>
+				<pathelement path="target/${test.jar}" />
+			</classpath>
+			<classpath refid="project.classpath" />
 		</java>
 	</target>
-	
-    <target name="run-server" depends="compile">
-        <java classname="${test.server.class}" fork="true">
-            <classpath>
-                <pathelement path="target/${test.jar}" />
-                <pathelement location="../../lib/tuscany-sca-manifest.jar" />
-            </classpath>
-        </java>
-    </target>
-	
+
 	<target name="clean">
 		<delete quiet="true" includeemptydirs="true">
 			<fileset dir="target" />

Modified: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/AvailQuoteProviderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/AvailQuoteProviderImpl.java?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/AvailQuoteProviderImpl.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/AvailQuoteProviderImpl.java Tue Sep 18 14:10:03 2007
@@ -25,6 +25,6 @@
 public class AvailQuoteProviderImpl implements AvailQuoteProviderService {
 
     public AvailQuote provideAvailQuote(String dummyString) {
-        return TestHelper.buildAvailQuoteData();
+        return QuoteDataUtil.buildAvailQuoteData();
     }
 }

Modified: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/PriceQuoteProviderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/PriceQuoteProviderImpl.java?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/PriceQuoteProviderImpl.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/PriceQuoteProviderImpl.java Tue Sep 18 14:10:03 2007
@@ -22,6 +22,6 @@
 
 public class PriceQuoteProviderImpl implements PriceQuoteProvider {
     public PriceQuote providePriceQuote() {
-        return TestHelper.buildPriceQuoteData();
+        return QuoteDataUtil.buildPriceQuoteData();
     }
 }

Copied: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/QuoteDataUtil.java (from r576974, incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/TestHelper.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/QuoteDataUtil.java?p2=incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/QuoteDataUtil.java&p1=incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/TestHelper.java&r1=576974&r2=577067&rev=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/TestHelper.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/QuoteDataUtil.java Tue Sep 18 14:10:03 2007
@@ -20,9 +20,7 @@
 
 import java.io.IOException;
 import java.math.BigInteger;
-import java.util.List;
 
-import junit.framework.TestCase;
 
 import org.example.avail.AvailFactory;
 import org.example.avail.AvailQuote;
@@ -32,14 +30,11 @@
 import org.example.price.PriceRequest;
 import org.example.price.PriceRequests;
 import org.example.price.ShipAddress;
-import org.example.quote.Quote;
-import org.example.quote.QuoteResponse;
 
 import commonj.sdo.DataObject;
 import commonj.sdo.helper.XMLHelper;
-import commonj.sdo.impl.HelperProvider;
 
-public class TestHelper {
+public class QuoteDataUtil {
 
     public static AvailQuote buildAvailQuoteData() {
         AvailQuote availQuote = AvailFactory.INSTANCE.createAvailQuote();
@@ -99,53 +94,13 @@
         return priceQuote;
     }
 
-    public static void assertQuote(AvailQuote availQuote, PriceQuote priceQuote, Quote quote, float taxRate) {
-        QuoteCalculatorImpl quoteCalculatorImpl = new QuoteCalculatorImpl();
-
-        TestCase.assertEquals(priceQuote.getCustomerName(), quote.getName());
-        ShipAddress shipAddress = priceQuote.getShipAddress();
-        TestCase.assertEquals(shipAddress.getStreet() + ","
-            + shipAddress.getCity()
-            + ","
-            + shipAddress.getState().toUpperCase()
-            + ","
-            + shipAddress.getZip(), quote.getAddress());
-        List availRequests = availQuote.getAvailRequest();
-        List priceRequests = priceQuote.getPriceRequests().getPriceRequest();
-        List quoteResponses = quote.getQuoteResponse();
-        TestCase.assertEquals(availRequests.size(), priceRequests.size());
-        TestCase.assertEquals(availRequests.size(), quoteResponses.size());
-
-        for (int i = 0; i < availRequests.size(); i++) {
-            AvailRequest availRequest = (AvailRequest)availRequests.get(i);
-            PriceRequest priceRequest = (PriceRequest)priceRequests.get(i);
-            QuoteResponse quoteResponse = (QuoteResponse)quoteResponses.get(i);
-            TestCase.assertEquals(availRequest.getWidgetId(), quoteResponse.getWidgetId());
-            TestCase.assertEquals(priceRequest.getPrice(), quoteResponse.getUnitPrice());
-            TestCase.assertEquals(availRequest.getRequestedQuantity(), quoteResponse.getRequestedQuantity());
-            TestCase.assertEquals(availRequest.isQuantityAvail(), quoteResponse.isFillOrder());
-            if (availRequest.getShipDate() == null) {
-                TestCase.assertNull(quoteResponse.getShipDate());
-            } else {
-                TestCase.assertEquals(availRequest.getShipDate(), quoteResponse.getShipDate());
-            }
-            TestCase.assertEquals(taxRate, quoteResponse.getTaxRate());
-            TestCase.assertEquals(quoteCalculatorImpl.calculateTotalPrice(taxRate,
-                                                                          availRequest.getRequestedQuantity(),
-                                                                          priceRequest.getPrice(),
-                                                                          availRequest.isQuantityAvail()),
-                                  quoteResponse.getTotalCost());
-        }
-    }
-
     public static void serializeToSystemOut(DataObject object, String name) {
-        XMLHelper helper = HelperProvider.INSTANCE.xmlHelper();
+        XMLHelper helper = XMLHelper.INSTANCE;
 
         try {
             helper.save(object, null, name, System.out);
             System.out.println();
         } catch (IOException e) {
-            // TODO Auto-generated catch block
             e.printStackTrace();
         }
     }

Modified: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteClient.java?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteClient.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteClient.java Tue Sep 18 14:10:03 2007
@@ -68,15 +68,15 @@
     }
 
     public void testQuoteJoin() {
-        AvailQuote availQuote = TestHelper.buildAvailQuoteData();
-        PriceQuote priceQuote = TestHelper.buildPriceQuoteData();
+        AvailQuote availQuote = QuoteDataUtil.buildAvailQuoteData();
+        PriceQuote priceQuote = QuoteDataUtil.buildPriceQuoteData();
 
         if (SHOW_DEBUG_MSG) {
             System.out.println("Input quote for the price list:");
-            TestHelper.serializeToSystemOut((DataObject)priceQuote, "priceQuote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)priceQuote, "priceQuote");
             System.out.println();
             System.out.println("Input quote for the availability:");
-            TestHelper.serializeToSystemOut((DataObject)availQuote, "availQuote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)availQuote, "availQuote");
             System.out.println();
         }
 
@@ -84,7 +84,7 @@
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from local join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
         //        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);
@@ -93,7 +93,7 @@
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from local join (second invokation):");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
         //        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.2f);
@@ -102,7 +102,7 @@
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from web service join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
         //        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);
@@ -111,7 +111,7 @@
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from properties join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
         // TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);
@@ -120,7 +120,7 @@
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from external references join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
         // TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);

Modified: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteServer.java?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteServer.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/main/java/xquery/quote/XQueryQuoteServer.java Tue Sep 18 14:10:03 2007
@@ -27,11 +27,13 @@
     public static void main(String[] args) {
         SCADomain scaDomain = SCADomain.newInstance("xqueryquotews.composite");
         try {
-            System.out.println("XQuery Quote server started (press enter to shutdown)");
+            System.out.println("XQuery Quote server is started (press enter to shutdown).");
             System.in.read();
+            System.out.println("XQuery Quote server is stopping...");
         } catch (IOException e) {
             e.printStackTrace();
         }
         scaDomain.close();
+        System.out.println("XQuery Quote server is now stopped.");
     }
 }

Modified: incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java?rev=577067&r1=577066&r2=577067&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-1.0/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java Tue Sep 18 14:10:03 2007
@@ -18,11 +18,19 @@
  */
 package xquery.quote;
 
+import java.util.List;
+
+import junit.framework.TestCase;
+
 import org.apache.tuscany.sca.host.embedded.SCADomain;
 import org.apache.tuscany.sca.host.embedded.SCATestCaseRunner;
 import org.example.avail.AvailQuote;
+import org.example.avail.AvailRequest;
 import org.example.price.PriceQuote;
+import org.example.price.PriceRequest;
+import org.example.price.ShipAddress;
 import org.example.quote.Quote;
+import org.example.quote.QuoteResponse;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -79,15 +87,15 @@
 
     @Test
     public void testQuoteJoin() {
-        AvailQuote availQuote = TestHelper.buildAvailQuoteData();
-        PriceQuote priceQuote = TestHelper.buildPriceQuoteData();
+        AvailQuote availQuote = QuoteDataUtil.buildAvailQuoteData();
+        PriceQuote priceQuote = QuoteDataUtil.buildPriceQuoteData();
 
         if (SHOW_DEBUG_MSG) {
             System.out.println("Input quote for the price list:");
-            TestHelper.serializeToSystemOut((DataObject)priceQuote, "priceQuote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)priceQuote, "priceQuote");
             System.out.println();
             System.out.println("Input quote for the availability:");
-            TestHelper.serializeToSystemOut((DataObject)availQuote, "availQuote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)availQuote, "availQuote");
             System.out.println();
         }
 
@@ -95,51 +103,90 @@
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from local join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
-        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);
+        XQueryQuoteClientTestCase.assertQuote(availQuote, priceQuote, quote, 0.1f);
 
         quote = quoteJoinLocal.joinPriceAndAvailQuotes(priceQuote, availQuote, 0.2f);
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from local join (second invokation):");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
-        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.2f);
+        XQueryQuoteClientTestCase.assertQuote(availQuote, priceQuote, quote, 0.2f);
 
         quote = quoteJoinLocal.joinPriceAndAvailQuotesWs(priceQuote, availQuote, 0.1f);
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from web service join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
-        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);
+        XQueryQuoteClientTestCase.assertQuote(availQuote, priceQuote, quote, 0.1f);
 
         quote = quoteJoinLocal.joinPriceAndAvailQuotes();
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from properties join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
-        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);
+        XQueryQuoteClientTestCase.assertQuote(availQuote, priceQuote, quote, 0.1f);
 
         quote = quoteJoinLocal.joinPriceAndAvailQuotes(0.1f);
         if (SHOW_DEBUG_MSG) {
             System.out.println();
             System.out.println("Output quote from external references join:");
-            TestHelper.serializeToSystemOut((DataObject)quote, "quote");
+            QuoteDataUtil.serializeToSystemOut((DataObject)quote, "quote");
             System.out.println();
         }
-        TestHelper.assertQuote(availQuote, priceQuote, quote, 0.1f);
+        XQueryQuoteClientTestCase.assertQuote(availQuote, priceQuote, quote, 0.1f);
     }
 
     @After
     public void stopClient() throws Exception {
         server.after();
         scaDomain.close();
+    }
+
+    public static void assertQuote(AvailQuote availQuote, PriceQuote priceQuote, Quote quote, float taxRate) {
+        QuoteCalculatorImpl quoteCalculatorImpl = new QuoteCalculatorImpl();
+    
+        TestCase.assertEquals(priceQuote.getCustomerName(), quote.getName());
+        ShipAddress shipAddress = priceQuote.getShipAddress();
+        TestCase.assertEquals(shipAddress.getStreet() + ","
+            + shipAddress.getCity()
+            + ","
+            + shipAddress.getState().toUpperCase()
+            + ","
+            + shipAddress.getZip(), quote.getAddress());
+        List availRequests = availQuote.getAvailRequest();
+        List priceRequests = priceQuote.getPriceRequests().getPriceRequest();
+        List quoteResponses = quote.getQuoteResponse();
+        TestCase.assertEquals(availRequests.size(), priceRequests.size());
+        TestCase.assertEquals(availRequests.size(), quoteResponses.size());
+    
+        for (int i = 0; i < availRequests.size(); i++) {
+            AvailRequest availRequest = (AvailRequest)availRequests.get(i);
+            PriceRequest priceRequest = (PriceRequest)priceRequests.get(i);
+            QuoteResponse quoteResponse = (QuoteResponse)quoteResponses.get(i);
+            TestCase.assertEquals(availRequest.getWidgetId(), quoteResponse.getWidgetId());
+            TestCase.assertEquals(priceRequest.getPrice(), quoteResponse.getUnitPrice());
+            TestCase.assertEquals(availRequest.getRequestedQuantity(), quoteResponse.getRequestedQuantity());
+            TestCase.assertEquals(availRequest.isQuantityAvail(), quoteResponse.isFillOrder());
+            if (availRequest.getShipDate() == null) {
+                TestCase.assertNull(quoteResponse.getShipDate());
+            } else {
+                TestCase.assertEquals(availRequest.getShipDate(), quoteResponse.getShipDate());
+            }
+            TestCase.assertEquals(taxRate, quoteResponse.getTaxRate());
+            TestCase.assertEquals(quoteCalculatorImpl.calculateTotalPrice(taxRate,
+                                                                          availRequest.getRequestedQuantity(),
+                                                                          priceRequest.getPrice(),
+                                                                          availRequest.isQuantityAvail()),
+                                                                          quoteResponse.getTotalCost());
+        }
     }
 }



---------------------------------------------------------------------
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