Author: mbrohl
Date: Sun Dec 10 09:08:34 2017
New Revision: 1817677
URL: http://svn.apache.org/viewvc?rev=1817677&view=rev
Log:
Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.product.test.
(OFBIZ-9809)
Thanks Julian Leichert for reporting and providing the patch.
Modified:
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/InventoryItemTransferTest.java
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/StockMovesTest.java
Modified:
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/InventoryItemTransferTest.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/InventoryItemTransferTest.java?rev=1817677&r1=1817676&r2=1817677&view=diff
==============================================================================
---
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/InventoryItemTransferTest.java
(original)
+++
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/InventoryItemTransferTest.java
Sun Dec 10 09:08:34 2017
@@ -31,7 +31,7 @@ import org.apache.ofbiz.service.testtool
public class InventoryItemTransferTest extends OFBizTestCase {
protected GenericValue userLogin = null;
- protected static String inventoryTransferId = null;
+ static String inventoryTransferId = null;
protected BigDecimal transferQty = BigDecimal.ONE;
public InventoryItemTransferTest(String name) {
@@ -59,12 +59,12 @@ public class InventoryItemTransferTest e
ctx.put("xferQty", transferQty);
ctx.put("userLogin", userLogin);
Map<String, Object> resp =
dispatcher.runSync("createInventoryTransfer", ctx);
- inventoryTransferId = (String) resp.get("inventoryTransferId");
+ setInventoryTransferId((String) resp.get("inventoryTransferId"));
assertNotNull(inventoryTransferId);
// transfer
ctx = new HashMap<String, Object>();
- ctx.put("inventoryTransferId", inventoryTransferId);
+ ctx.put("inventoryTransferId", getInventoryTransferId());
ctx.put("inventoryItemId", inventoryItemId);
ctx.put("statusId", "IXF_COMPLETE");
ctx.put("userLogin", userLogin);
@@ -72,4 +72,12 @@ public class InventoryItemTransferTest e
String respMsg = (String) resp.get("responseMessage");
assertNotSame("error", respMsg);
}
+
+ public static String getInventoryTransferId() {
+ return inventoryTransferId;
+ }
+
+ public static void setInventoryTransferId(String inventoryTransferId) {
+ InventoryItemTransferTest.inventoryTransferId = inventoryTransferId;
+ }
}
Modified:
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/StockMovesTest.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/StockMovesTest.java?rev=1817677&r1=1817676&r2=1817677&view=diff
==============================================================================
---
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/StockMovesTest.java
(original)
+++
ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/test/StockMovesTest.java
Sun Dec 10 09:08:34 2017
@@ -53,7 +53,7 @@ public class StockMovesTest extends OFBi
public void testStockMoves() throws Exception {
Map<String, Object> fsmnCtx = new HashMap<String, Object>();
Map<?,?> stockMoveHandled = null;
- List<?> warningList = new LinkedList();
+ List<?> warningList;
fsmnCtx.put("facilityId", "WebStoreWarehouse");
fsmnCtx.put("userLogin", userLogin);