tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r814843 - in /tuscany/sandbox/travelsample/contributions: ./ creditcard-payment-sdo-contribution/ creditcard-payment-sdo/ creditcard-payment-sdo/src/main/java/com/ creditcard-payment-sdo/src/main/java/com/tuscanyscatours/ creditcard-payment...
Date Mon, 14 Sep 2009 20:50:08 GMT
Author: nash
Date: Mon Sep 14 20:50:07 2009
New Revision: 814843

URL: http://svn.apache.org/viewvc?rev=814843&view=rev
Log:
Apply new naming convention to contributions/creditcard-payment-sdo

Added:
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/
      - copied from r814729, tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo-contribution/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
Removed:
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo-contribution/
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/payment/creditcard/CreditCardPayment.java
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/payment/creditcard/impl/CreditCardPaymentImpl.java
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/payment/creditcard/CreditCardPaymentTestCase.java
Modified:
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/pom.xml
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml
    tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite
    tuscany/sandbox/travelsample/contributions/pom.xml

Modified: tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/pom.xml?rev=814843&r1=814729&r2=814843&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/pom.xml (original)
+++ tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/pom.xml Mon Sep 14 20:50:07
2009
@@ -25,8 +25,8 @@
         <version>1.6-SNAPSHOT</version>
         <!--relativePath>../../pom.xml</relativePath-->
     </parent><version>1.0-SNAPSHOT</version>
-    <artifactId>scatours-creditcard-payment-sdo-contribution</artifactId>
-    <name>Apache Tuscany SCA Tours Chapter Credit Card Payment Contribution SDO</name>
+    <artifactId>scatours-contribution-creditcard-payment-sdo</artifactId>
+    <name>Apache Tuscany SCA Tours Credit Card Payment Contribution SDO</name>
 
     <dependencies>
         <dependency>
@@ -111,7 +111,7 @@
                             <schemaFile>
                                 ${basedir}/src/main/resources/CreditCardPayment.wsdl
                             </schemaFile>
-                            <javaPackage>payment.creditcard</javaPackage>
+                            <javaPackage>com.tuscanyscatours.payment.creditcard</javaPackage>
                             <prefix>CreditCardPayment</prefix>
                             <noNotification>true</noNotification>
                             <noContainer>true</noContainer>

Added: tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java?rev=814843&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
(added)
+++ tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
Mon Sep 14 20:50:07 2009
@@ -0,0 +1,39 @@
+
+package com.tuscanyscatours.payment.creditcard;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.3-b02-
+ * Generated source version: 2.1
+ * 
+ */
+@WebService(name = "CreditCardPayment", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/")
+public interface CreditCardPayment {
+
+
+    /**
+     * 
+     * @param amount
+     * @param creditCard
+     * @return
+     *     returns java.lang.String
+     */
+    @WebMethod(action = "http://tuscanyscatours.com/CreditCardPayment/authorize")
+    @WebResult(name = "Status", targetNamespace = "")
+    @RequestWrapper(localName = "authorize", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/",
className = "com.tuscanyscatours.payment.creditcard.AuthorizeType")
+    @ResponseWrapper(localName = "authorizeResponse", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/",
className = "com.tuscanyscatours.payment.creditcard.AuthorizeResponseType")
+    public String authorize(
+        @WebParam(name = "CreditCard", targetNamespace = "")
+        CreditCardDetailsType creditCard,
+        @WebParam(name = "Amount", targetNamespace = "")
+        float amount);
+
+}

Added: tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java?rev=814843&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
(added)
+++ tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
Mon Sep 14 20:50:07 2009
@@ -0,0 +1,47 @@
+/*
+ * 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 com.tuscanyscatours.payment.creditcard.impl;
+
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+
+/**
+ * 
+ */
+@Service(CreditCardPayment.class)
+public class CreditCardPaymentImpl implements CreditCardPayment {
+    
+    public String authorize(CreditCardDetailsType creditCard, float amount) {
+        if (creditCard != null){
+            System.out.println("Checking card: name = " + 
+                               creditCard.getCardOwner().getName() +
+                               " number = " +
+                               creditCard.getCreditCardNumber() +
+                               " for amount " + 
+                               amount);
+        } else {
+            System.out.println("Checking card is null");
+        }
+        
+        return "OK";
+    }
+}

Modified: tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl?rev=814843&r1=814729&r2=814843&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl
(original)
+++ tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl
Mon Sep 14 20:50:07 2009
@@ -18,17 +18,17 @@
  * under the License.    
 -->
 <wsdl:definitions name="CreditCardPayment" 
-                  targetNamespace="http://www.example.org/CreditCardPayment/"
+                  targetNamespace="http://www.tuscanyscatours.com/CreditCardPayment/"
                   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
-                  xmlns:tns="http://www.example.org/CreditCardPayment/" 
+                  xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/" 
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                   xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
                   xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
     <wsdl:types>
         <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
-                    targetNamespace="http://www.example.org/CreditCardPayment/"
-                    xmlns:tns="http://www.example.org/CreditCardPayment/">
+                    targetNamespace="http://www.tuscanyscatours.com/CreditCardPayment/"
+                    xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/">
             
             <xsd:element name="authorize" type="tns:AuthorizeType"/>
             <xsd:complexType name="AuthorizeType">

Modified: tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml?rev=814843&r1=814729&r2=814843&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml
(original)
+++ tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml
Mon Sep 14 20:50:07 2009
@@ -18,6 +18,6 @@
     * under the License.    
 -->
 <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
-             xmlns:creditcard="http://creditcard">
-   <deployable composite="creditcard:creditcard" />
-</contribution>
\ No newline at end of file
+              xmlns:tours="http://tuscanyscatours.com/">
+    <deployable composite="tours:creditcard" />
+</contribution>

Modified: tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite?rev=814843&r1=814729&r2=814843&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite
(original)
+++ tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite
Mon Sep 14 20:50:07 2009
@@ -18,18 +18,16 @@
  * under the License.    
 -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
-           targetNamespace="http://creditcard"
-           xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
-           xmlns:c="http://creditcard" 
+           targetNamespace="http://tuscanyscatours.com/"
            name="creditcard">
 
-    <component name="CreditCardPaymentComponent">
-        <implementation.java class="payment.creditcard.impl.CreditCardPaymentImpl" />
+    <component name="CreditCardPayment">
+        <implementation.java class="com.tuscanyscatours.payment.creditcard.impl.CreditCardPaymentImpl"
/>
         <service name="CreditCardPayment">
-            <interface.wsdl interface="http://www.example.org/CreditCardPayment/#wsdl.interface(CreditCardPayment)"/>
+            <interface.wsdl interface="http://www.tuscanyscatours.com/CreditCardPayment/#wsdl.interface(CreditCardPayment)"/>
             <binding.ws uri="http://localhost:8082/CreditCardPayment" />
-            <binding.sca/>
+            <binding.sca />
         </service>
     </component>
     
-</composite>
\ No newline at end of file
+</composite>

Added: tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java?rev=814843&view=auto
==============================================================================
--- tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
(added)
+++ tuscany/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
Mon Sep 14 20:50:07 2009
@@ -0,0 +1,81 @@
+/*
+ * 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 scatours.payment.creditcard;
+
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardPaymentFactory;
+import com.tuscanyscatours.payment.creditcard.PayerType;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class CreditCardPaymentTestCase {
+    private static SCANode node;
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        SCANodeFactory factory = SCANodeFactory.newInstance();
+        node = factory.createSCANode(null,
+                    new SCAContribution("creditcard-sdo", "./target/classes"));
+        node.start();
+    }
+    
+    @Test
+    public void testCreditCardPayment() {
+        SCAClient client = (SCAClient) node;
+        CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment");
+        
+        CreditCardPaymentFactory factory = CreditCardPaymentFactory.INSTANCE;
+        CreditCardDetailsType ccDetails = factory.createCreditCardDetailsType();
+        ccDetails.setCreditCardType("Visa");
+        ccDetails.setCreditCardNumber("1111-2222-3333-4444");
+        ccDetails.setExpMonth(9);
+        ccDetails.setExpYear(2010);
+        PayerType ccOwner = factory.createPayerType();
+        ccOwner.setName("Fred");
+        ccDetails.setCardOwner(ccOwner);
+        
+        System.out.println(cc.authorize(ccDetails, 100.00f));
+    }
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+        if (node != null) {
+            node.stop();
+            node = null;
+        }
+    }
+
+}

Modified: tuscany/sandbox/travelsample/contributions/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/travelsample/contributions/pom.xml?rev=814843&r1=814842&r2=814843&view=diff
==============================================================================
--- tuscany/sandbox/travelsample/contributions/pom.xml (original)
+++ tuscany/sandbox/travelsample/contributions/pom.xml Mon Sep 14 20:50:07 2009
@@ -43,7 +43,7 @@
                 <module>common</module>
                 <module>creditcard-payment-jaxb</module>
                 <module>creditcard-payment-jaxb-policy</module>
-                <module>creditcard-payment-sdo-contribution</module>
+                <module>creditcard-payment-sdo</module>
                 <module>currency</module>
                 <module>currency-corba-contribution</module>
                 <module>currency-jms-contribution</module>



Mime
View raw message