diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-07 23:00:52 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-07 23:00:52 +0000 |
commit | 74bfa87f0c8aa5071cb60e133737e61304017148 (patch) | |
tree | ddad3fcd44853901aa7fc257a2ba0599529369f2 /sca-java-1.x/trunk | |
parent | 080ab0647e8cf967b99ab19426e50c7612b9126b (diff) |
Ensure all variations of PaymentTestCase throw exceptions when they fail (TUSCANY-3407)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@931718 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/trunk')
10 files changed, 55 insertions, 11 deletions
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java index b38f2a9e9c..6db4934edf 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java @@ -70,7 +70,11 @@ public class PaymentTestCase { public void testPayment() { SCAClient client = (SCAClient)paymentNode; Payment payment = client.getService(Payment.class, "PaymentClient"); - System.out.println("Result = " + payment.makePaymentMember("Fred", 100.00f)); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } } @AfterClass diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java index 907bcc93f8..1eb611e5b3 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java @@ -69,7 +69,11 @@ public class PaymentTestCase { public void testPayment() {
SCAClient client = (SCAClient)paymentNode;
Payment payment = client.getService(Payment.class, "PaymentClient");
- System.out.println("Result = " + payment.makePaymentMember("Fred", 100.00f));
+ String result = payment.makePaymentMember("Fred", 100.00f);
+ System.out.println("Result = " + result);
+ if (!"Success".equals(result)) {
+ throw new RuntimeException(result);
+ }
}
@AfterClass
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java index 2108f21c5e..330dc15385 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java @@ -73,9 +73,17 @@ public class PaymentTestCase { } System.out.println("==================================================="); - System.out.println("\n\nPaymentCallbackID - Status = \n\n" + paymentCallbackID.makePaymentMember("c-0", 20000.00f)); + String result = paymentCallbackID.makePaymentMember("c-0", 20000.00f); + System.out.println("\n\nPaymentCallbackID - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } System.out.println("==================================================="); - System.out.println("\n\nPaymentCallbackRedirect - Status = \n\n" + paymentCallbackRedirect.makePaymentMember("c-0", 20000.00f)); + result = paymentCallbackRedirect.makePaymentMember("c-0", 20000.00f); + System.out.println("\n\nPaymentCallbackRedirect - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } System.out.println("==================================================="); diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java index d8c79622e6..5539d6b1fe 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java @@ -54,7 +54,11 @@ public class PaymentTestCase { SCAClient client = (SCAClient)node1; Payment payment = client.getService(Payment.class, "Payment"); - System.out.println("\n\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("\n\nSuccessful Payment - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); } diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java index 2498bd74c8..52a1469da7 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java @@ -48,7 +48,11 @@ public class PaymentTestCase { Payment payment = client.getService(Payment.class, "Payment"); System.out.println("==================================================="); - System.out.println("\n\nPayment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("\n\nPayment - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } System.out.println("==================================================="); } diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java index ead8b87db0..ee4e3a5e96 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java @@ -49,7 +49,11 @@ public class PaymentTestCase { SCAClient client = (SCAClient)node;
Payment payment = client.getService(Payment.class, "Payment");
- System.out.println("\n\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f));
+ String result = payment.makePaymentMember("c-0", 100.00f);
+ System.out.println("\n\nSuccessful Payment - Status = \n\n" + result);
+ if (!"OK".equals(result)) {
+ throw new RuntimeException(result);
+ }
System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f));
}
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java index 66f393b275..f55f8c7c75 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java @@ -69,7 +69,11 @@ public class PaymentTestCase { public void testPayment() { SCAClient client = (SCAClient)paymentNode; Payment payment = client.getService(Payment.class, "PaymentClient"); - System.out.println("Result = " + payment.makePaymentMember("Fred", 100.00f)); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"Success".equals(result)) { + throw new RuntimeException(result); + } } @AfterClass diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java index 0bff419ccd..9e59b05d80 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java @@ -58,7 +58,11 @@ public class PaymentTestCase { public void testPayment() { SCAClient client = (SCAClient)paymentNode; Payment payment = client.getService(Payment.class, "PaymentClient"); - System.out.println("Result = " + payment.makePaymentMember("c-0", 100.00f)); + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } } @AfterClass diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java index 29fda50ef3..23ca9643c2 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java @@ -59,7 +59,11 @@ public class PaymentTestCase { public void testPayment() { SCAClient client = (SCAClient)paymentNode; Payment payment = client.getService(Payment.class, "PaymentClient"); - System.out.println("Result = " + payment.makePaymentMember("Fred", 100.00f)); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } } @AfterClass diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java index 8723c05624..e1634c95f9 100644 --- a/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java +++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java @@ -58,7 +58,11 @@ public class PaymentTestCase { public void testPayment() { SCAClient client = (SCAClient)paymentNode; Payment payment = client.getService(Payment.class, "PaymentClient"); - System.out.println("Result = " + payment.makePaymentMember("c-0", 100.00f)); + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } } @AfterClass |