mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix test
This commit is contained in:
parent
458c38e421
commit
2eafa12b31
@ -85,7 +85,7 @@ public class ExcelSaxUtil {
|
|||||||
cellDataType = CellDataType.NULL;
|
cellDataType = CellDataType.NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object result;
|
Object result = null;
|
||||||
switch (cellDataType) {
|
switch (cellDataType) {
|
||||||
case BOOL:
|
case BOOL:
|
||||||
result = (value.charAt(0) != '0');
|
result = (value.charAt(0) != '0');
|
||||||
@ -117,7 +117,10 @@ public class ExcelSaxUtil {
|
|||||||
default:
|
default:
|
||||||
try {
|
try {
|
||||||
result = getNumberValue(value, numFmtString);
|
result = getNumberValue(value, numFmtString);
|
||||||
} catch (final NumberFormatException e) {
|
} catch (final NumberFormatException ignore) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if(null == result){
|
||||||
result = value;
|
result = value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.hutool.poi.excel;
|
package org.dromara.hutool.poi.excel;
|
||||||
|
|
||||||
import org.dromara.hutool.core.collection.CollUtil;
|
import org.dromara.hutool.core.collection.CollUtil;
|
||||||
|
import org.dromara.hutool.core.collection.ListUtil;
|
||||||
import org.dromara.hutool.core.convert.Convert;
|
import org.dromara.hutool.core.convert.Convert;
|
||||||
import org.dromara.hutool.core.io.IoUtil;
|
import org.dromara.hutool.core.io.IoUtil;
|
||||||
import org.dromara.hutool.core.io.file.FileUtil;
|
import org.dromara.hutool.core.io.file.FileUtil;
|
||||||
@ -217,14 +218,13 @@ public class ExcelSaxReadTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
//@Disabled
|
|
||||||
public void readBlankTest() {
|
public void readBlankTest() {
|
||||||
final File file = FileUtil.file("aaa.xlsx");
|
final File file = FileUtil.file("aaa.xlsx");
|
||||||
|
|
||||||
ExcelUtil.readBySax(file, 0, (sheetIndex, rowIndex, rowList) -> Console.log(rowList));
|
final List<List<Object>> list = ListUtil.of();
|
||||||
|
ExcelUtil.readBySax(file, 0, (sheetIndex, rowIndex, rowList) -> list.add(rowList));
|
||||||
|
|
||||||
Console.log("-------------------------------------");
|
Assertions.assertEquals("[, 女, , 43.22]", list.get(3).toString());
|
||||||
ExcelUtil.getReader(file).read().forEach(Console::log);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user