Package org.springframework.jdbc.datasource.embedded

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


  private JdbcTemplate jdbcTemplate;

  private JdbcInviteRepository inviteRepository;
 
  public JdbcInviteRepositoryTest() {
    EmbeddedDatabase db = new GreenhouseTestDatabaseBuilder().member().activity().invite().testData(getClass()).getDatabase();
    transactional = new Transactional(db);
    jdbcTemplate = new JdbcTemplate(db);
    JdbcActionRepository actionRepository = new JdbcActionRepository(jdbcTemplate, new ActionGateway() {
      public void actionPerformed(Action action) {
      }
View Full Code Here


  private JdbcAccountRepository accountRepository;

  private JdbcTemplate jdbcTemplate;

  public JdbcAccountRepositoryTest() {
    EmbeddedDatabase db = new GreenhouseTestDatabaseBuilder().member().testData(getClass()).getDatabase();
    transactional = new Transactional(db);
    jdbcTemplate = new JdbcTemplate(db);
    AccountMapper accountMapper = new AccountMapper(new StubFileStorage(), "http://localhost:8080/members/{profileKey}");
    accountRepository = new JdbcAccountRepository(jdbcTemplate, NoOpPasswordEncoder.getInstance(), accountMapper);
  }
View Full Code Here

        beanFactory.registerSingleton("myTransactionManager", createPlatformTransactionManager(dataSource));

    }

    public DataSource createDataSource() {
        EmbeddedDatabase dataSource = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2).build();
        return dataSource;
    }
View Full Code Here

  @Bean(name = "dataSource")
  DataSource dataSource() {
    logger.info("Setting up database");

    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).
        addScript("schema.sql").
        addScript("test-data.sql").build();

    this.db = db;
View Full Code Here

  @Test
  public void runUpgrader() {
    EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
    factory.setDatabaseType(EmbeddedDatabaseType.H2);
    EmbeddedDatabase db = factory.getDatabase();
    System.setProperty("security.encryptPassword", "foo");
    System.setProperty("security.encryptSalt", new String(Hex.encode(KeyGenerators.secureRandom().generateKey())));
    DatabaseUpgrader installer = new DatabaseUpgrader(db, new StandardEnvironment(), Encryptors.noOpText());
    installer.run();
    installer.run();
View Full Code Here

  private JdbcAppRepository appRepository;

  private JdbcTemplate jdbcTemplate;

  public JdbcAppRepositoryTest() {
    EmbeddedDatabase db = new GreenhouseTestDatabaseBuilder().member().connectedApp().testData(getClass()).getDatabase();
    transactional = new Transactional(db);
    jdbcTemplate = new JdbcTemplate(db);
    appRepository = new JdbcAppRepository(jdbcTemplate, Encryptors.noOpText());   
  }
View Full Code Here

  @Test
  public void mem() throws Exception {
    Environment env = createMock(Environment.class);
    expect(env.getRequiredProperty("db")).andReturn("mem");

    EmbeddedDatabase datasource = createMock(EmbeddedDatabase.class);

    EmbeddedDatabaseBuilder embeddedDatabaseBuilder =
        PowerMock.createMockAndExpectNew(EmbeddedDatabaseBuilder.class);
    expect(embeddedDatabaseBuilder.setType(EmbeddedDatabaseType.H2)).andReturn(
        embeddedDatabaseBuilder);
View Full Code Here

TOP

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

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.