Examples of Customer


Examples of org.plugtree.training.model.Customer

                // KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
  }
        @Test
  public void testExecution() {

    Customer johnInternational = new Customer("John Z", CustomerType.INTERNATIONAL);
    Customer annaInternational = new Customer("Anna M", CustomerType.INTERNATIONAL);
    Customer maryInternational = new Customer("Mary C", CustomerType.NATIONAL);
    Customer jesseNational = new Customer("Jessy D", CustomerType.NATIONAL);

    Order internationalExpressOrder = new Order();
    internationalExpressOrder.setCustomer(johnInternational);
    internationalExpressOrder.setShipping(ShippingType.EXPRESS);
    internationalExpressOrder.setAmount(100);
View Full Code Here

Examples of org.qi4j.sample.rental.domain.Customer

            Document dom = context.dom();
            Element result = dom.createElementNS( Page.XHTML, "div" );
            String bookingId = context.path();
            UnitOfWork uow = uowf.currentUnitOfWork();
            Booking booking = uow.get( Booking.class, bookingId );
            Customer customer = booking.customer().get();
            createChildNode( dom, result, customer.name().get() );
            createChildNode( dom, result, customer.address().get().line1().get() );
            createChildNode( dom, result, customer.address().get().line2().get() );
            createChildNode( dom, result, customer.address().get().zipCode().get() + " " + customer.address()
                .get()
                .city()
                .get() );
            createChildNode( dom, result, customer.address().get().country().get() );
            return result;
        }
View Full Code Here

Examples of org.radargun.stages.tpcc.domain.Customer

      if (id_wharehouse < 0 || id_district < 0) return;
      else {
         log.info(" CUSTOMER " + id_wharehouse + ", " + id_district);
         for (int i = 1; i <= TpccTools.NB_MAX_CUSTOMER; i++) {

            Customer newCustomer = new Customer(id_wharehouse,
                                                id_district,
                                                i,
                                                TpccTools.aleaChainec(8, 16),
                                                "OE",
                                                c_last(),
                                                TpccTools.aleaChainec(10, 20),
                                                TpccTools.aleaChainec(10, 20),
                                                TpccTools.aleaChainec(10, 20),
                                                TpccTools.aleaChainel(2, 2),
                                                TpccTools.aleaChainen(4, 4) + TpccTools.CHAINE_5_1,
                                                TpccTools.aleaChainen(16, 16),
                                                new Date(System.currentTimeMillis()),
                                                (TpccTools.aleaNumber(1, 10) == 1) ? "BC" : "GC",
                                                500000.0, TpccTools.aleaDouble(0., 0.5, 4), -10.0, 10.0, 1, 0, TpccTools.aleaChainec(300, 500));


            boolean successful = false;
            while (!successful) {
               try {
                  newCustomer.store(basicCache);
                  successful = true;
               } catch (Throwable e) {
                  log.warn("Storing new customer failed", e);
               }
            }
View Full Code Here

Examples of org.simplecart.account.Customer

     * @return Customer object by ID
     * @param id
     * @param lock
     */
    public Customer findById(Long id, boolean lock) throws HibernateException {
        Customer customer = null;

        customer = (Customer) abstractFindById(id, lock);
        return customer;
    }
View Full Code Here

Examples of org.springframework.batch.sample.domain.order.Customer

  }

  @Test
  public void testValidCustomer() {
    Order order = new Order();
    Customer customer = new Customer();
    customer.setRegistered(false);
    customer.setBusinessCustomer(true);
    order.setCustomer(customer);

    Errors errors = new BeanPropertyBindingResult(order, "validOrder");
    orderValidator.validateCustomer(customer, errors);

    assertEquals(2, errors.getAllErrors().size());
    assertEquals("error.customer.registration", errors.getFieldError("customer.registered").getCode());
    assertEquals("error.customer.companyname", errors.getFieldError("customer.companyName").getCode());

    customer = new Customer();
    customer.setRegistered(true);
    customer.setBusinessCustomer(false);
    customer.setRegistrationId(Long.MIN_VALUE);
    order.setCustomer(customer);

    errors = new BeanPropertyBindingResult(order, "validOrder");
    orderValidator.validateCustomer(customer, errors);

    assertEquals(3, errors.getAllErrors().size());
    assertEquals("error.customer.firstname", errors.getFieldError("customer.firstName").getCode());
    assertEquals("error.customer.lastname", errors.getFieldError("customer.lastName").getCode());
    assertEquals("error.customer.registrationid", errors.getFieldError("customer.registrationId").getCode());

    customer = new Customer();
    customer.setRegistered(true);
    customer.setBusinessCustomer(false);
    customer.setRegistrationId(Long.MAX_VALUE);
    order.setCustomer(customer);

    errors = new BeanPropertyBindingResult(order, "validOrder");
    orderValidator.validateCustomer(customer, errors);

    assertEquals(3, errors.getAllErrors().size());
    assertEquals("error.customer.firstname", errors.getFieldError("customer.firstName").getCode());
    assertEquals("error.customer.lastname", errors.getFieldError("customer.lastName").getCode());
    assertEquals("error.customer.registrationid", errors.getFieldError("customer.registrationId").getCode());

    customer = new Customer();
    customer.setRegistered(true);
    customer.setBusinessCustomer(true);
    customer.setCompanyName("Acme Inc");
    customer.setRegistrationId(5L);
    order.setCustomer(customer);

    errors = new BeanPropertyBindingResult(order, "validOrder");
    orderValidator.validateCustomer(customer, errors);

    assertEquals(0, errors.getAllErrors().size());

    customer = new Customer();
    customer.setRegistered(true);
    customer.setBusinessCustomer(false);
    customer.setFirstName("John");
    customer.setLastName("Doe");
    customer.setRegistrationId(5L);
    order.setCustomer(customer);

    errors = new BeanPropertyBindingResult(order, "validOrder");
    orderValidator.validateCustomer(customer, errors);
View Full Code Here

Examples of org.springframework.data.jpa.showcase.core.Customer

  }

  @Test
  public void findsCustomerById() throws Exception {

    Customer customer = repository.findOne(2L);

    assertThat(customer.getFirstname(), is("Carter"));
    assertThat(customer.getLastname(), is("Beauford"));
  }
View Full Code Here

Examples of org.springframework.data.mongodb.examples.custsvc.domain.Customer

    @Autowired
    CustomerRepository customerRepository;

    @RequestMapping(method = RequestMethod.GET)
    public String setupForm(Model model) {
        Customer customer = new Customer();
        model.addAttribute("customer", customer);
        return "customer/newCustomerForm";
    }
View Full Code Here

Examples of org.springframework.integration.samples.loanbroker.domain.Customer

  public void runDemo() {
    ApplicationContext context =  new ClassPathXmlApplicationContext("META-INF/spring/integration/bootstrap-config/stubbed-loan-broker.xml");
    LoanBrokerGateway broker = context.getBean("loanBrokerGateway", LoanBrokerGateway.class);
    LoanRequest loanRequest = new LoanRequest();
    loanRequest.setCustomer(new Customer());
    LoanQuote loan = broker.getBestLoanQuote(loanRequest);
    logger.info("********* Best Quote *********\n" + loan);
    System.out.println("==============================");
    List<LoanQuote> loanQuotes = broker.getAllLoanQuotes(loanRequest);
    logger.info("********* All Quotes *********");
 
View Full Code Here

Examples of org.springframework.jdbc.Customer

        declareParameter(new SqlParameter(Types.NUMERIC));
        compile();
      }

      protected Object mapRow(ResultSet rs, int rownum) throws SQLException {
        Customer cust = new Customer();
        cust.setId(rs.getInt(COLUMN_NAMES[0]));
        cust.setForename(rs.getString(COLUMN_NAMES[1]));
        return cust;
      }

      public Customer findCustomer(int id, int otherNum) {
        return (Customer) findObject(id, otherNum);
      }
    }

    CustomerQuery query = new CustomerQuery(mockDataSource);
    Customer cust = query.findCustomer(1, 1);

    assertTrue("Customer id was assigned correctly", cust.getId() == 1);
    assertTrue(
      "Customer forename was assigned correctly",
      cust.getForename().equals("rod"));
  }
View Full Code Here

Examples of org.thymeleaf.itutorial.beans.Customer

        }
        return products;
    }

    public static Customer loadCustomer() {
        Customer customer = new Customer();
        customer.setId(Integer.valueOf(1085));
        customer.setFirstName("Peter");
        customer.setLastName("Jackson");
        customer.setGender(Gender.MALE);
        customer.setPaymentMethod(PaymentMethod.DIRECT_DEBIT);
        customer.setBalance(2500000);
        return customer;
    }
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.