?? teststockmanagementdatacactus1.java
字號:
}
//測試根據會計科目、記賬日期取得會計分錄賬套數據表記錄的方法
public void testGetAccountEntryLedgerByFillDate() throws Exception{
String accountName = "現金";
//創建日期類
java.util.Calendar date = java.util.Calendar.getInstance();
date.set(2004, 3, 5, 0, 0, 0);
date.set(java.util.Calendar.MILLISECOND, 0);
java.sql.Timestamp startDate = new java.sql.Timestamp(date.getTime().getTime());
date.set(2004, 3, 5, 23, 59, 59);
date.set(java.util.Calendar.MILLISECOND, 998);
java.sql.Timestamp endDate = new java.sql.Timestamp(date.getTime().getTime());
String[][] data = stockManagementData.getAccountEntryLedgerByFillDate("200404",
startDate, endDate, accountName);
this.assertEquals("", 5, data.length);
}
//測試撤消會計分錄賬套數據表記錄完成狀態的方法
public void testCancelAccountEntryLedger() throws Exception{
String ledgerDate = "200405";
int serialId = 3;
int onProcess = 1;
String remark = "該會計分錄已撤消.";
int result = stockManagementData.cancelOrRestoreAccountEntryLedger(
ledgerDate, serialId, onProcess, remark);
this.assertEquals("", 1, result);
}
//測試恢復會計分錄賬套數據表記錄完成狀態的方法
public void testRestoreAccountEntryLedger() throws Exception{
String ledgerDate = "200405";
int serialId = 3;
int onProcess = 0;
String remark = "該會計分錄已撤消.(恢復)";
int result = stockManagementData.cancelOrRestoreAccountEntryLedger(
ledgerDate, serialId, onProcess, remark);
this.assertEquals("", 1, result);
}
//測試會計分錄賬套數據表電子簽名的方法
public void testSignAccountEntryLedger() throws Exception{
String ledgerDate = "200405";
int serialId = 3;
String fieldName = "auditUser";
int onProcess = 2;
String userName = "jack";
String remark = "該會計分錄已撤消.(恢復)(電子簽名)";
int result = stockManagementData.signAccountEntryLedger(
ledgerDate, fieldName, userName, serialId, onProcess, remark);
this.assertEquals("", 1, result);
}
//測試會計分錄賬套數據表的取消電子簽名的方法
public void testUnSignAccountEntryLedger() throws Exception{
String ledgerDate = "200405";
int serialId = 3;
String fieldName = "auditUser";
int onProcess = 0;
String userName = "";
String remark = "該會計分錄已撤消.(恢復)(電子簽名)(取消電子簽名)";
int result = stockManagementData.signAccountEntryLedger(
ledgerDate, fieldName, userName, serialId, onProcess, remark);
this.assertEquals("", 1, result);
}
//測試會計分錄更新的方法
public void testUpdateAccountEntry() throws Exception{
String ledgerDate = "200405";
String[] accountEntry = {"5", "st20040500003", "jack", "", "2004-5-30 1:19:33",
"2004-6-1 11:42:25", "1", "備注"};
String[][] accountSubEntry = {{"18", "5", "0", "流動資產@@存貨@@10000002", "340"},
{"19", "5", "0", "流動資產@@存貨@@10000001", "340"},
{"20", "5", "1", "短期負債@@應付賬款@@供應商2", "680"}};
int result = stockManagementData.updateAccountEntry(ledgerDate,
accountEntry, accountSubEntry);
this.assertEquals("", 1, result);
}
//測試庫存賬套數據表電子簽名和更新完成狀態的方法
public void testSignStockLedgerAndSubForFinish() throws Exception{
String ledgerDate = "200405";
String fieldName = "checkUser";
String userName = "jack";
String orderId = "20040500058";
int onProcess = 2;
String remark = "商品調出單已驗收.";
int result = stockManagementData.signStockLedgerAndSubForFinish(ledgerDate,
fieldName, userName, orderId, onProcess, remark);
this.assertEquals("", 1, result);
}
//測試根據倉庫名字取得盤點數據的方法
public void testGetStocktakeQuantityByWarehouse() throws Exception{
String ledgerDate = "200405";
String warehouse = "倉庫1";
int onProcess = 2;
String[][] data = stockManagementData.getStocktakeQuantityByWarehouse(
ledgerDate, warehouse, onProcess);
this.assertEquals("", 4, data.length);
}
//測試根據倉庫名字匯總顯示商品數量和金額的方法
public void testGetStockByWarehouse() throws Exception{
String ledgerDate = "200405";
String warehouse = "倉庫1";
int onProcess = 2;
String[][] data = stockManagementData.getStockByWarehouse(
ledgerDate, warehouse, onProcess);
this.assertEquals("", 27, data.length);
}
//測試根據商品條形碼匯總顯示商品在各個倉庫的數量和金額的方法
public void testGetStockByGoodsBarcode() throws Exception{
String ledgerDate = "200405";
String goodsBarcode = "10000005";
int onProcess = 2;
String[][] data = stockManagementData.getStockByGoodsBarcode(
ledgerDate, goodsBarcode, onProcess);
this.assertEquals("", 8, data.length);
}
//測試查詢過期商品的方法
public void testGetStockByUsefulLife() throws Exception{
String ledgerDate = "200405";
String usefulLife = "2004-6-1";
int onProcess = 2;
String[][] data = stockManagementData.getStockByUsefulLife(
ledgerDate, usefulLife, onProcess);
this.assertEquals("", 3, data.length);
}
//測試創建銷售賬套數據表和銷售賬套明細數據表記錄的方法
public void testCreateSaleLedgerAndSub() throws Exception{
/*String ledgerDate = "200405";
String[] saleLedger = {
"", "0", "顧客", "jack", "", "", "", "2004-5-5", "2004-5-15",
"0", ""};
String[][] saleSubLedger = {{"", "", "10000001", "15.2", "10"},
{"", "", "10000002", "18.5", "17"}};
int result = stockManagementData.createSaleLedgerAndSub(ledgerDate, saleLedger, saleSubLedger);
this.assertEquals("", 1, result);*/
}
//測試更新銷售賬套數據表和銷售賬套明細數據表記錄的方法
public void testUpdateSaleLedgerAndSub() throws Exception{
String ledgerDate = "200405";
String[] saleLedger = {
"20040500001", "0", "顧客", "jack", "", "", "", "2004-5-6", "2004-5-6",
"0", ""};
String[][] saleSubLedger = {{"6", "20040500001", "10000001", "15.2", "3"},
{"7", "20040500001", "10000002", "18.5", "5"}};
int result = stockManagementData.updateSaleLedgerAndSub(ledgerDate, saleLedger, saleSubLedger);
this.assertEquals("", 1, result);
}
//測試銷售賬套數據表電子簽名和更新完成狀態的方法
public void testSignSaleLedgerAndSubForFinish() throws Exception{
String ledgerDate = "200405";
String fieldName = "counterUser";
String userName = "jack";
String orderId = "20040500001";
int onProcess = 1;
String remark = "銷售單已撤消.";
int result = stockManagementData.signSaleLedgerAndSub(ledgerDate,
fieldName, userName, orderId, onProcess, remark);
this.assertEquals("", 1, result);
}
//測試根據單據編號取得銷售賬套明細數據表的記錄
public void testGetSaleSubLedgerBySaleId() throws Exception{
//根據單據編號取得記錄
String[][] detail = stockManagementData.getSaleSubLedgerBySaleId(
"200404", "20040400001");
this.assertEquals("", 1, detail.length);
}
//測試根據字符串字段取得銷售賬套數據表記錄的方法
public void testGetSaleLedgerByStringField() throws Exception{
//根據單據編號取得記錄
String[][] detail = stockManagementData.getSaleLedgerByStringField(
"200404", "saleId", "2004", 0);
this.assertEquals("", 1, detail.length);
}
//測試根據填寫日期取得銷售賬套數據表記錄的方法
public void testGetSaleLedgerByOrderDate() throws Exception{
//創建日期類
java.util.Calendar date = java.util.Calendar.getInstance();
date.set(2004, 3, 10, 0, 0, 0);
date.set(java.util.Calendar.MILLISECOND, 0);
java.sql.Timestamp startDate = new java.sql.Timestamp(date.getTime().getTime());
date.set(2004, 3, 10, 23, 59, 59);
date.set(java.util.Calendar.MILLISECOND, 998);
java.sql.Timestamp endDate = new java.sql.Timestamp(date.getTime().getTime());
String[][] detail = stockManagementData.getSaleLedgerByOrderDate("200404", startDate, endDate, 1);
this.assertEquals("", 1, detail.length);
}
//測試根據完成狀態取得銷售賬套數據表的記錄
public void testGetSaleLedgerByOnProcess() throws Exception{
//根據完成狀態取得記錄
String[][] detail = stockManagementData.getSaleLedgerByOnProcess(
"200404", 1, 0);
this.assertEquals("", 1, detail.length);
}
//測試前臺銷售員進行銷售賬套數據表電子簽名的方法
public void testCounterUserSignSaleLedgerAndSub() throws Exception{
String ledgerDate = "200405";
String userName = "jack";
String remark = "已簽名";
String warehouse = "柜臺1";
int result = stockManagementData.counterUserSignSaleLedgerAndSub(ledgerDate,
userName, remark, warehouse);
this.assertEquals("", 1, result);
}
//測試信用銷售員進行銷售賬套數據表電子簽名的方法
public void testCreditUserSignSaleLedgerAndSub() throws Exception{
String ledgerDate = "200405";
String userName = "jack";
String remark = "已簽名";
String warehouse = "柜臺1";
String saleId = "20040500011";
String customerName = "客戶1";
int result = stockManagementData.creditUserSignSaleLedgerAndSub(ledgerDate,
userName, remark, warehouse, saleId, customerName);
this.assertEquals("", 1, result);
}
//測試現金管理員進行應收賬款電子簽名的方法
public void testCashUserSignAccountReceivable() throws Exception{
String ledgerDate = "200405";
String userName = "jack";
String[] currentAccountLedger = {"20040500012", "sa20040500011", "1", "466.5",
"客戶1", "jack", "", "2004-6-11 12:19:52", null, "0", "已簽名."};
int result = stockManagementData.cashUserSignAccountReceivable(ledgerDate,
userName, currentAccountLedger);
this.assertEquals("", 1, result);
}
//測試根據關聯標識、退貨單的商品條形碼取得庫存賬套的銷售出庫單明細賬的數據
public void testGetStockSaleOutBySaleOrderLink() throws Exception{
String ledgerDate = "200405";
String saleOrderLink = "sajack";
String saleId = "20040500015";
String[][] data = stockManagementData.getStockSaleOutBySaleOrderLink(
ledgerDate, saleOrderLink, saleId);
this.assertEquals("", 3, data.length);
}
//測試前臺銷售員進行銷售退貨單電子簽名的方法
public void testCountUserSignSaleReturn() throws Exception{
String ledgerDate = "200405";
String userName = "jack";
String remark = "已簽名";
String warehouse = "柜臺1";
String saleId = "20040500015";
//銷售退貨,庫存數量增加
String[][] stockSubLedger = {
{"", "", "10000001", "15.2", "1", "2004-05-20"},
};
int result = stockManagementData.counterUserSignSaleReturn(ledgerDate,
saleId, userName, remark, warehouse, stockSubLedger);
this.assertEquals("", 1, result);
}
//測試信用銷售員進行銷售退貨單電子簽名的方法
public void testCreditUserSignSaleReturn() throws Exception{
String ledgerDate = "200405";
String userName = "jack";
String remark = "已簽名";
String warehouse = "柜臺1";
String customerName = "客戶1";
String saleId = "20040500020";
//銷售退貨,庫存數量增加
String[][] stockSubLedger = {
{"", "", "10000001", "3.7", "10", "2004-11-5"},
};
int result = stockManagementData.creditUserSignSaleReturn(ledgerDate,
saleId, userName, remark, warehouse, customerName,stockSubLedger, true);
this.assertEquals("", 1, result);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -