mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
增加 ExcelUtil getReader(String bookFilePath, String sheetName) 方法支持
This commit is contained in:
@@ -4,6 +4,9 @@ import cn.hutool.poi.excel.cell.CellLocation;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ExcelUtilTest {
|
||||
|
||||
@Test
|
||||
@@ -50,4 +53,12 @@ public class ExcelUtilTest {
|
||||
writer.writeCellValue(1, 2, "设置值");
|
||||
writer.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getReaderByBookFilePathAndSheetNameTest() {
|
||||
ExcelReader reader = ExcelUtil.getReader("aaa.xlsx", "12");
|
||||
List<Map<String, Object>> list = reader.readAll();
|
||||
reader.close();
|
||||
Assert.assertEquals(1L, list.get(1).get("鞋码"));
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user