测试文件

This commit is contained in:
chenlw 2016-12-13 09:49:16 +08:00
parent 348a8e3c76
commit 08dd21dc36
2 changed files with 45 additions and 1 deletions

View File

@ -88,13 +88,16 @@ public class ExcelTest {
File f = new File("D:/test/4.xlsx");
Date d = new Date();
XSSFWorkbook workbook = null;
List<String> rowErr = null;
try {
workbook = new XSSFWorkbook(f);
list = ExcelOperation.readExcel4Update(workbook, Constant.EXCEL_TEMPLATE_INIT_ROW, 0, PreDataInfo.class, "workRange","id","sysCode","updateTime");
rowErr = new ArrayList<String>();
list = ExcelOperation.readExcel4Update(workbook, Constant.EXCEL_TEMPLATE_INIT_ROW, 0, f.getName(), rowErr ,new PreDataInfo(), "id", "dataId", "workRange","sysCode","updateTime","userTablespaceStatus", "checkoutIndicateStatus", "checkoutPayStatus", "userTablespacePath", "checkoutIndicatePath", "checkoutPayPath", "sqlList", "dataVersion", "collectingTime", "collUpdate");
} catch (IllegalArgumentException
| IllegalAccessException | InstantiationException | InvalidFormatException | IOException e) {
e.printStackTrace();
}
System.out.println(rowErr);
System.err.println(new Date().getTime() - d.getTime());
System.out.println("----"+list.size());
}

View File

@ -1,6 +1,8 @@
package com.platform.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
@ -27,5 +29,44 @@ public class MapTest {
System.out.println(map.get("/home/gfs_ftp_point/boliang/oracle/320312_97/3-/pengbl_test2/sql_data/320305_34/320312_97/"));
}
@Test
public void testRemove() {
List<Brick> li = new ArrayList<Brick>();
Brick brick= new Brick("192", "/h2");
li.add(brick);
Brick brick2= new Brick("193", "/h2");
li.add(brick2);
Map<String, Object> map = new HashMap<String, Object>();
for (Brick b : li) {
map.put(b.getIp(), b);
}
map.remove("193");
System.out.println(map.size());
System.out.println(li.size());
li.remove(0);
System.out.println(map.size());
System.out.println(li.size());
}
@Test
public void testMapPut() {
Map<String, List> errmap = new HashMap<String, List>();
List<String> errArea = new ArrayList<String>();
errArea.add("aaa");
if (errArea.size() > 0) {
errmap.put("err", errArea);
}
List<String> errFile = new ArrayList<String>();
// errFile.add("file");
if (errFile.size() > 0) {
if (errmap.containsKey("err")) {
errFile.addAll(errmap.get("err"));
}
errmap.put("err", errFile);
}
System.err.println(errmap);
}
}