@xtreme-allan: Switched indentation to tabs instead of spaces.

This commit is contained in:
Allan Baril
2015-02-23 12:15:12 -05:00
parent e689f15739
commit 085f1033fc
4 changed files with 39 additions and 39 deletions

View File

@@ -21,7 +21,7 @@ public class AmqpServiceInfoCreator extends CloudFoundryServiceInfoCreator<AmqpS
String id = (String) serviceData.get("name");
String uri = getUriFromCredentials(credentials);
String managementUri = getStringFromCredentials(credentials, "http_api_uri");
String managementUri = getStringFromCredentials(credentials, "http_api_uri");
return new AmqpServiceInfo(id, uri, managementUri);
}

View File

@@ -30,33 +30,33 @@ public class CloudFoundryConnectorAmqpServiceTest extends AbstractCloudFoundryCo
assertServiceFoundOfType(serviceInfos, "rabbit-2", AmqpServiceInfo.class);
}
@Test
public void rabbitServiceCreationWithManagementUri() {
when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
.thenReturn(getServicesPayload(
getRabbitServicePayloadWithTags("rabbit-1", hostname, port, username, password, "q-1", "vhost1")));
@Test
public void rabbitServiceCreationWithManagementUri() {
when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
.thenReturn(getServicesPayload(
getRabbitServicePayloadWithTags("rabbit-1", hostname, port, username, password, "q-1", "vhost1")));
String expectedManagementUri = "http://" + username + ":" + password + "@" + hostname + "/api";
String expectedManagementUri = "http://" + username + ":" + password + "@" + hostname + "/api";
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
assertServiceFoundOfType(serviceInfos, "rabbit-1", AmqpServiceInfo.class);
AmqpServiceInfo amqpServiceInfo = (AmqpServiceInfo) serviceInfos.get(0);
assertEquals(amqpServiceInfo.getManagementUri(), expectedManagementUri);
}
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
assertServiceFoundOfType(serviceInfos, "rabbit-1", AmqpServiceInfo.class);
AmqpServiceInfo amqpServiceInfo = (AmqpServiceInfo) serviceInfos.get(0);
assertEquals(amqpServiceInfo.getManagementUri(), expectedManagementUri);
}
@Test
public void rabbitServiceCreationWithoutManagementUri() {
when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
.thenReturn(getServicesPayload(
getRabbitServicePayloadNoLabelNoTags("rabbit-1", hostname, port, username, password, "q-1", "vhost1")));
@Test
public void rabbitServiceCreationWithoutManagementUri() {
when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
.thenReturn(getServicesPayload(
getRabbitServicePayloadNoLabelNoTags("rabbit-1", hostname, port, username, password, "q-1", "vhost1")));
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
assertServiceFoundOfType(serviceInfos, "rabbit-1", AmqpServiceInfo.class);
AmqpServiceInfo amqpServiceInfo = (AmqpServiceInfo) serviceInfos.get(0);
assertNull(amqpServiceInfo.getManagementUri());
}
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
assertServiceFoundOfType(serviceInfos, "rabbit-1", AmqpServiceInfo.class);
AmqpServiceInfo amqpServiceInfo = (AmqpServiceInfo) serviceInfos.get(0);
assertNull(amqpServiceInfo.getManagementUri());
}
@Test
@Test
public void rabbitServiceCreationWithoutTags() {
when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
.thenReturn(getServicesPayload(

View File

@@ -5,6 +5,6 @@
"tags":["amqp","rabbitmq"],
"credentials":{
"uri": "amqp://$username:$password@$hostname/$virtualHost",
"http_api_uri": "http://$user:$pass@$hostname/api"
"http_api_uri": "http://$user:$pass@$hostname/api"
}
}

View File

@@ -18,24 +18,24 @@ public class AmqpServiceInfo extends UriBasedServiceInfo {
public static final String AMQP_SCHEME = "amqp";
public static final String AMQPS_SCHEME = "amqps";
private String managementUri;
private String managementUri;
public AmqpServiceInfo(String id, String host, int port, String username, String password, String virtualHost) {
this(id, host, port, username, password, virtualHost, null);
}
public AmqpServiceInfo(String id, String host, int port, String username, String password, String virtualHost, String managementUri) {
super(id, AMQP_SCHEME, host, port, username, password, virtualHost);
this.managementUri = managementUri;
public AmqpServiceInfo(String id, String host, int port, String username, String password, String virtualHost) {
this(id, host, port, username, password, virtualHost, null);
}
public AmqpServiceInfo(String id, String uri) throws CloudException {
this(id, uri, null);
}
public AmqpServiceInfo(String id, String host, int port, String username, String password, String virtualHost, String managementUri) {
super(id, AMQP_SCHEME, host, port, username, password, virtualHost);
this.managementUri = managementUri;
}
public AmqpServiceInfo(String id, String uri, String managementUri) throws CloudException {
public AmqpServiceInfo(String id, String uri) throws CloudException {
this(id, uri, null);
}
public AmqpServiceInfo(String id, String uri, String managementUri) throws CloudException {
super(id, uri);
this.managementUri = managementUri;
this.managementUri = managementUri;
}
@ServiceProperty(category="connection")
@@ -43,8 +43,8 @@ public class AmqpServiceInfo extends UriBasedServiceInfo {
return getUriInfo().getPath();
}
@ServiceProperty(category="connection")
public String getManagementUri() { return managementUri; }
@ServiceProperty(category="connection")
public String getManagementUri() { return managementUri; }
@Override
protected UriInfo validateAndCleanUriInfo(UriInfo uriInfo) {