use of org.apache.felix.utils.manifest.Attribute in project karaf by apache.
the class ManifestUtilsTest method testIsOptional.
public void testIsOptional() {
Directive[] directive = new Directive[0];
Attribute[] attribute = new Attribute[0];
Clause clause = new Clause("org.apache.karaf.test", directive, attribute);
assertFalse(ManifestUtils.isOptional(clause));
directive = new Directive[1];
directive[0] = new Directive("resolution", "mandatory");
clause = new Clause("org.apache.karaf.test", directive, attribute);
assertFalse(ManifestUtils.isOptional(clause));
directive[0] = new Directive("resolution", "optional");
clause = new Clause("org.apache.karaf.test", directive, attribute);
assertTrue(ManifestUtils.isOptional(clause));
}