mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -44,36 +44,25 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
|
||||
private MockDriver driver;
|
||||
|
||||
private Properties connectProperties;
|
||||
|
||||
private long id;
|
||||
|
||||
private final long createdTimeMillis = System.currentTimeMillis();
|
||||
private long lastActiveTimeMillis = System.currentTimeMillis();
|
||||
private String url;
|
||||
|
||||
public MockConnection(){
|
||||
this(null, null, null);
|
||||
}
|
||||
|
||||
public MockConnection(MockDriver driver, String url, Properties connectProperties){
|
||||
super(url, connectProperties);
|
||||
|
||||
this.driver = driver;
|
||||
this.connectProperties = connectProperties;
|
||||
this.url = url;
|
||||
|
||||
if (driver != null) {
|
||||
this.id = driver.generateConnectionId();
|
||||
}
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public long getLastActiveTimeMillis() {
|
||||
return lastActiveTimeMillis;
|
||||
}
|
||||
@@ -94,10 +83,6 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
return driver;
|
||||
}
|
||||
|
||||
public Properties getConnectProperties() {
|
||||
return connectProperties;
|
||||
}
|
||||
|
||||
public void setDriver(MockDriver driver) {
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user