SQLUtils support addCondition & addSelectItem

This commit is contained in:
wenshao
2015-06-07 18:47:41 +08:00
parent f616dbfebe
commit fc4cdfacbd
15 changed files with 450 additions and 7 deletions
@@ -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");