managerMock = new ConfigurationManagerMock("managerMock",
expectations);
pluginManagerMock = new PluginManagerMock(
"pluginManagerMock", expectations);
FilterMock filterMock = new FilterMock("filterMock", expectations);
referenceMock = new ServiceReferenceMock("referenceMock", expectations);
// =====================================================================
// Set Expectations
// =====================================================================
contextMock.expects
.createFilter(
"(|(objectClass=org.osgi.service.cm.ManagedService)" +
"(objectClass=org.osgi.service.cm.ManagedServiceFactory)" +
"(objectClass=org.osgi.service.cm.ConfigurationPlugin))")
.returns(filterMock);
contextMock.fuzzy.addServiceListener(mockFactory.expectsInstanceOf(
ServiceListener.class), null).does(new MethodAction() {
public Object perform(MethodActionEvent event) throws Throwable {
trackerListener = (ServiceListener)
event.getArgument(ServiceListener.class);
return null;
}
});
contextMock.expects.getServiceReferences(null, filterMock.toString())
.returns(null);
filterMock.expects.match(referenceMock).returns(true).any();
ConfigurationServiceTracker tracker = new ConfigurationServiceTracker(