orderMngmntWebapp\src\orderMngr\domain\order\OrderItem.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.domain.order;
 
 
import java.math.*; import javax.persistence.*;
import ...
 
10 
@Entity
11 
public class OrderItem
12 
{
13 
   @Id @GeneratedValue
14 
   private int id;
 
16 
   @ManyToOne
17 
   private Order order;
 
19 
   private String productId;
 
21 
   private String productDescription;
 
23 
   private int quantity;
 
25 
   private BigDecimal unitPrice;
 
270
   public OrderItem() {}
     
    29 
       public OrderItem(String productId, String productDescription, int quantity, BigDecimal unitPrice)
    30 
       {
    3113
          this(null, productId, productDescription, quantity, unitPrice);
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    7. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 40
    8. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 83
    9. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 67
    10. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 96
    3213
       }
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    7. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 40
    8. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 83
    9. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 67
    10. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 96
     
    34 
       public OrderItem(
    35 
          Order order, String productId, String productDescription, int quantity, BigDecimal unitPrice)
    3619
       {
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
    7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
    9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
    3719
          this.order = order;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
    7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
    9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
    3819
          this.productId = productId;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
    7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
    9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
    3919
          this.productDescription = productDescription;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
    7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
    9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
    4019
          this.quantity = quantity;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
    7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
    9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
    4119
          this.unitPrice = unitPrice;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
    7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
    9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
    4219
       }
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
    2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
    3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
    4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
    5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
    6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
    7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
    9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
     
    44 
       public int getId()
    45 
       {
    460
          return id;
      47 
         }
       
      49 
         public Order getOrder()
      50 
         {
      510
            return order;
        52 
           }
         
        54 
           public String getProductId()
        55 
           {
        567
              return productId;
        1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
        2. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        3. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
        4. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
        5. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 71
        57 
           }
         
        59 
           public String getProductDescription()
        60 
           {
        617
              return productDescription;
        1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
        2. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        3. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
        4. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
        5. orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 72
        62 
           }
         
        64 
           public int getQuantity()
        65 
           {
        6617
              return quantity;
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 33x2
        2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93x2
        3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 83x2
        4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 38x2
        5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 75x2
        6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
        7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
        9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
        67 
           }
         
        69 
           public BigDecimal getUnitPrice()
        70 
           {
        7116
              return unitPrice;
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 33x2
        2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93x2
        3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 83x2
        4. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 38x2
        5. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 75
        6. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
        7. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        8. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
        9. orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
        72 
           }
         
        74 
           @Override
        75 
           public boolean equals(Object o)
        76 
           {
        6 Path coverage: 2/4 A: 4 B: 0 C: 0 D: 2
        776
              if (this == o) return true;
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 38x2
        2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
        3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 41x2
        4. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 38x2
        2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 41x2
        782
              if (o == null || getClass() != o.getClass()) return false;
        1. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
        2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
        1. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
        2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
           
          802
                OrderItem orderItem = (OrderItem) o;
          1. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
          2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
           
          822
                return productId.equals(orderItem.productId);
          1. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
          2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
          83 
             }
           
          85 
             @Override
          86 
             public int hashCode()
          87 
             {
          886
                return productId.hashCode();
          1. orderMngr.domain.order.OrderFactoryTest#createOrder: 33x2
          2. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93x2
          3. orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 38x2
          89 
             }
          90 
          }