mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add test and add methods
This commit is contained in:
parent
895a1448cf
commit
c5ab974441
@ -3,9 +3,11 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.8.4.M1 (2022-06-10)
|
||||
# 5.8.4.M1 (2022-06-12)
|
||||
|
||||
### 🐣新特性
|
||||
* 【extra 】 Sftp增加构造重载,支持超时(pr#653@Gitee)
|
||||
*
|
||||
### 🐞Bug修复
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
@ -127,6 +127,7 @@ public class JschUtil {
|
||||
* @param passphrase 私钥文件的密码,可以为null
|
||||
* @param timeOut 超时时间,单位毫秒
|
||||
* @return SSH会话
|
||||
* @since 5.8.4
|
||||
*/
|
||||
public static Session openSession(String sshHost, int sshPort, String sshUser, String privateKeyPath, byte[] passphrase, int timeOut) {
|
||||
final Session session = createSession(sshHost, sshPort, sshUser, privateKeyPath, passphrase);
|
||||
|
@ -31,7 +31,7 @@ import java.util.Vector;
|
||||
*
|
||||
* <p>
|
||||
* 此类为基于jsch的SFTP实现<br>
|
||||
* 参考:https://www.cnblogs.com/longyg/archive/2012/06/25/2556576.html
|
||||
* 参考:<a href="https://www.cnblogs.com/longyg/archive/2012/06/25/2556576.html">https://www.cnblogs.com/longyg/archive/2012/06/25/2556576.html</a>
|
||||
* </p>
|
||||
*
|
||||
* @author looly
|
||||
|
23
hutool-json/src/test/java/cn/hutool/json/Issue2377Test.java
Normal file
23
hutool-json/src/test/java/cn/hutool/json/Issue2377Test.java
Normal file
@ -0,0 +1,23 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Issue2377Test {
|
||||
|
||||
@Test
|
||||
public void bytesTest(){
|
||||
Object[] paramArray = new Object[]{ 1,new byte[]{10,11}, "报表.xlsx"};
|
||||
String paramsStr = JSONUtil.toJsonStr(paramArray);
|
||||
|
||||
List<Object> paramList = JSONUtil.toList(paramsStr, Object.class);
|
||||
|
||||
String paramBytesStr = JSONUtil.toJsonStr(paramList.get(1));
|
||||
|
||||
final byte[] convert = Convert.convert(byte[].class, paramBytesStr);
|
||||
Assert.assertArrayEquals((byte[])paramArray[1], convert);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user