Assert.assertNotNull(commandReferences);
int foundCommands = 0;
Set<String> names = defaultCommansList.keySet();
for (ServiceReference commandReference : commandReferences) {
Command command = (Command) bc.getService(commandReference);
if (names.contains(command.getName())) {
foundCommands++;
}
}
Assert.assertEquals(defaultCommansList.size(), foundCommands);
registration.unregister();
foundCommands = 0;
commandReferences = bc.getServiceReferences("org.apache.felix.shell.Command", null);
if (commandReferences != null) {
for (ServiceReference commandReference : commandReferences) {
Command command = (Command) bc.getService(commandReference);
if (names.contains(command.getName())) {
foundCommands++;
}
}
}
Assert.assertEquals(0, foundCommands);