Package org.apache.tuscany.sca.node

Examples of org.apache.tuscany.sca.node.SCAClient


        node.start();
    }

    @Test
    public void testCreditCardPayment() {
        SCAClient client = (SCAClient)node;
        CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment");

        CreditCardPaymentFactory factory = CreditCardPaymentFactory.INSTANCE;
        CreditCardDetailsType ccDetails = factory.createCreditCardDetailsType();
        ccDetails.setCreditCardType("Visa");
        ccDetails.setCreditCardNumber("1111-2222-3333-4444");
View Full Code Here


        }
    }

    @Test
    public void testPayment() {
        SCAClient client = (SCAClient)tripNode;
        Book booking = client.getService(Book.class, "Trip/Book");
        TripItem tripItem =
            new TripItem("1234", "5678", TripItem.TRIP, "FS1DEC06", "Florence and Siena pre-packaged tour", "FLR",
                         "06/12/09", "13/12/09", 450, "EUR", "http://localhost:8085/tbd");
        System.out.println("Result = " + booking.book(tripItem) + "\n");
    }
View Full Code Here

        node.start();
    }

    @Test
    public void testEmailGateway() {
        SCAClient client = (SCAClient)node;
        EmailGateway cc = client.getService(EmailGateway.class, "EmailGatewayClient");
        ObjectFactory objectFactory = new ObjectFactory();
        EmailType email = objectFactory.createEmailType();
        email.setTo("Fred");
        email.setTitle("An email");
        email.setBody("A message");
View Full Code Here

        paymentNode.start();
    }

    @Test
    public void testPayment() {
        SCAClient client = (SCAClient)paymentNode;
        Payment payment = client.getService(Payment.class, "PaymentClient");
        String result = payment.makePaymentMember("Fred", 100.00f);
        System.out.println("Result = " + result);
        if (!"Success".equals(result)) {
            throw new RuntimeException(result);
        }
View Full Code Here

    public static void main(String[] args) throws Exception {
        SCANode node = SCANodeFactory.newInstance().createSCANode(null,
                                                              locate("payment-java-callback"));
        node.start();
       
        SCAClient client = (SCAClient)node;
        Payment payment1 = client.getService(Payment.class, "Payment1");
        Payment payment2 = client.getService(Payment.class, "Payment2");
        Payment paymentConfirm = client.getService(Payment.class, "PaymentConfirm");
        Payment paymentCallbackID = client.getService(Payment.class, "PaymentCallbackID");
        Payment paymentCallbackRedirect = client.getService(Payment.class, "PaymentCallbackRedirect");
       
        System.out.println("===================================================");
        System.out.println("\n\nPayment1 under limit - Status = \n\n" + payment1.makePaymentMember("c-0", 100.00f));
        System.out.println("===================================================");
        System.out.println("\n\nPayment2 under limit - Status = \n\n" + payment2.makePaymentMember("c-0", 100.00f));       
View Full Code Here

        node2.start();
    }

    @Test
    public void testPayment() {
        SCAClient client = (SCAClient)node1;
        Payment payment = client.getService(Payment.class, "Payment");

        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);
View Full Code Here

                                                              locate("payment-bpel"),
                                                              locate("creditcard-payment-jaxb"),
                                                              locate("emailgateway"));
        node.start();
       
        SCAClient client = (SCAClient)node;
        Payment payment = client.getService(Payment.class, "Payment/paymentPartnerLink");

        System.out.println("Payment BPEL test");
        System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f));
        System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f));
       
View Full Code Here

        }
    }

    @Test
    public void testCreditCardPayment() {
        SCAClient client = (SCAClient)node;
        CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment");

        ObjectFactory objectFactory = new ObjectFactory();
        CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType();
        ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa"));
        PayerType ccOwner = objectFactory.createPayerType();
View Full Code Here

        paymentNode.start();
    }

    @Test
    public void testPayment() {
        SCAClient client = (SCAClient)paymentNode;
        Payment payment = client.getService(Payment.class, "PaymentClient");
        String result = payment.makePaymentMember("c-0", 100.00f);
        System.out.println("Result = " + result);
        if (!"OK".equals(result)) {
            throw new RuntimeException(result);
        }
View Full Code Here

        SCANode node = SCANodeFactory.newInstance().createSCANode(null,
                                                              locate("payment-java-policy"),
                                                              locate("creditcard-payment-jaxb-policy"));
        node.start();
       
        SCAClient client = (SCAClient)node;
        Payment payment = client.getService(Payment.class, "Payment");

        System.out.println("Payment Java Policy test");
        System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f));
        System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f));
       
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.node.SCAClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.