use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class DataSourceXmlConfigTest method cloudDataSourceWithoutServiceNameSpecified_TwoMixedServiceExist_byType.
// Mixed relational services test (mysql+postgresql)
@Test(expected = BeanCreationException.class)
public void cloudDataSourceWithoutServiceNameSpecified_TwoMixedServiceExist_byType() {
ApplicationContext testContext = getTestApplicationContext(getWithoutServiceIdContextFileName(), createMysqlService("my-service"), createPostgresqlService("my-service-2"));
testContext.getBean("my-service", getConnectorType());
}
use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class DataSourceXmlConfigTest method cloudDataSourceWithMinMaxPool.
@Test
public void cloudDataSourceWithMinMaxPool() {
ApplicationContext testContext = getTestApplicationContext("cloud-datasource-with-config.xml", createService("my-service"));
DataSource ds = testContext.getBean("pool-config", getConnectorType());
DataSourceCloudConfigTestHelper.assertPoolProperties(ds, 30, 5, 3000);
}
use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class GenericServiceXmlConfigTest method cloudGenericServiceWithConnectorType.
@Test
public void cloudGenericServiceWithConnectorType() {
ApplicationContext testContext = getTestApplicationContext("cloud-generic-with-connector-type.xml", createService("my-service"));
assertNotNull("Getting service with connector type (specific service)", testContext.getBean("my-service-with-type-with-service-name", DataSource.class));
assertNotNull("Getting service with connector type (unique service)", testContext.getBean("my-service-with-type-without-service-name", DataSource.class));
}
use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class MongoDbFactoryXmlConfigTest method withConfigAllOptionsSpecifiedWriteConcernUnspecified.
@Test
public void withConfigAllOptionsSpecifiedWriteConcernUnspecified() {
ApplicationContext testContext = getTestApplicationContext("cloud-mongo-with-config.xml", createService("my-service"));
MongoDbFactory connector = testContext.getBean("service-maxWait200-connectionPerHost50-WriteConcernUnspecified", getConnectorType());
MongoDbFactoryCloudConfigTestHelper.assertConfigProperties(connector, null, 50, 200);
}
use of org.springframework.context.ApplicationContext in project spring-cloud-connectors by spring-cloud.
the class MongoDbFactoryXmlConfigTest method withConfigOnlyConnectionPerHostSpecified.
@Test
public void withConfigOnlyConnectionPerHostSpecified() {
ApplicationContext testContext = getTestApplicationContext("cloud-mongo-with-config.xml", createService("my-service"));
MongoDbFactory connector = testContext.getBean("service-maxWaitUnspecified-connectionPerHost50-WriteConcernUnspecified", getConnectorType());
MongoDbFactoryCloudConfigTestHelper.assertConfigProperties(connector, null, 50, null);
}
Aggregations