Search in sources :

Example 1 with Directive

use of org.apache.felix.utils.manifest.Directive 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));
}
Also used : Attribute(org.apache.felix.utils.manifest.Attribute) Clause(org.apache.felix.utils.manifest.Clause) Directive(org.apache.felix.utils.manifest.Directive)

Aggregations

Attribute (org.apache.felix.utils.manifest.Attribute)1 Clause (org.apache.felix.utils.manifest.Clause)1 Directive (org.apache.felix.utils.manifest.Directive)1