mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@75 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -36,7 +36,7 @@ import com.alibaba.druid.stat.JdbcResultSetStat;
|
||||
|
||||
public class CounterFilterTest extends TestCase {
|
||||
|
||||
String sql = "SELECT * FROM PATROL";
|
||||
String sql = "SELECT 1";
|
||||
|
||||
public void test_countFilter() throws Exception {
|
||||
DataSourceProxyConfig config = new DataSourceProxyConfig();
|
||||
@@ -72,6 +72,7 @@ public class CounterFilterTest extends TestCase {
|
||||
public void test_count_filter() throws Exception {
|
||||
DataSourceProxyConfig config = new DataSourceProxyConfig();
|
||||
config.setUrl("");
|
||||
config.setRawUrl("jdbc:mock:");
|
||||
|
||||
StatFilter filter = new StatFilter();
|
||||
|
||||
|
||||
@@ -60,6 +60,10 @@ public class JdbcUtilsTest extends TestCase {
|
||||
return types[column - 1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColumnName(int column) throws SQLException {
|
||||
return "C" + column;
|
||||
}
|
||||
};
|
||||
|
||||
MockResultSet rs = new MockResultSet(null) {
|
||||
|
||||
@@ -48,6 +48,7 @@ public class LogFilterTest extends TestCase {
|
||||
|
||||
public void test_logFilter_0() throws Exception {
|
||||
DataSourceProxyConfig config = new DataSourceProxyConfig();
|
||||
config.setRawUrl("jdbc:mock:");
|
||||
DataSourceProxyImpl dataSource = new DataSourceProxyImpl(new MockDriver(), config);
|
||||
|
||||
Log4jFilter log4jFilter = new Log4jFilter();
|
||||
@@ -96,6 +97,7 @@ public class LogFilterTest extends TestCase {
|
||||
|
||||
public void test_logFilter_1() throws Exception {
|
||||
DataSourceProxyConfig config = new DataSourceProxyConfig();
|
||||
config.setRawUrl("jdbc:mock:");
|
||||
DataSourceProxyImpl dataSource = new DataSourceProxyImpl(new MockDriver(), config);
|
||||
|
||||
Log4jFilter log4jFilter = new Log4jFilter();
|
||||
@@ -144,6 +146,7 @@ public class LogFilterTest extends TestCase {
|
||||
|
||||
public void test_logFilter_2() throws Exception {
|
||||
DataSourceProxyConfig config = new DataSourceProxyConfig();
|
||||
config.setRawUrl("jdbc:mock:");
|
||||
DataSourceProxyImpl dataSource = new DataSourceProxyImpl(new MockDriver(), config);
|
||||
|
||||
Log4jFilter log4jFilter = new Log4jFilter();
|
||||
@@ -261,7 +264,7 @@ public class LogFilterTest extends TestCase {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void executeSQL(DataSourceProxyImpl dataSource) throws SQLException {
|
||||
String sql = "SELECT * FROM PATROL";
|
||||
String sql = "SELECT 1";
|
||||
|
||||
Connection conn = dataSource.connect(new Properties());
|
||||
conn.commit();
|
||||
|
||||
@@ -31,13 +31,14 @@ import com.alibaba.druid.proxy.jdbc.ResultSetProxy;
|
||||
|
||||
public class ResultSetProxyImplTest extends TestCase {
|
||||
|
||||
String sql = "SELECT * FROM PATROL";
|
||||
String sql = "SELECT 1";
|
||||
|
||||
public void test_resultset() throws Exception {
|
||||
|
||||
MockDriver driver = new MockDriver();
|
||||
DataSourceProxyConfig config = new DataSourceProxyConfig();
|
||||
config.setUrl("");
|
||||
config.setRawUrl("jdbc:mock:");
|
||||
DataSourceProxyImpl dataSource = new DataSourceProxyImpl(driver, config);
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user