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