use of java.util.jar.Manifest in project felix by apache.
the class PojoMetadataTest method setUp.
public void setUp() {
File manFile = new File("src/test/resources/manipulation/MANIFEST.MF");
Manifest manifest;
try {
manifest = new Manifest(new FileInputStream(manFile));
header = manifest.getMainAttributes().getValue("iPOJO-Components");
} catch (FileNotFoundException e) {
fail(e.getMessage());
} catch (IOException e) {
fail(e.getMessage());
}
String comp_name = "ManipulationMetadata-FooProviderType-1";
FooProviderType1 = getManipulationMetadataForComponent(comp_name);
comp_name = "ManipulationMetadata-FooBarProviderType-1";
FooBarProviderType1 = getManipulationMetadataForComponent(comp_name);
comp_name = "ManipulationMetadata-FooProviderType-Dyn";
FooProviderTypeDyn = getManipulationMetadataForComponent(comp_name);
comp_name = "ManipulationMetadata-PrimitiveManipulationTester";
PrimitiveManipulationTester = getManipulationMetadataForComponent(comp_name);
comp_name = "ManipulationMetadata-SimpleMultipleCheckServiceProvider";
SimpleMultipleCheckServiceProvider = getManipulationMetadataForComponent(comp_name);
}
use of java.util.jar.Manifest in project felix by apache.
the class DirectManifestProviderTestCase method testGetManifest.
public void testGetManifest() throws Exception {
Manifest origin = new Manifest();
DirectManifestProvider provider = new DirectManifestProvider(origin);
assertSame(origin, provider.getManifest());
}
use of java.util.jar.Manifest in project felix by apache.
the class DefaultManifestBuilderTestCase method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
manifest = new Manifest();
Attributes attributes = manifest.getMainAttributes();
attributes.putValue("Import-Package", ORG_OSGI_FRAMEWORK_VERSION_1_5);
attributes.putValue("Created-By", "TestCase");
builder = new DefaultManifestBuilder();
builder.addReferredPackage(Collections.singleton("org.osgi.service.http"));
}
use of java.util.jar.Manifest in project felix by apache.
the class DefaultManifestBuilderTestCase method testReferredPackagesAreProperlyAdded.
public void testReferredPackagesAreProperlyAdded() throws Exception {
List<String> p = Arrays.asList("org.apache.felix.ipojo.test", "org.apache.felix.ipojo.log");
builder.addReferredPackage(new HashSet<String>(p));
Manifest modified = builder.build(manifest);
// Check that referred packages are present
String imported = modified.getMainAttributes().getValue("Import-Package");
Assert.assertTrue(imported.contains("org.apache.felix.ipojo.test"));
Assert.assertTrue(imported.contains("org.apache.felix.ipojo.log"));
}
use of java.util.jar.Manifest in project felix by apache.
the class DefaultManifestBuilderTestCase method testCreatedByHeaderDoesNotContainIPojoTwice.
public void testCreatedByHeaderDoesNotContainIPojoTwice() throws Exception {
manifest.getMainAttributes().putValue("Created-By", "TestCase for iPOJO");
Manifest modified = builder.build(manifest);
// Created by header was properly not changed
Assert.assertEquals("TestCase for iPOJO", modified.getMainAttributes().getValue("Created-By"));
}
Aggregations