/**
* Tests that we can filter a resource.
*/
@Test
public void testResourceFilterOk() throws Exception {
DeploymentPackageBuilder dpBuilder = DeploymentPackageBuilder.create("dp-test", "1.0.0");
dpBuilder
.add(dpBuilder.createBundleResource()
.setUrl(getTestBundle("bundle2")))
.add(dpBuilder.createBundleResource()
.setVersion("1.1.0")
.setFilter(new JarManifestManipulatingFilter("Bundle-Version", "1.1.0", "Foo", "bar"))
.setUrl(getTestBundle("bundle1")));
JarInputStream jis = new JarInputStream(dpBuilder.generate());
assertNotNull(jis);
Manifest manifest = jis.getManifest();
assertManifestHeader(manifest, "DeploymentPackage-SymbolicName", "dp-test");
assertManifestHeader(manifest, "DeploymentPackage-Version", "1.0.0");