details: https://code.openbravo.com/erp/devel/pi/rev/7971376bb0ad changeset: 27894:7971376bb0ad user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Mon Nov 16 11:16:11 2015 +0100 summary: Related to issue 31202: Fix testCostingE2 test in TestCosting
details: https://code.openbravo.com/erp/devel/pi/rev/ce8fad1f9f02 changeset: 27895:ce8fad1f9f02 user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Mon Nov 16 11:19:34 2015 +0100 summary: Related to issue 31069: Fix testCostingE3 test in TestCosting diffstat: src-test/src/org/openbravo/test/costing/TestCosting.java | 65 ++++++++------- 1 files changed, 35 insertions(+), 30 deletions(-) diffs (145 lines): diff -r 9bc23e1bab78 -r ce8fad1f9f02 src-test/src/org/openbravo/test/costing/TestCosting.java --- a/src-test/src/org/openbravo/test/costing/TestCosting.java Mon Nov 16 14:27:46 2015 +0100 +++ b/src-test/src/org/openbravo/test/costing/TestCosting.java Mon Nov 16 11:19:34 2015 +0100 @@ -8202,6 +8202,9 @@ final int day1 = 5; final int day2 = 10; final int day3 = 15; + final int day4 = 20; + final int day5 = 25; + final int day6 = 30; final BigDecimal price1 = new BigDecimal("4.00"); final BigDecimal price2 = new BigDecimal("3.00"); final BigDecimal price3 = new BigDecimal("3.3333"); @@ -8222,42 +8225,42 @@ // Create purchase order and book it Order purchaseOrder1 = createPurchaseOrder(product, price1, quantity1, day0); - // Create purchase order and book it - Order purchaseOrder2 = createPurchaseOrder(product, price2, quantity1, day0); - - // Create purchase order and book it - Order purchaseOrder3 = createPurchaseOrder(product, price2, quantity1, day0); - // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt1 = createGoodsReceipt(purchaseOrder1, price1, quantity1, - LOCATOR1_ID, day1); + LOCATOR1_ID, day0); + + // Create purchase order and book it + Order purchaseOrder2 = createPurchaseOrder(product, price2, quantity1, day1); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt2 = createGoodsReceipt(purchaseOrder2, price2, quantity1, LOCATOR2_ID, day1); + // Create purchase order and book it + Order purchaseOrder3 = createPurchaseOrder(product, price2, quantity1, day2); + // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt3 = createGoodsReceipt(purchaseOrder3, price2, quantity1, - LOCATOR3_ID, day1); + LOCATOR3_ID, day2); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment1 = createGoodsShipment(product, price3, quantity1, LOCATOR1_ID, - day2); + day3); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment2 = createGoodsShipment(product, price3, quantity1, LOCATOR2_ID, - day2); + day4); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment3 = createGoodsShipment(product, price3, quantity1, LOCATOR3_ID, - day2); - - // Create purchase order and book it - Order purchaseOrder4 = createPurchaseOrder(product, price4, quantity1, day3); + day5); + + // Create purchase order and book it + Order purchaseOrder4 = createPurchaseOrder(product, price4, quantity1, day6); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt4 = createGoodsReceipt(purchaseOrder4, price4, quantity1, - LOCATOR1_ID, day3); + LOCATOR1_ID, day6); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); @@ -8302,7 +8305,7 @@ List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(6), "NSC", - quantity1.multiply(price5).add(quantity1.multiply(price4).negate()), day3, true, false)); + quantity1.multiply(price5).add(quantity1.multiply(price4).negate()), day6, true, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); @@ -8336,6 +8339,8 @@ final int day1 = 5; final int day2 = 10; final int day3 = 15; + final int day4 = 20; + final int day5 = 25; final BigDecimal price1 = new BigDecimal("4.00"); final BigDecimal price2 = new BigDecimal("3.00"); final BigDecimal price3 = new BigDecimal("3.3333"); @@ -8356,33 +8361,33 @@ // Create purchase order and book it Order purchaseOrder1 = createPurchaseOrder(product, price1, quantity1, day0); - // Create purchase order and book it - Order purchaseOrder2 = createPurchaseOrder(product, price2, quantity1, day0); - - // Create purchase order and book it - Order purchaseOrder3 = createPurchaseOrder(product, price2, quantity1, day0); - - // Create goods receipt, run costing background, post it and assert it - ShipmentInOut goodsReceipt1 = createGoodsReceipt(purchaseOrder1, price1, quantity1, day1); + // Create goods receipt, run costing background, post it and assert it + ShipmentInOut goodsReceipt1 = createGoodsReceipt(purchaseOrder1, price1, quantity1, day0); + + // Create purchase order and book it + Order purchaseOrder2 = createPurchaseOrder(product, price2, quantity1, day1); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt2 = createGoodsReceipt(purchaseOrder2, price2, quantity1, day1); - // Create goods receipt, run costing background, post it and assert it - ShipmentInOut goodsReceipt3 = createGoodsReceipt(purchaseOrder3, price2, quantity1, day1); + // Create purchase order and book it + Order purchaseOrder3 = createPurchaseOrder(product, price2, quantity1, day2); + + // Create goods receipt, run costing background, post it and assert it + ShipmentInOut goodsReceipt3 = createGoodsReceipt(purchaseOrder3, price2, quantity1, day2); // Create goods shipment, run costing background, post it and assert it - ShipmentInOut goodsShipment1 = createGoodsShipment(product, price3, quantity1, day2); + ShipmentInOut goodsShipment1 = createGoodsShipment(product, price3, quantity1, day3); // Create goods shipment, run costing background, post it and assert it - ShipmentInOut goodsShipment2 = createGoodsShipment(product, price3, quantity1, day2); + ShipmentInOut goodsShipment2 = createGoodsShipment(product, price3, quantity1, day4); // Add sleep to avoid assert errors Thread.sleep(1000); // Create inventory amount update and run costing background InventoryAmountUpdate inventoryAmountUpdate = createInventoryAmountUpdate(product, price3, - price4, price5, quantity1, day3); + price4, price5, quantity1, day5); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); @@ -8427,7 +8432,7 @@ List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(5), "NSC", - quantity1.multiply(price4).add(quantity1.multiply(price3).negate()), day3, true, false)); + quantity1.multiply(price4).add(quantity1.multiply(price3).negate()), day5, true, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); ------------------------------------------------------------------------------ Presto, an open source distributed SQL query engine for big data, initially developed by Facebook, enables you to easily query your data on Hadoop in a more interactive manner. Teradata is also now providing full enterprise support for Presto. Download a free open source copy now. http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140 _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits