Examples of CustomerService


Examples of com.ateam.webstore.service.impl.CustomerService

public class CustomerHandler extends Handler {
  CustomerService service;
  public CustomerHandler(HttpServletRequest req) {
    super(req);
    service = new CustomerService();
  }
View Full Code Here

Examples of com.devsniper.desktop.customers.service.CustomerService

     * Gets customers count from database.
     *
     * @return customers count
     */
    public int getCustomersCount() {
        return new CustomerService().getListWithNamedQuery(Customer.FIND_ALL).size();
    }
View Full Code Here

Examples of com.example.customerservice.CustomerService

public class CustomerServiceServer {

    protected CustomerServiceServer() throws Exception {
        System.out.println("Starting Server");
        CustomerService implementor = new CustomerServiceImpl();
        EndpointImpl ep = (EndpointImpl)Endpoint.publish("http://localhost:9090/CustomerServicePort",
                                                         implementor);

        // Adding logging for incoming and outgoing messages
        ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
View Full Code Here

Examples of com.example.customerservice.CustomerService

    }
   
    public static void main(String args[]) throws NoSuchCustomerException {
        // Create the service client with its default wsdlurl
        CustomerServiceService customerServiceService = new CustomerServiceService();
        CustomerService customerService = customerServiceService.getCustomerServicePort();
       
        // Initialize the test class and call the tests
        CustomerServiceTester client = new CustomerServiceTester();
        client.setCustomerService(customerService);
        client.testCustomerService();
View Full Code Here

Examples of com.example.customerservice.CustomerService

    private void run() {
        JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
        factoryBean.setAddress(address);
        factoryBean.setServiceClass(CustomerService.class);
        CustomerService customerService = factoryBean.create(CustomerService.class);

        // Anonymous should not be able to read customers
        try {
            List<Customer> customersByName = customerService.getCustomersByName("Fred");
            customersByName.get(0);
            Assert.fail("Anonymous should not be allowed to read customers");
        } catch (Exception e) {
            logger.info("Anonymous request was correctly denied. " + getMessage(e));
        }

        // Alex should not be able to read customers
        CredentialsInjector.inject(customerService, "alex", "alexspassword");
        try {
            customerService.getCustomersByName("Test");
            Assert.fail("Alex should not be allowed to read customers");
        } catch (Exception e) {
            logger.info("Alex's request was correctly denied. " + getMessage(e));
        }

        // Bob should be able to read customers but not to update
        CredentialsInjector.inject(customerService, "bob", "bobspassword");
        try {
            List<Customer> customersByName = customerService.getCustomersByName("Fred");
            Customer customer = customersByName.get(0);
            logger.info("Bob was able to load the customer " + customer.getName());
        } catch (Exception e) {
            Assert.fail("Bob should be allowed to read customers");
        }
        CredentialsInjector.inject(customerService, "bob", "bobspassword");
        try {
            Customer customer = new Customer();
            customer.setName("Fred");
            customerService.updateCustomer(customer);
            Assert.fail("Bob should not be allowed to update a customer");
        } catch (Exception e) {
            logger.info("Bob's request was correctly denied. " + getMessage(e));
        }

        // Jim should be able to read and update customers
        CredentialsInjector.inject(customerService, "jim", "jimspassword");
        try {
            List<Customer> customersByName = customerService.getCustomersByName("Fred");
            Customer customer = customersByName.get(0);
            logger.info("Jim was able to load the customer " + customer.getName());
        } catch (Exception e) {
            Assert.fail("Jim should be allowed to read customers");
        }
        CredentialsInjector.inject(customerService, "jim", "jimspassword");
        try {
            Customer customer = new Customer();
            customer.setName("Fred");
            customerService.updateCustomer(customer);
            logger.info("Jim was able to update the customer");
        } catch (Exception e) {
            Assert.fail("Jim should be allowed to update a customer");
        }
        logger.info("All request were processed as expected");
View Full Code Here

Examples of com.example.customerservice.CustomerService

        } else {
            // Create the service client with its default wsdlurl
            customerServiceService = new CustomerServiceService();
        }

        CustomerService customerService = customerServiceService.getCustomerServicePort();
       
        // Initialize the test class and call the tests
        CustomerServiceTester client = new CustomerServiceTester();
        client.setCustomerService(customerService);
        client.testCustomerService();
View Full Code Here

Examples of com.example.customerservice.CustomerService

public class CustomerServiceServer {

    protected CustomerServiceServer() throws Exception {
        System.out.println("Starting Server");
        CustomerService implementor = new CustomerServiceImpl();
        EndpointImpl ep = (EndpointImpl)Endpoint.publish("http://localhost:9090/CustomerServicePort",
                                                         implementor);

        // Adding logging for incoming and outgoing messages
        ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
View Full Code Here

Examples of com.example.customerservice.CustomerService

        } else {
            // Create the service client with its default wsdlurl
            customerServiceService = new CustomerServiceService();
        }

        CustomerService customerService = customerServiceService.getCustomerServicePort();
       
        // Initialize the test class and call the tests
        CustomerServiceTester client = new CustomerServiceTester();
        client.setCustomerService(customerService);
        client.testCustomerService();
View Full Code Here

Examples of com.liferay.faces.demos.service.CustomerService

    if (customer == null) {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      String customerId = facesContext.getExternalContext().getRequestParameterMap().get(PARAM_NAME_CUSTOMER_ID);
      String elExpression = "customerService";
      CustomerService customerService = (CustomerService) facesContext.getApplication().getELResolver().getValue(
          facesContext.getELContext(), null, elExpression);

      try {
        customer = customerService.getCustomer(Long.parseLong(customerId));
      }
      catch (NumberFormatException e) {
        logger.error(e);
      }
    }
View Full Code Here

Examples of com.rakaizsys.eims.model.customer.CustomerService

  }

  @Override
  protected void doNew() throws Exception {
    dbObject = new CustomerService();
    BeanUtils.setProperty(dbObject, "customer", cbCustomer
        .getSelectedItem());
    ((CustomerServiceTableModel) (tableServices.getModel()))
        .setDbObjects(new ArrayList<DBObject>());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.