org.springframework.cloud.service.common.OracleServiceInfo Java Examples

The following examples show how to use org.springframework.cloud.service.common.OracleServiceInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CloudFoundryConnectorOracleServiceTest.java    From spring-cloud-connectors with Apache License 2.0 5 votes vote down vote up
@Test
public void oracleServiceCreation() {
	when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
			.thenReturn(getServicesPayload(
					getUserProvidedServicePayload(SERVICE_NAME, hostname, port, username, password, INSTANCE_NAME, ORACLE_SCHEME + ":")));
	List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();

	ServiceInfo info = getServiceInfo(serviceInfos, SERVICE_NAME);
	assertServiceFoundOfType(info, OracleServiceInfo.class);
	assertJdbcUrlEqual(info, ORACLE_SCHEME, INSTANCE_NAME);
	assertUriBasedServiceInfoFields(info, ORACLE_SCHEME, hostname, port, username, password, INSTANCE_NAME);
}
 
Example #2
Source File: CloudFoundryConnectorOracleServiceTest.java    From spring-cloud-connectors with Apache License 2.0 5 votes vote down vote up
@Test
public void oracleServiceCreationWithNoUri() {
	when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
			.thenReturn(getServicesPayload(
					getUserProvidedServicePayloadWithNoUri(SERVICE_NAME, hostname, port, username, password, INSTANCE_NAME)));
	List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();

	ServiceInfo info = getServiceInfo(serviceInfos, SERVICE_NAME);
	assertNotNull(info);
	assertFalse(OracleServiceInfo.class.isAssignableFrom(info.getClass()));  // service was not detected as MySQL
	assertNotNull(info);
}
 
Example #3
Source File: CloudFoundryConnectorOracleServiceTest.java    From spring-cloud-connectors with Apache License 2.0 5 votes vote down vote up
@Test
public void oracleServiceCreationWithJdbcUrl() {
	when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
			.thenReturn(getServicesPayload(
					getOracleServicePayloadWithJdbcurl(SERVICE_NAME, hostname, port, username, password, INSTANCE_NAME, ORACLE_SCHEME + ":")));
	List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();

	ServiceInfo info = getServiceInfo(serviceInfos, SERVICE_NAME);
	assertServiceFoundOfType(info, OracleServiceInfo.class);
	assertJdbcUrlEqual(info, ORACLE_SCHEME, INSTANCE_NAME);
	assertUriBasedServiceInfoFields(info, ORACLE_SCHEME, hostname, port, username, password, INSTANCE_NAME);
}
 
Example #4
Source File: LocalConfigConnectorOracleServiceTest.java    From spring-cloud-connectors with Apache License 2.0 5 votes vote down vote up
@Test
public void serviceCreation() {
	List<ServiceInfo> services = connector.getServiceInfos();
	ServiceInfo service = getServiceInfo(services, "oracle");
	assertNotNull(service);
	assertTrue(service instanceof OracleServiceInfo);
	assertUriParameters((OracleServiceInfo) service);
}
 
Example #5
Source File: OracleDataSourceFactoryTest.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
public OracleServiceInfo getTestServiceInfo(String id) {
	return new OracleServiceInfo(id, "oracle://username:pass@host:port/db");
}
 
Example #6
Source File: OracleServiceCreatorTest.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
@Override
public OracleServiceInfo createServiceInfo() {
	when(mockOracleServiceInfo.getJdbcUrl()).thenReturn("oracle://myuser:[email protected]:5432/database-123");
	
	return mockOracleServiceInfo;
}
 
Example #7
Source File: OracleServiceInfoCreator.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
public OracleServiceInfoCreator() {
	super(new Tags(), OracleServiceInfo.ORACLE_SCHEME);
}
 
Example #8
Source File: OracleServiceInfoCreator.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
@Override
public OracleServiceInfo createServiceInfo(String id, String url, String jdbcUrl) {
	return new OracleServiceInfo(id, url, jdbcUrl);
}
 
Example #9
Source File: OracleServiceInfoCreator.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
public OracleServiceInfoCreator() {
	super(OracleServiceInfo.ORACLE_SCHEME);
}
 
Example #10
Source File: OracleServiceInfoCreator.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
@Override
public OracleServiceInfo createServiceInfo(String id, String uri) {
	return new OracleServiceInfo(id,uri);
}