asList("id", "resourceType", "schedules", "alertCondition"));
}
@Test(groups = { "plugin.metadata", "Metrics.NewPlugin" }, dependsOnMethods = { "persistNewMetrics" })
public void availabilityDefaultTest() {
MeasurementDefinition serverAvailDef = loadMeasurementDef("rhq.availability", "MetricServer1",
MeasurementDefinition.AVAILABILITY_DISPLAY_NAME);
MeasurementDefinition expected = new MeasurementDefinition("rhq.availability",
MeasurementCategory.AVAILABILITY, MeasurementUnits.NONE, DataType.AVAILABILITY, true,
MeasurementDefinition.AVAILABILITY_DEFAULT_PERIOD_SERVER, DisplayType.DETAIL);
expected.setNumericType(NumericType.DYNAMIC);
expected.setDisplayName(MeasurementDefinition.AVAILABILITY_DISPLAY_NAME);
expected.setDescription(MeasurementDefinition.AVAILABILITY_DESCRIPTION);
AssertUtils.assertPropertiesMatch("Failed to create avail metric definition", expected, serverAvailDef,
asList("id", "resourceType", "destinationType", "displayOrder", "alertCondition", "schedules"));
MeasurementDefinition serviceAvailDef = loadMeasurementDef("rhq.availability", "MetricService1",
MeasurementDefinition.AVAILABILITY_DISPLAY_NAME);
expected = new MeasurementDefinition("rhq.availability", MeasurementCategory.AVAILABILITY,
MeasurementUnits.NONE, DataType.AVAILABILITY, false, 120000, DisplayType.DETAIL);
expected.setNumericType(NumericType.DYNAMIC);
expected.setDisplayName(MeasurementDefinition.AVAILABILITY_DISPLAY_NAME);
expected.setDescription(MeasurementDefinition.AVAILABILITY_DESCRIPTION);
AssertUtils.assertPropertiesMatch("Failed to create avail metric definition", expected, serviceAvailDef,
asList("id", "resourceType", "destinationType", "displayOrder", "schedules", "alertCondition"));
serviceAvailDef = loadMeasurementDef("rhq.availability", "MetricService2",
MeasurementDefinition.AVAILABILITY_DISPLAY_NAME);
expected = new MeasurementDefinition("rhq.availability", MeasurementCategory.AVAILABILITY,
MeasurementUnits.NONE, DataType.AVAILABILITY, true,
MeasurementDefinition.AVAILABILITY_DEFAULT_PERIOD_SERVICE, DisplayType.DETAIL);
expected.setNumericType(NumericType.DYNAMIC);
expected.setDisplayName(MeasurementDefinition.AVAILABILITY_DISPLAY_NAME);
expected.setDescription(MeasurementDefinition.AVAILABILITY_DESCRIPTION);