mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add testcase
This commit is contained in:
@@ -17,10 +17,8 @@ package com.alibaba.druid.pool;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.druid.stat.JdbcSqlStatValue;
|
||||
import com.alibaba.druid.support.json.JSONUtils;
|
||||
|
||||
public class DruidDataSourceStatValue {
|
||||
|
||||
@@ -81,27 +79,6 @@ public class DruidDataSourceStatValue {
|
||||
|
||||
protected List<JdbcSqlStatValue> sqlList;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void fromJSON(String json) {
|
||||
// protected String dbType;
|
||||
// protected String driverClassName;
|
||||
// protected String url;
|
||||
// protected String userName;
|
||||
// protected List<String> filterClassNames;
|
||||
// protected boolean removeAbandoned;
|
||||
//
|
||||
Map<String, Object> map = (Map<String, Object>) JSONUtils.parse(json);
|
||||
fromJSON(map);
|
||||
}
|
||||
|
||||
public void fromJSON(Map<String, Object> map) {
|
||||
this.name = (String) map.get("name");
|
||||
this.dbType = (String) map.get("dbType");
|
||||
this.driverClassName = (String) map.get("driverClassName");
|
||||
this.url = (String) map.get("url");
|
||||
this.userName = (String) map.get("userName");
|
||||
}
|
||||
|
||||
public Date getPoolingPeakTime() {
|
||||
if (poolingPeakTime <= 0) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user