mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
b90602746d
commit
4451a8451d
@ -2727,6 +2727,20 @@ public class CollUtil {
|
|||||||
throw new IllegalArgumentException(StrUtil.format("[{}] is not support to get empty!", collectionClass));
|
throw new IllegalArgumentException(StrUtil.format("[{}] is not support to get empty!", collectionClass));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除一个或多个集合内的元素,每个集合调用clear()方法
|
||||||
|
*
|
||||||
|
* @param collections 一个或多个集合
|
||||||
|
* @since 5.3.6
|
||||||
|
*/
|
||||||
|
public static void clear(Collection<?>... collections) {
|
||||||
|
for (Collection<?> collection : collections) {
|
||||||
|
if (isNotEmpty(collection)) {
|
||||||
|
collection.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------------------- Interface start
|
// ---------------------------------------------------------------------------------------------- Interface start
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1115,4 +1115,17 @@ public class MapUtil {
|
|||||||
// 不支持空集合的集合类型
|
// 不支持空集合的集合类型
|
||||||
throw new IllegalArgumentException(StrUtil.format("[{}] is not support to get empty!", mapClass));
|
throw new IllegalArgumentException(StrUtil.format("[{}] is not support to get empty!", mapClass));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除一个或多个Map集合内的元素,每个Map调用clear()方法
|
||||||
|
*
|
||||||
|
* @param maps 一个或多个Map
|
||||||
|
*/
|
||||||
|
public static void clear(Map<?, ?>... maps) {
|
||||||
|
for (Map<?, ?> map : maps) {
|
||||||
|
if (isNotEmpty(map)) {
|
||||||
|
map.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
15
hutool-db/src/test/java/cn/hutool/db/nosql/RedisDSTest.java
Normal file
15
hutool-db/src/test/java/cn/hutool/db/nosql/RedisDSTest.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package cn.hutool.db.nosql;
|
||||||
|
|
||||||
|
import cn.hutool.db.nosql.redis.RedisDS;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
import org.junit.Test;
|
||||||
|
import redis.clients.jedis.Jedis;
|
||||||
|
|
||||||
|
public class RedisDSTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Ignore
|
||||||
|
public void redisDSTest(){
|
||||||
|
final Jedis jedis = RedisDS.create().getJedis();
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ connectionTimeout = 2000
|
|||||||
# 读取超时,默认timeout
|
# 读取超时,默认timeout
|
||||||
soTimeout = 2000
|
soTimeout = 2000
|
||||||
# 密码,默认无
|
# 密码,默认无
|
||||||
password =
|
#password =
|
||||||
# 数据库序号,默认0
|
# 数据库序号,默认0
|
||||||
database = 0
|
database = 0
|
||||||
# 客户端名,默认"Hutool"
|
# 客户端名,默认"Hutool"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user