Package com.example.customerservice

Examples of com.example.customerservice.NoSuchCustomer


        request.setName("none");
        try {
            customerServiceProxy.getCustomersByName(request);
            Assert.fail("NoSuchCustomerException expected");
        } catch (NoSuchCustomerException e) {
            NoSuchCustomer info = e.getFaultInfo();
            Assert.assertEquals("none", info.getCustomerId());
        }
    }
View Full Code Here


     * a dummy customer is returned that has the same name as the request
     */
    public GetCustomersByNameResponse getCustomersByName(GetCustomersByName request)
        throws NoSuchCustomerException {
        if ("none".equals(request.getName())) {
            NoSuchCustomer noSuchCustomer = new NoSuchCustomer();
            noSuchCustomer.setCustomerId(request.getName());
            throw new NoSuchCustomerException("Customer not found", noSuchCustomer);
        }
        GetCustomersByNameResponse response = new GetCustomersByNameResponse();
        Customer customer = new Customer();
        customer.setName(request.getName());
View Full Code Here

        request.setName("none");
        try {
            customerService.getCustomersByName(request);
            Assert.fail("NoSuchCustomerException expected");
        } catch (NoSuchCustomerException e) {
            NoSuchCustomer info = e.getFaultInfo();
            Assert.assertEquals("none", info.getCustomerId());
        }

    }
View Full Code Here

     * other case a dummy customer is returned that has the same name as the
     * request
     */
    public GetCustomersByNameResponse getCustomersByName(GetCustomersByName request) throws NoSuchCustomerException {
        if ("none".equals(request.getName())) {
            NoSuchCustomer noSuchCustomer = new NoSuchCustomer();
            noSuchCustomer.setCustomerId(request.getName());
            throw new NoSuchCustomerException("Customer not found", noSuchCustomer);
        }
        GetCustomersByNameResponse response = new GetCustomersByNameResponse();
        Customer customer = new Customer();
        customer.setName(request.getName());
View Full Code Here

        request.setName("none");
        try {
            customerService.getCustomersByName(request);
            Assert.fail("NoSuchCustomerException expected");
        } catch (NoSuchCustomerException e) {
            NoSuchCustomer info = e.getFaultInfo();
            Assert.assertEquals("none", info.getCustomerId());
        }

    }
View Full Code Here

    @Test
    public void testMarshalException() throws IOException, InterruptedException {
        InputStream in = this.getClass().getResourceAsStream("SoapMarshalTestExpectedFault.xml");
        resultEndpoint.expectedMessageCount(1);
        resultEndpoint.expectedBodiesReceived(TestUtil.readStream(in));
        NoSuchCustomer noSuchCustomer = new NoSuchCustomer();
        noSuchCustomer.setCustomerId("None");
        NoSuchCustomerException exception = new NoSuchCustomerException("No customer found", noSuchCustomer);
        producer.sendBodyAndHeader(null, Exchange.EXCEPTION_CAUGHT, exception);
        resultEndpoint.assertIsSatisfied();
    }
View Full Code Here

        resultEndpoint.message(0).body(String.class).contains("<ns2:Fault>");
        resultEndpoint.message(0).body(String.class).contains("<ns2:Value>ns2:Receiver</ns2:Value>");
        resultEndpoint.message(0).body(String.class).contains("<ns2:Text xml:lang=\"en\">No customer found</ns2:Text>");
        resultEndpoint.message(0).body(String.class).contains("<customerId>None</customerId>");
        resultEndpoint.message(0).body(String.class).contains("</ns2:Fault>");
        NoSuchCustomer noSuchCustomer = new NoSuchCustomer();
        noSuchCustomer.setCustomerId("None");
        NoSuchCustomerException exception = new NoSuchCustomerException("No customer found", noSuchCustomer);
        producer.sendBodyAndHeader(null, Exchange.EXCEPTION_CAUGHT, exception);
        resultEndpoint.assertIsSatisfied();
    }
View Full Code Here

        request.setName("none");
        try {
            customerServiceProxy.getCustomersByName(request);
            Assert.fail("NoSuchCustomerException expected");
        } catch (NoSuchCustomerException e) {
            NoSuchCustomer info = e.getFaultInfo();
            Assert.assertEquals("none", info.getCustomerId());
        }
    }
View Full Code Here

        request.setName("none");
        try {
            customerService.getCustomersByName(request);
            Assert.fail("NoSuchCustomerException expected");
        } catch (NoSuchCustomerException e) {
            NoSuchCustomer info = e.getFaultInfo();
            Assert.assertEquals("none", info.getCustomerId());
        }

    }
View Full Code Here

     * other case a dummy customer is returned that has the same name as the
     * request
     */
    public GetCustomersByNameResponse getCustomersByName(GetCustomersByName request) throws NoSuchCustomerException {
        if ("none".equals(request.getName())) {
            NoSuchCustomer noSuchCustomer = new NoSuchCustomer();
            noSuchCustomer.setCustomerId(request.getName());
            throw new NoSuchCustomerException("Customer not found", noSuchCustomer);
        }
        GetCustomersByNameResponse response = new GetCustomersByNameResponse();
        Customer customer = new Customer();
        customer.setName(request.getName());
View Full Code Here

TOP

Related Classes of com.example.customerservice.NoSuchCustomer

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.