mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修改测试代码
This commit is contained in:
parent
1b6a27aa89
commit
c36bc18937
@ -5,6 +5,9 @@ import org.junit.Assert;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class ExcelUtilTest {
|
public class ExcelUtilTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -38,7 +41,7 @@ public class ExcelUtilTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void toLocationTest(){
|
public void toLocationTest() {
|
||||||
final CellLocation a11 = ExcelUtil.toLocation("A11");
|
final CellLocation a11 = ExcelUtil.toLocation("A11");
|
||||||
Assert.assertEquals(0, a11.getX());
|
Assert.assertEquals(0, a11.getX());
|
||||||
Assert.assertEquals(10, a11.getY());
|
Assert.assertEquals(10, a11.getY());
|
||||||
@ -46,10 +49,15 @@ public class ExcelUtilTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
@Ignore
|
||||||
public void readAndWriteTest(){
|
public void readAndWriteTest() {
|
||||||
ExcelReader reader = ExcelUtil.getReader("d:\\test/select.xls");
|
String filepath = "d:\\test/select.xls";
|
||||||
ExcelWriter writer = reader.getWriter();
|
ExcelWriter writer = ExcelUtil.getWriter(filepath);
|
||||||
writer.writeCellValue(1, 2, "设置值");
|
writer.writeCellValue(1, 2, "设置值");
|
||||||
writer.close();
|
writer.close();
|
||||||
|
ExcelReader reader = ExcelUtil.getReader(filepath);
|
||||||
|
List<Map<String, Object>> map = reader.readAll();
|
||||||
|
reader.close();
|
||||||
|
Assert.assertNotNull(map);
|
||||||
|
Assert.assertFalse(map.isEmpty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user