CLUSTER_NAME_PROPERTY_ID,
HOST_NAME_PROPERTY_ID,
COMPONENT_NAME_PROPERTY_ID);
// flume
Resource resource = new ResourceImpl(Resource.Type.HostComponent);
resource.setProperty(HOST_NAME_PROPERTY_ID, "ip-10-39-113-33.ec2.internal");
resource.setProperty(COMPONENT_NAME_PROPERTY_ID, "FLUME_SERVER");
// only ask for one property
Map<String, TemporalInfo> temporalInfoMap = new HashMap<String, TemporalInfo>();
temporalInfoMap.put(FLUME_CATEGORY3, new TemporalInfoImpl(10L, 20L, 1L));
Request request = PropertyHelper.getReadRequest(Collections.singleton(FLUME_CATEGORY3), temporalInfoMap);
Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
List<String> metricsRegexes = new ArrayList<String>();
metricsRegexes.add("metrics/flume/$1/CHANNEL/$2/");
metricsRegexes.add(FLUME_CHANNEL_CAPACITY_PROPERTY);
String metricsList = getMetricsRegexes(metricsRegexes, gangliaPropertyIds, "FLUME_SERVER");
URIBuilder expectedUri = new URIBuilder();
expectedUri.setScheme((configuration.isGangliaSSL() ? "https" : "http"));
expectedUri.setHost("domU-12-31-39-0E-34-E1.compute-1.internal");
expectedUri.setPath("/cgi-bin/rrd.py");
expectedUri.setParameter("c", "HDPFlumeServer,HDPSlaves");
expectedUri.setParameter("h", "ip-10-39-113-33.ec2.internal");
expectedUri.setParameter("m", metricsList);
expectedUri.setParameter("s", "10");
expectedUri.setParameter("e", "20");
expectedUri.setParameter("r", "1");
URIBuilder actualUri = new URIBuilder(streamProvider.getLastSpec());
Assert.assertEquals(expectedUri.getScheme(), actualUri.getScheme());
Assert.assertEquals(expectedUri.getHost(), actualUri.getHost());
Assert.assertEquals(expectedUri.getPath(), actualUri.getPath());
Assert.assertTrue(isUrlParamsEquals(actualUri, expectedUri));
Assert.assertEquals(11, PropertyHelper.getProperties(resource).size());
Assert.assertNotNull(resource.getPropertyValue(FLUME_CHANNEL_CAPACITY_PROPERTY));
}