assertTrue(scp.getCommands().contains("osgi:eval"));
assertEquals(1, scp.getConstants().size());
assertEquals(bc, scp.getConstants().get(".context"));
// Now let's make a command appear...
ServiceListener commandListener = listeners.get(commandFilter);
ServiceReference<?> cdRef = EasyMock.createMock(ServiceReference.class);
EasyMock.expect(cdRef.getProperty(CommandProcessor.COMMAND_SCOPE)).andReturn("foo");
EasyMock.expect(cdRef.getProperty(CommandProcessor.COMMAND_FUNCTION)).andReturn("bar");
EasyMock.expect(cdRef.getProperty("service.ranking")).andReturn("1");
EasyMock.replay(cdRef);
ServiceEvent event = new ServiceEvent(ServiceEvent.REGISTERED, cdRef);
commandListener.serviceChanged(event);
assertEquals(4, scp.getCommands().size());
assertTrue(scp.getCommands().contains("foo:bar"));
ServiceReference<?> cd2Ref = EasyMock.createMock(ServiceReference.class);
EasyMock.expect(cd2Ref.getProperty(CommandProcessor.COMMAND_SCOPE)).andReturn("xxx");
EasyMock.expect(cd2Ref.getProperty(CommandProcessor.COMMAND_FUNCTION)).andReturn(
new String[] {"aaa", "bbb"});
EasyMock.expect(cd2Ref.getProperty("service.ranking")).andReturn("2");
EasyMock.replay(cd2Ref);
ServiceEvent event2 = new ServiceEvent(ServiceEvent.REGISTERED, cd2Ref);
commandListener.serviceChanged(event2);
assertEquals(6, scp.getCommands().size());
assertTrue(scp.getCommands().contains("xxx:aaa"));
assertTrue(scp.getCommands().contains("xxx:bbb"));
return null;