mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
提交测试用例
This commit is contained in:
parent
11bf574aae
commit
056b501e8e
20
hutool-db/src/test/java/cn/hutool/db/nosql/MongoDBTest.java
Normal file
20
hutool-db/src/test/java/cn/hutool/db/nosql/MongoDBTest.java
Normal file
@ -0,0 +1,20 @@
|
||||
package cn.hutool.db.nosql;
|
||||
|
||||
import cn.hutool.db.nosql.mongo.MongoFactory;
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author VampireAchao
|
||||
*/
|
||||
public class MongoDBTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void redisDSTest() {
|
||||
MongoDatabase db = MongoFactory.getDS("master").getDb("test");
|
||||
Assert.assertEquals("test", db.getName());
|
||||
}
|
||||
}
|
20
hutool-db/src/test/resources/config/mongo.setting
Normal file
20
hutool-db/src/test/resources/config/mongo.setting
Normal file
@ -0,0 +1,20 @@
|
||||
#每个主机答应的连接数(每个主机的连接池大小),当连接池被用光时,会被阻塞住 ,默以为10 --int
|
||||
connectionsPerHost=100
|
||||
#线程队列数,它以connectionsPerHost值相乘的结果就是线程队列最大值。如果连接线程排满了队列就会抛出“Out of semaphores to get db”错误 --int
|
||||
threadsAllowedToBlockForConnectionMultiplier=10
|
||||
#被阻塞线程从连接池获取连接的最长等待时间(ms) --int
|
||||
maxWaitTime = 120000
|
||||
#在建立(打开)套接字连接时的超时时间(ms),默以为0(无穷) --int
|
||||
connectTimeout=0
|
||||
#套接字超时时间;该值会被传递给Socket.setSoTimeout(int)。默以为0(无穷) --int
|
||||
socketTimeout=0
|
||||
#是否打开长连接. defaults to false --boolean
|
||||
socketKeepAlive=false
|
||||
|
||||
#---------------------------------- MongoDB实例连接
|
||||
[master]
|
||||
host = 127.0.0.1:27017
|
||||
|
||||
[slave]
|
||||
host = 127.0.0.1:27018
|
||||
#-----------------------------------------------------
|
Loading…
Reference in New Issue
Block a user