orderMngmntWebapp\src\orderMngr\web\submitOrder\OrderEntryPage.java
 
/* * Copyright (c) 2006-2014 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */
/*...*/
5 
package orderMngr.web.submitOrder;
 
 
import java.math.*; import java.util.*; import orderMngr.domain.order.*;
import ...
 
126
public final class OrderEntryPage
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 21
13 
{
14 
   // Data accumulated before submitting the order:
15 
   private String customerId;
16 
   private List<OrderItem> orderItems;
 
18 
   // Parameters for adding an order item:
19 
   private String productId;
20 
   private String productDescription;
21 
   private int quantity;
22 
   private BigDecimal unitPrice;
 
24 
   // Item index for removing an item:
25 
   private int itemToRemove;
 
27 
   // Resulting data when the order is submitted:
28 
   private int orderNo;
 
30 
   public void load()
31 
   {
326
      orderItems = new ArrayList<>(5);
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 22
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 38
  3. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 82
  4. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 66
  5. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrderWithMissingData: 105
  6. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 95
33 
      // use some web MVC framework service to retrieve item data, either from request parameters
34 
      // or from the HTTPSession
356
   }
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 22
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 38
  3. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 82
  4. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 66
  5. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrderWithMissingData: 105
  6. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 95
 
372
   public void setCustomerId(String customerId) { this.customerId = customerId; }
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 25
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 39
 
399
   public List<OrderItem> getOrderItems() { return orderItems; }
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26, 31
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 40, 43
  3. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 83, 87
  4. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 69, 70
  5. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 96
 
411
   public void setProductId(String productId) { this.productId = productId; }
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 58
 
431
   public void setProductDescription(String productDescription) { this.productDescription = productDescription; }
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 60
 
451
   public void setQuantity(int quantity) { this.quantity = quantity; }
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 62
 
471
   public void setUnitPrice(BigDecimal unitPrice) { this.unitPrice = unitPrice; }
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 64
 
492
   public void setItemToRemove(int itemToRemove) { this.itemToRemove = itemToRemove; }
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 81
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 94
 
515
   public int getOrderNo() { return orderNo; }
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 27, 38
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 42, 45
  3. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrderWithMissingData: 112
 
53 
   public void addItem()
54 
   {
551
      OrderItem item = new OrderItem(productId, productDescription, quantity, unitPrice);
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 67
561
      orderItems.add(item);
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 67
571
   }
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 67
 
59 
   public void removeItem()
60 
   {
612
      orderItems.remove(itemToRemove);
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 85
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 98
621
   }
  1. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 85
 
64 
   public void submitOrder() throws Exception
65 
   {
663
      Order order = new OrderFactory().createOrder(customerId, orderItems);
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 36
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 43
  3. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrderWithMissingData: 108
672
      orderNo = order.getNumber();
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 36
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 43
682
   }
  1. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 36
  2. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 43
69 
}