use of org.apache.commons.dbcp.BasicDataSource in project elastic-job by dangdangdotcom.
the class JobEventRdbConfigurationTest method assertCreateJobEventListenerSuccess.
@Test
public void assertCreateJobEventListenerSuccess() throws JobEventListenerConfigurationException {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(org.h2.Driver.class.getName());
dataSource.setUrl("jdbc:h2:mem:job_event_storage");
dataSource.setUsername("sa");
dataSource.setPassword("");
assertThat(new JobEventRdbConfiguration(dataSource).createJobEventListener(), instanceOf(JobEventRdbListener.class));
}
use of org.apache.commons.dbcp.BasicDataSource in project elastic-job by dangdangdotcom.
the class JobEventRdbSearchTest method setUpClass.
@BeforeClass
public static void setUpClass() throws SQLException {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(org.h2.Driver.class.getName());
dataSource.setUrl("jdbc:h2:mem:");
dataSource.setUsername("sa");
dataSource.setPassword("");
storage = new JobEventRdbStorage(dataSource);
repository = new JobEventRdbSearch(dataSource);
initStorage();
}
use of org.apache.commons.dbcp.BasicDataSource in project elastic-job by dangdangdotcom.
the class StatisticRdbRepositoryTest method setup.
@Before
public void setup() throws SQLException {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(org.h2.Driver.class.getName());
dataSource.setUrl("jdbc:h2:mem:");
dataSource.setUsername("sa");
dataSource.setPassword("");
repository = new StatisticRdbRepository(dataSource);
}
use of org.apache.commons.dbcp.BasicDataSource in project sharding-jdbc by dangdangdotcom.
the class Main method createDataSource.
private static DataSource createDataSource(final String dataSourceName) {
BasicDataSource result = new BasicDataSource();
result.setDriverClassName(com.mysql.jdbc.Driver.class.getName());
result.setUrl(String.format("jdbc:mysql://localhost:3306/%s", dataSourceName));
result.setUsername("root");
result.setPassword("");
return result;
}
use of org.apache.commons.dbcp.BasicDataSource in project sharding-jdbc by dangdangdotcom.
the class AbstractSoftTransactionIntegrationTest method createDataSource.
private DataSource createDataSource(final String dataSourceName) {
BasicDataSource result = new BasicDataSource();
result.setDriverClassName(org.h2.Driver.class.getName());
result.setUrl("jdbc:h2:mem:" + dataSourceName);
result.setUsername("sa");
result.setPassword("");
return result;
}
Aggregations