?? teststockmanagementdatacactus1.java
字號:
String[][] detail = stockManagementData.getGoodsByGoodsCategory(goodsCategory);
this.assertEquals("", 2, detail.length);
}
//測試根據(jù)條形碼取得商品的方法
public void testFindByGoodsBarCode() throws Exception {
String goodsBarCode = "1";
String[][] detail = stockManagementData.getGoodsByGoodsBarCode(goodsBarCode);
this.assertEquals("", 2, detail.length);
}
//測試根據(jù)商品名字取得商品的方法
public void testFindByGoodsName() throws Exception {
String goodsName = "商品";
String[][] detail = stockManagementData.getGoodsByGoodsName(goodsName);
this.assertEquals("", 2, detail.length);
}
//測試根據(jù)生產(chǎn)廠商取得商品的方法
public void testFindByProducer() throws Exception {
String goodsName = "生產(chǎn)廠商";
String[][] detail = stockManagementData.getGoodsByProducer(goodsName);
this.assertEquals("", 2, detail.length);
}
//測試設(shè)置商品折扣的方法
public void testSetGoodsDiscount() throws Exception {
String goodsBarCode = "10000001";
double discount = 0.85;
int result = stockManagementData.setGoodsDiscount(goodsBarCode, discount);
this.assertEquals("return value", 1, result);
}
//測試取得折扣商品的方法
public void testFindDiscountGoods() throws Exception {
String[][] detail = stockManagementData.getDiscountGoods();
this.assertEquals("", 2, detail.length);
}
//測試商品刪除方法
public void testGoodsDelete() throws Exception {
/*String goodsBarCode = "10000001";
int result = stockManagementData.deleteGoods(goodsBarCode);
this.assertEquals("return value", 1, result);
goodsBarCode = "10000002";
result = stockManagementData.deleteGoods(goodsBarCode);
this.assertEquals("return value", 1, result);*/
}
//測試供應(yīng)商創(chuàng)建方法
public void testSupplierCreate() throws Exception{
//創(chuàng)建供應(yīng)商數(shù)組
String[] supplier = new String[]{"測試供應(yīng)商1", "南部", "拼音碼1", "簡稱1", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址1", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "備注1"};
//創(chuàng)建供應(yīng)商
int result = stockManagementData.createSupplier(supplier);
this.assertEquals("", 1, result);
supplier = new String[]{"測試供應(yīng)商2", "北部", "拼音碼2", "簡稱2", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址2", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "備注2"};
//創(chuàng)建供應(yīng)商
result = stockManagementData.createSupplier(supplier);
this.assertEquals("", 1, result);
supplier = new String[]{"測試供應(yīng)商3", "南部", "拼音碼3", "簡稱3", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址3", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "備注3"};
//創(chuàng)建供應(yīng)商
result = stockManagementData.createSupplier(supplier);
this.assertEquals("", 1, result);
}
//測試供應(yīng)商更新方法
public void testSupplierUpdate() throws Exception{
String[] supplier = new String[]{"測試供應(yīng)商1", "北部", "拼音碼1", "簡稱1", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址1", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "備注1"};
//更新供應(yīng)商的值
int result = stockManagementData.updateSupplier(supplier);
this.assertEquals("", 1, result);
}
//測試根據(jù)供應(yīng)商名字取得記錄的方法
public void testFindBySupplierName() throws Exception {
String[][] detail = stockManagementData.getSuppliersBySupplierName("%供應(yīng)商%");
this.assertEquals("", 3, detail.length);
}
//測試根據(jù)地區(qū)取得記錄的方法
public void testFindBySupplierZone() throws Exception {
String[][] detail = stockManagementData.getSuppliersBySupplierZone("%北部%");
this.assertEquals("", 2, detail.length);
}
//測試供應(yīng)商刪除方法
public void testSupplierDelete() throws Exception{
String[] suppliers = new String[]{"測試供應(yīng)商1", "測試供應(yīng)商2", "測試供應(yīng)商3"};
//刪除供應(yīng)商
int result = stockManagementData.deleteSupplier(suppliers[0]);
this.assertEquals("", 1, result);
//刪除供應(yīng)商
result = stockManagementData.deleteSupplier(suppliers[1]);
this.assertEquals("", 1, result);
//刪除供應(yīng)商
result = stockManagementData.deleteSupplier(suppliers[2]);
this.assertEquals("", 1, result);
}
//測試客戶創(chuàng)建方法
public void testCustomerCreate() throws Exception {
//創(chuàng)建客戶數(shù)組
String[] customer = new String[] {
"測試客戶1", "南部", "拼音碼1", "簡稱1", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址1", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "10000", "備注1"};
//創(chuàng)建客戶
int result = stockManagementData.createCustomer(customer);
this.assertEquals("", 1, result);
customer = new String[] {
"測試客戶2", "北部", "拼音碼2", "簡稱2", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址2", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "10000", "備注2"};
//創(chuàng)建客戶
result = stockManagementData.createCustomer(customer);
this.assertEquals("", 1, result);
customer = new String[] {
"測試客戶3", "南部", "拼音碼3", "簡稱3", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址3", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "10000", "備注3"};
//創(chuàng)建客戶
result = stockManagementData.createCustomer(customer);
this.assertEquals("", 1, result);
}
//測試客戶更新方法
public void testCustomerUpdate() throws Exception {
String[] customer = new String[] {
"測試客戶1", "北部", "拼音碼1", "簡稱1", "021-556892",
"張凡", "1350058956", "021-896523", "021-963258", "地址1", "511896",
"中行", "銀行帳號", "jack@hotmail.com", "www.jack.com", "10000", "備注1"};
//更新客戶的值
int result = stockManagementData.updateCustomer(customer);
this.assertEquals("", 1, result);
}
//測試根據(jù)客戶名字取得記錄的方法
public void testFindByCustomerName() throws Exception {
String[][] detail = stockManagementData.getCustomersByCustomerName("%客戶%");
this.assertEquals("", 6, detail.length);
}
//測試根據(jù)地區(qū)取得記錄的方法
public void testFindByCustomerZone() throws Exception {
String[][] detail = stockManagementData.getCustomersByCustomerZone("%北部%");
this.assertEquals("", 4, detail.length);
}
//測試設(shè)置客戶信用的方法
public void testSetCustomerCreditLimit() throws Exception{
String customerName = "測試客戶1";
double creditlimit = 0;
int result = stockManagementData.setCreditCustomer(customerName, creditlimit);
this.assertEquals("", 1, result);
}
//測試取得信用客戶記錄的方法
public void testFindCreditCustomer() throws Exception {
String[][] detail = stockManagementData.getCreditCustomer();
this.assertEquals("", 5, detail.length);
}
//測試客戶刪除方法
public void testCustomerDelete() throws Exception {
String[] customers = new String[] {
"測試客戶1", "測試客戶2", "測試客戶3"};
//刪除客戶
int result = stockManagementData.deleteCustomer(customers[0]);
this.assertEquals("", 1, result);
//刪除客戶
result = stockManagementData.deleteCustomer(customers[1]);
this.assertEquals("", 1, result);
//刪除客戶
result = stockManagementData.deleteCustomer(customers[2]);
this.assertEquals("", 1, result);
}
//測試創(chuàng)建倉庫的方法
public void testWarehouseCreate() throws Exception{
String[] warehouse = new String[]{"測試倉庫1", "拼單碼1", "第1廠區(qū)", "描述1"};
//創(chuàng)建倉庫
int result = stockManagementData.createWarehouse(warehouse);
this.assertEquals("", 1, result);
warehouse = new String[]{"測試倉庫2", "拼單碼2", "第2廠區(qū)", "描述2"};
//創(chuàng)建倉庫
result = stockManagementData.createWarehouse(warehouse);
this.assertEquals("", 1, result);
warehouse = new String[]{"測試倉庫3", "拼單碼3", "第3廠區(qū)", "描述3"};
//創(chuàng)建倉庫
result = stockManagementData.createWarehouse(warehouse);
this.assertEquals("", 1, result);
}
//測試修改倉庫的方法
public void testWarehouseUpdate() throws Exception{
String[] warehouseArray = new String[]{"測試倉庫1", "拼單碼1(u)", "第1廠區(qū)(u)", "描述1(u)"};
//更新倉庫
int result = stockManagementData.updateWarehouse(warehouseArray);
this.assertEquals("", 1, result);
}
//測試取得全部記錄的方法
public void testWarehouseFindAll() throws Exception {
String[][] returnValue = stockManagementData.getAllWarehouse();
this.assertEquals("", 3, returnValue.length);
}
//測試刪除倉庫的方法
public void testWarehouseDelete() throws Exception{
String[] warehouseArray = new String[]{"測試倉庫1", "測試倉庫2", "測試倉庫3"};
//刪除倉庫
int result = stockManagementData.deleteWarehouse(warehouseArray[0]);
this.assertEquals("", 1, result);
//刪除倉庫
result = stockManagementData.deleteWarehouse(warehouseArray[1]);
this.assertEquals("", 1, result);
//刪除倉庫
result = stockManagementData.deleteWarehouse(warehouseArray[2]);
this.assertEquals("", 1, result);
}
//測試創(chuàng)建會計科目的方法
/*public void testAccountNameCreate() throws Exception{
//創(chuàng)建會計科目
int result = stockManagementData.createAccountName(0, "流動資產(chǎn)");
this.assertEquals("", 1, result);
//創(chuàng)建會計科目
result = stockManagementData.createAccountName(0, "固定資產(chǎn)");
this.assertEquals("", 1, result);
//創(chuàng)建會計科目
result = stockManagementData.createAccountName(1, "現(xiàn)金");
this.assertEquals("", 1, result);
//創(chuàng)建會計科目
result = stockManagementData.createAccountName(1, "銀行存款");
this.assertEquals("", 1, result);
}
//測試修改會計科目的方法
public void testAccountNameUpdate() throws Exception{
int result = stockManagementData.updateAccountName(1, 0, "流動資產(chǎn)(更新)");
this.assertEquals("", 1, result);
}
//測試取得全部記錄的方法
public void testAccountNameFindAll() throws Exception {
String[][] returnValue = stockManagementData.getAllAccountName();
this.assertEquals("", 4, returnValue.length);
}
//測試根據(jù)父標識取得記錄的方法
public void testAccountNameFindByParentId() throws Exception {
String[][] returnValue = stockManagementData.getAccountNameByParentid(1);
this.assertEquals("", 2, returnValue.length);
}
//測試刪除會計科目的方法
public void testAccountNameDelete() throws Exception{
int result = stockManagementData.deleteAccountName(1);
//由于流動資產(chǎn)科目有子科目,所以不能進行刪除操作
this.assertEquals("", 0, result);
//刪除會計科目
result = stockManagementData.deleteAccountName(2);
this.assertEquals("", 1, result);
result = stockManagementData.deleteAccountName(3);
this.assertEquals("", 1, result);
result = stockManagementData.deleteAccountName(4);
this.assertEquals("", 1, result);
result = stockManagementData.deleteAccountName(1);
this.assertEquals("", 1, result);
}*/
//測試取得科目余額的方法
public void testGetAccountBalance() throws Exception {
String ledgerDate = "200404";
int onProcess = 0;
String[][] returnValue = stockManagementData.getAccountBalance(ledgerDate, onProcess);
this.assertEquals("", 2, returnValue.length);
}
//測試根據(jù)操作程序名字取得日志記錄的方法
public void testUserLogFindByProgramName() throws Exception{
String[][] detail = stockManagementData.getUserLogByProgramName("%登陸窗口%");
this.assertEquals("", 105, detail.length);
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -