Examples of SqlMapClientDaoSupport


Examples of org.springframework.orm.ibatis.support.SqlMapClientDaoSupport

  }

  public void testSqlMapClientDaoSupport() throws Exception {
    MockControl dsControl = MockControl.createControl(DataSource.class);
    DataSource ds = (DataSource) dsControl.getMock();
    SqlMapClientDaoSupport testDao = new SqlMapClientDaoSupport() {
    };
    testDao.setDataSource(ds);
    assertEquals(ds, testDao.getDataSource());

    MockControl clientControl = MockControl.createControl(SqlMapClient.class);
    SqlMapClient client = (SqlMapClient) clientControl.getMock();
    clientControl.replay();

    testDao.setSqlMapClient(client);
    assertEquals(client, testDao.getSqlMapClient());

    SqlMapClientTemplate template = new SqlMapClientTemplate();
    template.setDataSource(ds);
    template.setSqlMapClient(client);
    testDao.setSqlMapClientTemplate(template);
    assertEquals(template, testDao.getSqlMapClientTemplate());

    testDao.afterPropertiesSet();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.