summaryrefslogtreecommitdiffstats
path: root/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment/creditcard/test/CreditCardPaymentOSGiTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment/creditcard/test/CreditCardPaymentOSGiTestCase.java (renamed from sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/payment/creditcard/test/CreditCardPaymentOSGiTestCase.java)32
1 files changed, 27 insertions, 5 deletions
diff --git a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/payment/creditcard/test/CreditCardPaymentOSGiTestCase.java b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment/creditcard/test/CreditCardPaymentOSGiTestCase.java
index 122e380164..f981e31efa 100644
--- a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/payment/creditcard/test/CreditCardPaymentOSGiTestCase.java
+++ b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment/creditcard/test/CreditCardPaymentOSGiTestCase.java
@@ -17,9 +17,9 @@
* under the License.
*/
-package payment.creditcard.test;
+package scatours.payment.creditcard.test;
-import static payment.creditcard.test.OSGiTestUtils.bundleStatus;
+import static scatours.payment.creditcard.test.OSGiTestUtils.bundleStatus;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -30,11 +30,19 @@ import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
+import scatours.payment.creditcard.CreditCardDetailsType;
+import scatours.payment.creditcard.CreditCardPayment;
+import scatours.payment.creditcard.CreditCardPaymentService;
+import scatours.payment.creditcard.CreditCardTypeType;
+import scatours.payment.creditcard.ObjectFactory;
+import scatours.payment.creditcard.PayerType;
+
/**
*
*/
@@ -83,9 +91,7 @@ public class CreditCardPaymentOSGiTestCase {
}
@Test
- /**
- * Test the Web service exposed by the Calculator
- */
+ @Ignore("Now we use the testClient")
public void testWS() throws Exception {
URL url = new URL("http://localhost:8086/CreditCardPayment?wsdl");
InputStream is = url.openStream();
@@ -106,6 +112,22 @@ public class CreditCardPaymentOSGiTestCase {
}
/**
+ * Test the Web service exposed by the Calculator
+ */
+ @Test
+ public void testClient() {
+ CreditCardPaymentService service = new CreditCardPaymentService();
+ ObjectFactory objectFactory = new ObjectFactory();
+ CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType();
+ ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa"));
+ PayerType ccOwner = objectFactory.createPayerType();
+ ccOwner.setName("Fred");
+ ccDetails.setCardOwner(ccOwner);
+ CreditCardPayment cc = service.getCreditCardPaymentPort();
+ System.out.println(cc.authorize(ccDetails, 100.00f));
+ }
+
+ /**
* @throws java.lang.Exception
*/
@AfterClass