Assert.assertFalse("YARN CLIENT is a deleted component.",
redefinedService.getClientComponent().getName().equals("YARN_CLIENT"));
// Properties
Assert.assertNotNull(redefinedService.getProperties());
Assert.assertTrue(redefinedService.getProperties().size() > 4);
PropertyInfo deleteProperty1 = null;
PropertyInfo deleteProperty2 = null;
PropertyInfo redefinedProperty1 = null;
PropertyInfo redefinedProperty2 = null;
PropertyInfo inheritedProperty = null;
PropertyInfo newProperty = null;
PropertyInfo originalProperty = null;
for (PropertyInfo propertyInfo : redefinedService.getProperties()) {
if (propertyInfo.getName().equals("yarn.resourcemanager" +
".resource-tracker.address")) {
deleteProperty1 = propertyInfo;
} else if (propertyInfo.getName().equals("yarn.resourcemanager" +
".scheduler.address")) {
deleteProperty2 = propertyInfo;
} else if (propertyInfo.getName().equals("yarn.resourcemanager" +
".address")) {
redefinedProperty1 = propertyInfo;
} else if (propertyInfo.getName().equals("yarn.resourcemanager.admin" +
".address")) {
redefinedProperty2 = propertyInfo;
} else if (propertyInfo.getName().equals("yarn.nodemanager.address")) {
inheritedProperty = propertyInfo;
} else if (propertyInfo.getName().equals("new-yarn-property")) {
newProperty = propertyInfo;
} else if (propertyInfo.getName().equals("yarn.nodemanager.aux-services")) {
originalProperty = propertyInfo;
}
}
Assert.assertNull(deleteProperty1);
Assert.assertNull(deleteProperty2);
Assert.assertNotNull(redefinedProperty1);
Assert.assertNotNull(redefinedProperty2);
Assert.assertNotNull("yarn.nodemanager.address expected to be inherited " +
"from parent", inheritedProperty);
Assert.assertEquals("localhost:100009", redefinedProperty1.getValue());
// Parent property value will result in property being present in the
// child stack
Assert.assertEquals("localhost:8141", redefinedProperty2.getValue());
// New property
Assert.assertNotNull(newProperty);
Assert.assertEquals("some-value", newProperty.getValue());
Assert.assertEquals("some description.", newProperty.getDescription());
Assert.assertEquals("yarn-site.xml", newProperty.getFilename());
// Original property
Assert.assertNotNull(originalProperty);
Assert.assertEquals("mapreduce.shuffle", originalProperty.getValue());
Assert.assertEquals("Auxilliary services of NodeManager",
originalProperty.getDescription());
Assert.assertEquals(3, redefinedService.getConfigDependencies().size());
}