Package org.springframework.jdbc.datasource.embedded

Examples of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder


      return new DataSourceTransactionManager(dataSource());
    }

    @Bean
    public DataSource dataSource() {
      return new EmbeddedDatabaseBuilder()//
      .addScript("classpath:/org/springframework/test/context/junit4/spr9051/schema.sql")//
      // Ensure that this in-memory database is only used by this class:
      .setName(getClass().getName())//
      .build();
    }
View Full Code Here


      return new DataSourceTransactionManager(dataSource2());
    }

    @Bean
    public DataSource dataSource1() {
      return new EmbeddedDatabaseBuilder()//
      .setName("database1")//
      .addScript("classpath:/org/springframework/test/context/jdbc/schema.sql")//
      .addScript("classpath:/org/springframework/test/context/jdbc/data.sql")//
      .build();
    }
View Full Code Here

      .build();
    }

    @Bean
    public DataSource dataSource2() {
      return new EmbeddedDatabaseBuilder()//
      .setName("database2")//
      .addScript("classpath:/org/springframework/test/context/jdbc/schema.sql")//
      .addScript("classpath:/org/springframework/test/context/jdbc/data.sql")//
      .build();
    }
View Full Code Here

      return new DataSourceTransactionManager(dataSource());
    }

    @Bean
    public DataSource dataSource() {
      return new EmbeddedDatabaseBuilder()//
      .addScript("classpath:/org/springframework/test/context/testng/schema.sql")//
      .addScript("classpath:/org/springframework/test/context/testng/data.sql")//
      .build();
    }
View Full Code Here

      return new DataSourceTransactionManager(dataSource());
    }

    @Bean
    public DataSource dataSource() {
      return new EmbeddedDatabaseBuilder()//
      .setName("programmatic-tx-mgmt-test-db")//
      .addScript("classpath:/org/springframework/test/context/jdbc/schema.sql") //
      .build();
    }
View Full Code Here

      return new DataSourceTransactionManager(dataSource2());
    }

    @Bean
    public DataSource dataSource1() {
      return new EmbeddedDatabaseBuilder()//
      .setName("database1")//
      .addScript("classpath:/org/springframework/test/context/jdbc/schema.sql")//
      .addScript("classpath:/org/springframework/test/context/jdbc/data.sql")//
      .build();
    }
View Full Code Here

      .build();
    }

    @Bean
    public DataSource dataSource2() {
      return new EmbeddedDatabaseBuilder()//
      .setName("database2")//
      .addScript("classpath:/org/springframework/test/context/jdbc/schema.sql")//
      .addScript("classpath:/org/springframework/test/context/jdbc/data.sql")//
      .build();
    }
View Full Code Here

    return new DataSourceTransactionManager(dataSource());
  }

  @Bean
  public DataSource dataSource() {
    return new EmbeddedDatabaseBuilder()//
    .setName("empty-sql-scripts-test-db")//
    .build();
  }
View Full Code Here

      fail();
    } catch (IllegalArgumentException expected) {
      assertEquals("DataSource must not be null.", expected.getMessage());
    }

    factoryBean.setDataSource(new EmbeddedDatabaseBuilder().build());

    try {
      factoryBean.afterPropertiesSet();
      fail();
    } catch (IllegalArgumentException expected) {
View Full Code Here

  @EnableBatchProcessing
  public static class MultiListenerFaultTolerantTestConfiguration extends MultiListenerTestConfigurationSupport{

    @Bean
    public DataSource dataSource(){
      return new PooledEmbeddedDataSource(new EmbeddedDatabaseBuilder()
      .addScript("classpath:org/springframework/batch/core/schema-drop-hsqldb.sql")
      .addScript("classpath:org/springframework/batch/core/schema-hsqldb.sql")
      .setType(EmbeddedDatabaseType.HSQL)
      .build());
    }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder

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.