mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add method and test
This commit is contained in:
parent
fa936f4742
commit
0a9b9a6fce
@ -8,6 +8,7 @@
|
||||
### 新特性
|
||||
* 【core 】 增加CollUtil.map方法
|
||||
* 【extra 】 增加Sftp.lsEntries方法,Ftp和Sftp增加recursiveDownloadFolder(pr#121@Gitee)
|
||||
* 【system 】 OshiUtil增加getNetworkIFs方法
|
||||
### Bug修复
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
@ -346,6 +346,9 @@ public class StrUtilTest {
|
||||
String str1 = "TableTestOfDay";
|
||||
String result1 = StrUtil.toCamelCase(str1);
|
||||
Assert.assertEquals("TableTestOfDay", result1);
|
||||
|
||||
String abc1d = StrUtil.toCamelCase("abc_1d");
|
||||
Assert.assertEquals("abc1d", abc1d);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
26
hutool-json/src/test/java/cn/hutool/json/Issue867Test.java
Normal file
26
hutool-json/src/test/java/cn/hutool/json/Issue867Test.java
Normal file
@ -0,0 +1,26 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.annotation.Alias;
|
||||
import lombok.Data;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class Issue867Test {
|
||||
|
||||
@Test
|
||||
public void toBeanTest(){
|
||||
String json = "{\"abc_1d\":\"123\",\"abc_d\":\"456\",\"abc_de\":\"789\"}";
|
||||
Test02 bean = JSONUtil.toBean(JSONUtil.parseObj(json),Test02.class);
|
||||
Assert.assertEquals("123", bean.getAbc1d());
|
||||
Assert.assertEquals("456", bean.getAbcD());
|
||||
Assert.assertEquals("789", bean.getAbcDe());
|
||||
}
|
||||
|
||||
@Data
|
||||
static class Test02 {
|
||||
@Alias("abc_1d")
|
||||
private String abc1d;
|
||||
private String abcD;
|
||||
private String abcDe;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import oshi.hardware.ComputerSystem;
|
||||
import oshi.hardware.GlobalMemory;
|
||||
import oshi.hardware.HWDiskStore;
|
||||
import oshi.hardware.HardwareAbstractionLayer;
|
||||
import oshi.hardware.NetworkIF;
|
||||
import oshi.hardware.Sensors;
|
||||
import oshi.software.os.OperatingSystem;
|
||||
|
||||
@ -98,4 +99,15 @@ public class OshiUtil {
|
||||
public static HWDiskStore[] getDiskStores() {
|
||||
return hardware.getDiskStores();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取网络相关信息,可能多块网卡
|
||||
* @return 网络相关信息
|
||||
* @since 5.3.5
|
||||
*/
|
||||
public static NetworkIF[] getNetworkIFs(){
|
||||
return hardware.getNetworkIFs();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user