diff --git a/test/com/platform/test/ExcelTest.java b/test/com/platform/test/ExcelTest.java index 03e68ce3..a400c086 100644 --- a/test/com/platform/test/ExcelTest.java +++ b/test/com/platform/test/ExcelTest.java @@ -88,13 +88,16 @@ public class ExcelTest { File f = new File("D:/test/4.xlsx"); Date d = new Date(); XSSFWorkbook workbook = null; + List 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(); + 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()); } diff --git a/test/com/platform/test/MapTest.java b/test/com/platform/test/MapTest.java index b383a0bc..56219f0b 100644 --- a/test/com/platform/test/MapTest.java +++ b/test/com/platform/test/MapTest.java @@ -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 li = new ArrayList(); + Brick brick= new Brick("192", "/h2"); + li.add(brick); + Brick brick2= new Brick("193", "/h2"); + li.add(brick2); + + Map map = new HashMap(); + 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 errmap = new HashMap(); + List errArea = new ArrayList(); + errArea.add("aaa"); + if (errArea.size() > 0) { + errmap.put("err", errArea); + } + List errFile = new ArrayList(); +// errFile.add("file"); + if (errFile.size() > 0) { + if (errmap.containsKey("err")) { + errFile.addAll(errmap.get("err")); + } + errmap.put("err", errFile); + } + System.err.println(errmap); + } }