mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
SQLUtils support addCondition & addSelectItem
This commit is contained in:
@@ -51,7 +51,9 @@ public class DruidStatServiceTest extends TestCase {
|
||||
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
DruidStatService.getInstance().setResetEnable(true);
|
||||
// DruidStatService is singleton, reset all for other testcase.
|
||||
DruidStatService.getInstance().service("/reset-all.json");
|
||||
// clear web app.
|
||||
@@ -127,6 +129,10 @@ public class DruidStatServiceTest extends TestCase {
|
||||
}
|
||||
|
||||
public void test_statService_getDataSourceList() throws Exception {
|
||||
{
|
||||
DruidStatService.getInstance().service("/reset-all.json");
|
||||
}
|
||||
|
||||
String sql = "select 1";
|
||||
Connection conn = dataSource.getConnection();
|
||||
|
||||
|
||||
@@ -155,6 +155,7 @@ public class DruidStatServiceTest2 extends TestCase {
|
||||
}
|
||||
|
||||
public void test_statService_getDataSourceList() throws Exception {
|
||||
DruidStatService.getInstance().service("/reset-all.json");
|
||||
String result = DruidStatService.getInstance().service("/datasource.json");
|
||||
Map<String, Object> resultMap = (Map<String, Object>) JSONUtils.parse(result);
|
||||
List<Map<String, Object>> dataSourceList = (List<Map<String, Object>>) resultMap.get("Content");
|
||||
|
||||
Reference in New Issue
Block a user