mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
11517597d4
commit
e117fe5b08
63
hutool-extra/src/test/java/org/dromara/hutool/extra/aop/IssueI74EX7Test.java
Executable file
63
hutool-extra/src/test/java/org/dromara/hutool/extra/aop/IssueI74EX7Test.java
Executable file
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||||
|
* Hutool is licensed under Mulan PSL v2.
|
||||||
|
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||||
|
* You may obtain a copy of Mulan PSL v2 at:
|
||||||
|
* http://license.coscl.org.cn/MulanPSL2
|
||||||
|
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||||
|
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||||
|
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the Mulan PSL v2 for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.dromara.hutool.extra.aop;
|
||||||
|
|
||||||
|
import org.dromara.hutool.core.lang.Console;
|
||||||
|
import org.dromara.hutool.extra.aop.aspects.SimpleAspect;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class IssueI74EX7Test {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void proxyTest() {
|
||||||
|
final SmsBlend smsBlend = new SmsBlendImpl(1);
|
||||||
|
ProxyUtil.proxy(smsBlend, new SimpleAspect(){
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean before(final Object target, final Method method, final Object[] args) {
|
||||||
|
Console.log("切面进入");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean after(final Object target, final Method method, final Object[] args, final Object returnVal) {
|
||||||
|
Console.log("代理Object:"+target.toString());
|
||||||
|
Console.log("代理方法:"+method.getName());
|
||||||
|
Console.log("代理参数:"+ Arrays.toString(args));
|
||||||
|
return super.after(target, method, args, returnVal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface SmsBlend{
|
||||||
|
void send();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class SmsBlendImpl implements SmsBlend{
|
||||||
|
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
public SmsBlendImpl(final int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void send() {
|
||||||
|
Console.log("sms send." + status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -208,7 +208,7 @@ public class ExcelReader extends ExcelBase<ExcelReader> {
|
|||||||
* @return 行的集合,一行使用List表示
|
* @return 行的集合,一行使用List表示
|
||||||
*/
|
*/
|
||||||
public List<List<Object>> read(final int startRowIndex, final int endRowIndex) {
|
public List<List<Object>> read(final int startRowIndex, final int endRowIndex) {
|
||||||
return read(startRowIndex, endRowIndex, true);
|
return read(startRowIndex, endRowIndex, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +38,7 @@ public class ExcelReadTest {
|
|||||||
reader.setHeaderAlias(headerAlias);
|
reader.setHeaderAlias(headerAlias);
|
||||||
|
|
||||||
// 读取list时默认首个非空行为标题
|
// 读取list时默认首个非空行为标题
|
||||||
final List<List<Object>> read = reader.read();
|
final List<List<Object>> read = reader.read(0, Integer.MAX_VALUE, true);
|
||||||
Assertions.assertEquals("userName", read.get(0).get(0));
|
Assertions.assertEquals("userName", read.get(0).get(0));
|
||||||
Assertions.assertEquals("storageName", read.get(0).get(1));
|
Assertions.assertEquals("storageName", read.get(0).get(1));
|
||||||
Assertions.assertEquals("checkPerm", read.get(0).get(2));
|
Assertions.assertEquals("checkPerm", read.get(0).get(2));
|
||||||
|
33
hutool-poi/src/test/java/org/dromara/hutool/poi/excel/Issue3120Test.java
Executable file
33
hutool-poi/src/test/java/org/dromara/hutool/poi/excel/Issue3120Test.java
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||||
|
* Hutool is licensed under Mulan PSL v2.
|
||||||
|
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||||
|
* You may obtain a copy of Mulan PSL v2 at:
|
||||||
|
* http://license.coscl.org.cn/MulanPSL2
|
||||||
|
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||||
|
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||||
|
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the Mulan PSL v2 for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.dromara.hutool.poi.excel;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Issue3120Test {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void readTest() {
|
||||||
|
final ExcelReader reader = ExcelUtil.getReader("issue3120.xlsx");
|
||||||
|
final List<List<Object>> read = reader.read(2, Integer.MAX_VALUE, false);
|
||||||
|
Assertions.assertEquals("[1, null, 100, null, 20]", read.get(0).toString());
|
||||||
|
Assertions.assertEquals("[32, null, 200, null, 30]", read.get(1).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
hutool-poi/src/test/resources/issue3120.xlsx
Executable file
BIN
hutool-poi/src/test/resources/issue3120.xlsx
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user