Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.DelegatingDataSource


  /**
   * Test method for {@link com.jolbox.bonecp.spring.DynamicDataSourceProxy#DynamicDataSourceProxy(javax.sql.DataSource)}.
   */
  @Test
  public void testDynamicDataSourceProxyDataSource() {
    DelegatingDataSource mockDataSource = createNiceMock(DelegatingDataSource.class);
    DynamicDataSourceProxy ddsp = new DynamicDataSourceProxy(mockDataSource);
    assertEquals(mockDataSource, ddsp.getTargetDataSource());
  }
View Full Code Here


  public void testSwitchDataSource() throws SQLException, ClassNotFoundException {

    BoneCPDataSource mockDataSource = createNiceMock(BoneCPDataSource.class);
    DynamicDataSourceProxy ddsp = new DynamicDataSourceProxy();
    // Test #1: Check for correct instance.
    ddsp.setTargetDataSource(new DelegatingDataSource());
    try{
      ddsp.switchDataSource(null);
      fail("Should throw an exception");
    } catch(SQLException e){
      // do nothing
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.datasource.DelegatingDataSource

Copyright © 2018 www.massapicom. 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.