summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/contributions/creditcard-payment-sdo/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java10
-rw-r--r--sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java17
-rw-r--r--sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java21
3 files changed, 20 insertions, 28 deletions
diff --git a/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java b/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
index 2eaf9eb028..9f508ecc59 100644
--- a/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
+++ b/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java
@@ -1,4 +1,3 @@
-
package com.tuscanyscatours.payment.creditcard;
import javax.jws.WebMethod;
@@ -8,7 +7,6 @@ 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-
@@ -18,7 +16,6 @@ import javax.xml.ws.ResponseWrapper;
@WebService(name = "CreditCardPayment", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/")
public interface CreditCardPayment {
-
/**
*
* @param amount
@@ -30,10 +27,7 @@ public interface CreditCardPayment {
@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);
+ public String authorize(@WebParam(name = "CreditCard", targetNamespace = "") CreditCardDetailsType creditCard,
+ @WebParam(name = "Amount", targetNamespace = "") float amount);
}
diff --git a/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
index 681f9af7e2..ed817a58bb 100644
--- a/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
+++ b/sandbox/travelsample/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
@@ -29,19 +29,18 @@ 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);
+ 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";
}
}
diff --git a/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java b/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
index 802626594b..b7d76a061f 100644
--- a/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
+++ b/sandbox/travelsample/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
@@ -19,19 +19,19 @@
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;
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardPaymentFactory;
+import com.tuscanyscatours.payment.creditcard.PayerType;
+
/**
*
*/
@@ -44,16 +44,15 @@ public class CreditCardPaymentTestCase {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
SCANodeFactory factory = SCANodeFactory.newInstance();
- node = factory.createSCANode(null,
- new SCAContribution("creditcard-sdo", "./target/classes"));
+ node = factory.createSCANode(null, new SCAContribution("creditcard-sdo", "./target/classes"));
node.start();
}
-
+
@Test
public void testCreditCardPayment() {
- SCAClient client = (SCAClient) node;
+ SCAClient client = (SCAClient)node;
CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment");
-
+
CreditCardPaymentFactory factory = CreditCardPaymentFactory.INSTANCE;
CreditCardDetailsType ccDetails = factory.createCreditCardDetailsType();
ccDetails.setCreditCardType("Visa");
@@ -63,7 +62,7 @@ public class CreditCardPaymentTestCase {
PayerType ccOwner = factory.createPayerType();
ccOwner.setName("Fred");
ccDetails.setCardOwner(ccOwner);
-
+
System.out.println(cc.authorize(ccDetails, 100.00f));
}