Examples of OrderDTO


Examples of de.fhdw.ify208.ticketmaster.common.model.OrderDTO

  }

  @Test
  public void placeOrder() {
    // TODO Auto-generated method stub
    OrderDTO result = new OrderDTO();
    EventDTO event = new EventDTO();
    CustomerDTO customer = new CustomerDTO();
    AddressDTO shipaddress = new AddressDTO();
    AddressDTO billaddress = new AddressDTO();
    int quantity=1;
   
    event.setid(new Long(1));
    customer.setid(new Long(10));
    shipaddress.setid(new Long(7));
    billaddress.setid(new Long(7));
    result = _theOrderManager.placeOrder(event, customer, shipaddress, billaddress, quantity);
    Assert.assertTrue("Place order:",result.getReturncode() == 0);
   
    quantity=2;
    event.setid(new Long(2));
    customer.setid(new Long(10));
    shipaddress.setid(new Long(7));
    billaddress.setid(new Long(7));
    result = _theOrderManager.placeOrder(event, customer, shipaddress, billaddress, quantity);
    Assert.assertTrue("No tickets left:",result.getReturncode() != 0);
  }
View Full Code Here

Examples of org.company.recordshop.service.dto.OrderDto

  OrderDto toDto(final Order source, final Map<Object, Object> translated) {
    if (translated.containsKey((source))) {
      return (OrderDto) translated.get(source);
    }
    Assert.notNull(source, "argument [source] may not be null");
    OrderDto result = new OrderDto(source.getId(), source.getVersion());
    result.setOrderNumber(source.getOrderNumber());
    result.setOrderDate(source.getOrderDate());
    result.setDeliveryDateTime(source.getDeliveryDateTime());
    result.setDiscountPercentage(source.getDiscountPercentage());
    result.setTotalAmount(source.getTotalAmount());

    translated.put(source, result);

    return result;
  }
View Full Code Here

Examples of org.company.recordshop.service.dto.OrderDto

    public void setUp() {
        createdCustomer = createCustomer("Johan", "Vogelzang", 12345);
        createCustomer("Jos", "Warmer", 3);
        createCustomer("Eric Jan", "Malotaux", 44);

        OrderDto order = new OrderDto();
        order.setOrderNumber("ISO 001");
        order.setDiscountPercentage(50);
        createdOrder = orderService.readOrderAsOrderDto(orderService.createOrder(order));
    }
View Full Code Here

Examples of org.company.recordshop.service.dto.OrderDto

        order.setDiscountPercentage(50);
        createdOrder = orderService.readOrderAsOrderDto(orderService.createOrder(order));
    }

    public void setupMore() {
        OrderDto order2 = new OrderDto();
        order2.setOrderNumber("ISO 002");
        order2.setOrderDate(new DateTime(2008, 1, 1, 1, 1, 0, 0));
        OrderDto createdOrder2 = orderService.readOrderAsOrderDto(orderService.createOrder(order2));
        customerService.addToOrders(createdCustomer, createdOrder2);

        order2 = new OrderDto();
        order2.setOrderNumber("ISO 003");
        order2.setOrderDate(new DateTime(2008, 1, 1, 1, 1, 0, 0));
        createdOrder2 = orderService.readOrderAsOrderDto(orderService.createOrder(order2));
        customerService.addToOrders(createdCustomer, createdOrder2);

        order2 = new OrderDto();
        order2.setOrderNumber("ISO 004");
        order2.setOrderDate(new DateTime(2008, 1, 1, 1, 1, 0, 0));
        createdOrder2 = orderService.readOrderAsOrderDto(orderService.createOrder(order2));
        customerService.addToOrders(createdCustomer, createdOrder2);
    }
View Full Code Here

Examples of org.company.recordshop.service.dto.OrderDto

            int nr = simpleCustomerDto.getCustomerNr();
            List<OrderNumberAndDateDto> orders = customerService.getOrders(simpleCustomerDto);
            if (createdCustomer.getId() == simpleCustomerDto.getId()) {
                Assert.assertTrue(orders.size() == 3);
                for (OrderNumberAndDateDto order : orders) {
                    OrderDto orderDto = new OrderDto(order.getId(), order.getVersion());
                    SimpleCustomerDto customer = customerService.getCustomer(orderDto);
                    Assert.assertTrue(simpleCustomerDto.getId() == customer.getId());
                }
            } else {
                Assert.assertTrue(orders.size() == 0);
View Full Code Here

Examples of org.company.recordshop.service.dto.OrderDto

    }

    @Test
    @ExpectedException(IllegalArgumentException.class)
    public final void testAddNonExistingOrder() {
        customerService.addToOrders(createdCustomer, new OrderDto(-1L, 0));
        customerService.addToOrders(new SimpleCustomerDto(-1L, 0), createdOrder);
    }
View Full Code Here

Examples of org.company.recordshop.service.dto.OrderDto

    }

    @Test
    public final void testRemoveOrder() {
        customerService.addToOrders(createdCustomer, createdOrder);
        OrderDto newOrder = orderService.readOrderAsOrderDto(createdOrder.getId());
        customerService.removeFromOrders(createdCustomer, newOrder);

        OrderNumberAndDateDto o2 = orderService.readOrderAsOrderNumberAndDateDto(createdOrder
                .getId());
        SimpleCustomerDto orderCustomer2 = o2.getCustomer();
View Full Code Here

Examples of org.company.recordshop.service.dto.OrderDto

    }

    @Test(expected = IllegalArgumentException.class)
    public final void testRemoveOrderFailure() {
        customerService.addToOrders(createdCustomer, createdOrder);
        OrderDto newOrder = orderService.readOrderAsOrderDto(createdOrder.getId());
        customerService.removeFromOrders(null, newOrder);
        customerService.removeFromOrders(createdCustomer, null);
    }
View Full Code Here

Examples of org.libreplan.importers.OrderDTO

        InputStream file;

        try {
            file = new FileInputStream(filename);

            OrderDTO importData = orderImporter.getImportData(file, filename);

            assertEquals(importData.name, "T1R1FCT2R2");

            assertEquals(importData.tasks.size(), 2);
View Full Code Here

Examples of org.libreplan.importers.OrderDTO

        InputStream file;

        try {
            file = new FileInputStream(filename);

            OrderDTO importData = orderImporter.getImportData(file, filename);

            assertEquals(importData.tasks.size(), 2);

            assertEquals(importData.tasks.get(0).name, "Tarea1");
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.