summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/travelsample/contributions/creditcard-payment-jaxb-policy')
-rw-r--r--sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java20
-rw-r--r--sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java30
2 files changed, 25 insertions, 25 deletions
diff --git a/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
index 253fcbe674..293f08453f 100644
--- a/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
+++ b/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java
@@ -19,28 +19,28 @@
package com.tuscanyscatours.payment.creditcard.impl;
+import org.osoa.sca.annotations.Service;
+
import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
-import org.osoa.sca.annotations.Service;
/**
*
*/
@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-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java b/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
index fb989ae897..7f40910d82 100644
--- a/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
+++ b/sandbox/travelsample/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java
@@ -19,13 +19,6 @@
package scatours.payment.creditcard;
-import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception;
-import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
-import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
-import com.tuscanyscatours.payment.creditcard.CreditCardTypeType;
-import com.tuscanyscatours.payment.creditcard.ObjectFactory;
-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;
@@ -35,6 +28,13 @@ import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
+import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception;
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardTypeType;
+import com.tuscanyscatours.payment.creditcard.ObjectFactory;
+import com.tuscanyscatours.payment.creditcard.PayerType;
+
/**
*
*/
@@ -46,19 +46,19 @@ public class CreditCardPaymentTestCase {
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
- try {
- node = SCANodeFactory.newInstance().createSCANode(null,
- new SCAContribution("creditcard", "./target/classes"));
+ try {
+ node =
+ SCANodeFactory.newInstance().createSCANode(null, new SCAContribution("creditcard", "./target/classes"));
- node.start();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ node.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
}
@Test
public void testCreditCardPayment() {
- SCAClient client = (SCAClient) node;
+ SCAClient client = (SCAClient)node;
CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment");
ObjectFactory objectFactory = new ObjectFactory();