Code example for ArrayList

Methods: add

0
    private DruidDataSource dataSource;
 
    protected void setUp() throws Exception { 
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        List<Object> sqlList = new ArrayList<Object>();
        sqlList.add("select 123");
        sqlList.add(null);
        sqlList.add("");
 
        dataSource.setConnectionInitSqls(sqlList);
    } 
 
    protected void tearDown() throws Exception { 
        dataSource.close();
    } 
 
    public void testDefault() throws Exception { 
        Connection conn = dataSource.getConnection();
 
        MockConnection mockConn = conn.unwrap(MockConnection.class);