@Bean(destroyMethod = "shutdown")
 public DataSource dataSource() {
   EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
   factory.setDatabaseName("spring-social-showcase");
   factory.setDatabaseType(EmbeddedDatabaseType.H2);
   return factory.getDatabase();
 }
Esempio n. 2
0
 @Bean(destroyMethod = "shutdown")
 public DataSource dataSource() {
   EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
   factory.setDatabaseName("greenhouse");
   factory.setDatabaseType(EmbeddedDatabaseType.H2);
   return populateDatabase(factory.getDatabase());
 }
Esempio n. 3
0
 @Bean(destroyMethod = "shutdown")
 public DataSource h2DataSource() {
   EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
   factory.setDatabaseName("pilot");
   factory.setDatabaseType(EmbeddedDatabaseType.H2);
   factory.setDatabasePopulator(databasePopulator());
   return factory.getDatabase();
 }
 @Bean(destroyMethod = "shutdown")
 @Override
 public DataSource dataSource() {
   EmbeddedDatabaseFactory databaseFactory = new EmbeddedDatabaseFactory();
   databaseFactory.setDatabaseName("clients");
   databaseFactory.setDatabaseType(H2);
   return databaseFactory.getDatabase();
 }
 @Bean(destroyMethod = "shutdown")
 public DataSource dataSource() {
   EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
   factory.setDatabaseName("fuzzydb-sample-webapp");
   factory.setDatabaseType(EmbeddedDatabaseType.H2);
   factory.setDatabasePopulator(databasePopulator());
   return factory.getDatabase();
 }
 @Before
 public void setUp() {
   EmbeddedDatabaseFactory factory = new EmbeddedDatabaseFactory();
   if (testMySqlCompatiblity) {
     factory.setDatabaseConfigurer(new MySqlCompatibleH2DatabaseConfigurer());
   } else {
     factory.setDatabaseType(EmbeddedDatabaseType.H2);
   }
   ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
   populator.addScript(new ClassPathResource(getSchemaSql(), getClass()));
   factory.setDatabasePopulator(populator);
   database = factory.getDatabase();
   dataAccessor = new JdbcTemplate(database);
   connectionFactoryRegistry = new ConnectionFactoryRegistry();
   connectionFactory = new TestFacebookConnectionFactory();
   connectionFactoryRegistry.addConnectionFactory(connectionFactory);
   usersConnectionRepository =
       new JdbcUsersConnectionRepository(
           database, connectionFactoryRegistry, Encryptors.noOpText());
   if (!getTablePrefix().equals("")) {
     usersConnectionRepository.setTablePrefix(getTablePrefix());
   }
   connectionRepository = usersConnectionRepository.createConnectionRepository("1");
 }