propertyIds.add("cat2/baz");
propertyIds.add("cat3/sub1/bam");
propertyIds.add("cat4/sub2/sub3/bat");
propertyIds.add("cat5/sub5");
Resource resource = new ResourceImpl(Resource.Type.Service);
Assert.assertNull(resource.getPropertyValue("foo"));
BaseProvider.setResourceProperty(resource, "foo", "value1", propertyIds);
Assert.assertEquals("value1", resource.getPropertyValue("foo"));
BaseProvider.setResourceProperty(resource, "cat2/bar", "value2", propertyIds);
Assert.assertEquals("value2", resource.getPropertyValue("cat2/bar"));
Assert.assertNull(resource.getPropertyValue("unsupported"));
BaseProvider.setResourceProperty(resource, "unsupported", "valueX", propertyIds);
Assert.assertNull(resource.getPropertyValue("unsupported"));
// we should allow anything under the category cat5/sub5
BaseProvider.setResourceProperty(resource, "cat5/sub5/prop5", "value5", propertyIds);
Assert.assertEquals("value5", resource.getPropertyValue("cat5/sub5/prop5"));
BaseProvider.setResourceProperty(resource, "cat5/sub5/sub5a/prop5a", "value5", propertyIds);
Assert.assertEquals("value5", resource.getPropertyValue("cat5/sub5/sub5a/prop5a"));
// we shouldn't allow anything under the category cat5/sub7
BaseProvider.setResourceProperty(resource, "cat5/sub7/unsupported", "valueX", propertyIds);
Assert.assertNull(resource.getPropertyValue("cat5/sub7/unsupported"));
}