test DruidDataSource testcase

This commit is contained in:
wenshao
2012-08-28 09:19:28 +08:00
parent 2689f9392e
commit 0c47d2a38d
2 changed files with 6 additions and 5 deletions
@@ -1398,11 +1398,10 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
}
// 35 - 39
map.put("ConnectionConnectCount", stat.getConnectionStat().getConnectCount());
Throwable lastConnectionError = stat.getConnectionStat().getErrorLast();
if (lastConnectionError != null) {
map.put("ConnectionErrorLastMessage", lastConnectionError.getMessage());
map.put("ConnectionErrorLastStackTrace", IOUtils.getStackTrace(lastConnectionError));
map.put("ConnectionConnectCount", createErrorCount);
if (createError != null) {
map.put("ConnectionErrorLastMessage", createError.getMessage());
map.put("ConnectionErrorLastStackTrace", IOUtils.getStackTrace(createError));
} else {
map.put("ConnectionErrorLastMessage", null);
map.put("ConnectionErrorLastStackTrace", null);
@@ -43,6 +43,8 @@ public class DruidDataSourceTest8 extends TestCase {
}
Assert.assertNotNull(error);
Assert.assertTrue(dataSource.getCreateErrorCount() > 0);
dataSource.getCompositeData();
}
}