Search in sources :

Example 41 with MockRegistry

use of test.lib.MockRegistry in project bnd by bndtools.

the class TestLocalIndexGeneration method testNonGeneratingProvider.

public void testNonGeneratingProvider() throws Exception {
    MockRegistry registry = new MockRegistry();
    registry.addPlugin(new NonGeneratingProvider());
    LocalIndexedRepo repo = new LocalIndexedRepo();
    repo.setRegistry(registry);
    repo.setReporter(reporter);
    Map<String, String> config = new HashMap<String, String>();
    config.put("local", outputDir.getAbsolutePath());
    config.put("type", "Nongenerating");
    repo.setProperties(config);
    repo.put(new BufferedInputStream(new FileInputStream("testdata/bundles/name.njbartlett.osgi.emf.minimal-2.6.1.jar")), new RepositoryPlugin.PutOptions());
    assertEquals(0, reporter.getErrors().size());
    assertTrue(reporter.getWarnings().size() > 0);
    reporter.clear();
}
Also used : NonGeneratingProvider(test.repository.NonGeneratingProvider) HashMap(java.util.HashMap) BufferedInputStream(java.io.BufferedInputStream) MockRegistry(test.lib.MockRegistry) RepositoryPlugin(aQute.bnd.service.RepositoryPlugin) FileInputStream(java.io.FileInputStream)

Aggregations

MockRegistry (test.lib.MockRegistry)41 BndEditModel (aQute.bnd.build.model.BndEditModel)34 Requirement (org.osgi.resource.Requirement)32 CapReqBuilder (aQute.bnd.osgi.resource.CapReqBuilder)28 Capability (org.osgi.resource.Capability)26 IdentityCapability (aQute.bnd.osgi.resource.ResourceUtils.IdentityCapability)25 Resource (org.osgi.resource.Resource)15 ArrayList (java.util.ArrayList)9 HashMap (java.util.HashMap)7 List (java.util.List)6 Resolver (org.osgi.service.resolver.Resolver)6 Processor (aQute.bnd.osgi.Processor)5 File (java.io.File)4 ExportedPackage (aQute.bnd.build.model.clauses.ExportedPackage)2 Parameters (aQute.bnd.header.Parameters)2 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)2 ResolverHook (aQute.bnd.service.resolve.hook.ResolverHook)2 BufferedInputStream (java.io.BufferedInputStream)2 FileInputStream (java.io.FileInputStream)2 Iterator (java.util.Iterator)2