use of org.apache.aries.subsystem.util.felix.OsgiRequirementAdapter in project aries by apache.
the class OsgiRequirementAdapterTest method testIsMultipleTrue.
@Test
public void testIsMultipleTrue() {
Requirement req = EasyMock.createNiceMock(Requirement.class);
Map<String, String> directives = new HashMap<String, String>();
directives.put(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE, Namespace.CARDINALITY_MULTIPLE);
EasyMock.expect(req.getDirectives()).andReturn(directives);
EasyMock.replay(req);
OsgiRequirementAdapter adapter = new OsgiRequirementAdapter(req);
assertTrue("Requirement was not multiple", adapter.isMultiple());
}
use of org.apache.aries.subsystem.util.felix.OsgiRequirementAdapter in project aries by apache.
the class OsgiRequirementAdapterTest method testGetNamePackage.
@Test
public void testGetNamePackage() {
Requirement req = EasyMock.createNiceMock(Requirement.class);
EasyMock.expect(req.getNamespace()).andReturn(PackageNamespace.PACKAGE_NAMESPACE);
EasyMock.replay(req);
OsgiRequirementAdapter adapter = new OsgiRequirementAdapter(req);
assertEquals("Wrong name", Capability.PACKAGE, adapter.getName());
}
use of org.apache.aries.subsystem.util.felix.OsgiRequirementAdapter in project aries by apache.
the class OsgiRequirementAdapterTest method testGetNameBundle.
@Test
public void testGetNameBundle() {
Requirement req = EasyMock.createNiceMock(Requirement.class);
EasyMock.expect(req.getNamespace()).andReturn(BundleNamespace.BUNDLE_NAMESPACE);
EasyMock.replay(req);
OsgiRequirementAdapter adapter = new OsgiRequirementAdapter(req);
assertEquals("Wrong name", Capability.BUNDLE, adapter.getName());
}
use of org.apache.aries.subsystem.util.felix.OsgiRequirementAdapter in project aries by apache.
the class OsgiRequirementAdapterTest method testIsMultipleFalse.
@Test
public void testIsMultipleFalse() {
Requirement req = EasyMock.createNiceMock(Requirement.class);
Map<String, String> directives = new HashMap<String, String>();
directives.put(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE, Namespace.CARDINALITY_SINGLE);
EasyMock.expect(req.getDirectives()).andReturn(directives);
EasyMock.replay(req);
OsgiRequirementAdapter adapter = new OsgiRequirementAdapter(req);
assertFalse("Requirement was multiple", adapter.isMultiple());
}
use of org.apache.aries.subsystem.util.felix.OsgiRequirementAdapter in project aries by apache.
the class OsgiRequirementAdapterTest method testGetNameService.
@Test
public void testGetNameService() {
Requirement req = EasyMock.createNiceMock(Requirement.class);
EasyMock.expect(req.getNamespace()).andReturn(ServiceNamespace.SERVICE_NAMESPACE);
EasyMock.replay(req);
OsgiRequirementAdapter adapter = new OsgiRequirementAdapter(req);
assertEquals("Wrong name", Capability.SERVICE, adapter.getName());
}
Aggregations