summaryrefslogtreecommitdiffstats
path: root/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-26 17:58:40 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-26 17:58:40 +0000
commit403ff4abf708d2beb7a97babb60f8c0318ff8450 (patch)
treefec9a5991a7e775a8c67a7a0a6dfb40c767fce84 /sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment
parente2153aa948efc7d8b05c641784b30a665c598748 (diff)
Adding CurrencyConverter
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@778816 13f79535-47bb-0310-9956-ffa450edef68
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
-rw-r--r--sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment/creditcard/test/OSGiTestUtils.java (renamed from sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/payment/creditcard/test/OSGiTestUtils.java)2
2 files changed, 28 insertions, 6 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
diff --git a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/payment/creditcard/test/OSGiTestUtils.java b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment/creditcard/test/OSGiTestUtils.java
index 1fe64b80a4..de8a77a818 100644
--- a/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/payment/creditcard/test/OSGiTestUtils.java
+++ b/sandbox/rfeng/scatours-creditcard-payment-dosgi-contribution/src/test/java/scatours/payment/creditcard/test/OSGiTestUtils.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package payment.creditcard.test;
+package scatours.payment.creditcard.test;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;