Package com.google.code.magja.model.customer

Examples of com.google.code.magja.model.customer.Customer


   * Test method for {@link com.google.code.magja.service.customer.CustomerAddressRemoteServiceImpl#save(com.google.code.magja.model.customer.CustomerAddress)}.
   */
  @Test
  public void testSave() {
    // first, save a new Customer
    Customer customer = CustomerRemoteServiceTest.generateCustomer();

    try {
      customerService.save(customer);
    } catch (ServiceException e) {
      fail(e.getMessage());
View Full Code Here


   * Test method for {@link com.google.code.magja.service.customer.CustomerAddressRemoteServiceImpl#save(com.google.code.magja.model.customer.CustomerAddress)}.
   */
  @Test
  public void testSaveAndUpdate() {
    // first, save a new Customer
    Customer customer = CustomerRemoteServiceTest.generateCustomer();

    try {
      customerService.save(customer);
    } catch (ServiceException e) {
      fail(e.getMessage());
View Full Code Here

  public void testList() {

    int count_addresses = 4;

    // first, save a new Customer
    Customer customer = CustomerRemoteServiceTest.generateCustomer();

    try {
      customerService.save(customer);
    } catch (ServiceException e) {
      fail(e.getMessage());
    }

    for (int i = 0; i < count_addresses; i++) {
      CustomerAddress address = generateAddress();
      address.setCustomer(customer);
      try {
        service.save(address);
      } catch (ServiceException e) {
        fail(e.getMessage());
      }
    }

    try {
      List<CustomerAddress> results = service.list(customer.getId());

      for (CustomerAddress customerAddress : results)
        System.out.println(customerAddress.toString());

      assertEquals(results.size(), count_addresses);
View Full Code Here

   *
   * @param attributes
   * @return Customer
   */
  private Customer buildCustomer(Map<String, Object> attributes) {
    Customer customer = new Customer();

    for (Map.Entry<String, Object> attr : attributes.entrySet())
      customer.set(attr.getKey(), attr.getValue());

    if (attributes.get("gender") != null) {
      Integer gender = new Integer((String) attributes.get("gender"));
      customer.setGender((gender.equals(new Integer(1)) ? Gender.MALE
          : Gender.FEMALE));
    }

    return customer;
  }
View Full Code Here

    for (Map.Entry<String, Object> attr : attrs.entrySet()) {
      c.set(attr.getKey(), attr.getValue());
    }

    Customer customer = Customer.fromAttributes(attrs);
    if (customer != null) {
      c.setCustomer(customer);
    }
    CartAddress shippingAddress = CartAddress
        .fromAttributes((Map<String, Object>) attrs
View Full Code Here

TOP

Related Classes of com.google.code.magja.model.customer.Customer

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.