// ---------------------------------------------------------------------
// Register the service, this should succeed and cause the
// use count of the service to be incremented.
expectations.add(new OrderedExpectations() {
public void add() {
pluginManagerMock.expects.pluginRegistered(referenceMock)
.description("Register Successfully Bound");
contextMock.expects.getService(referenceMock)
.description("Register Increment Use Count")
.returns(null);
}
});
trackerListener.serviceChanged(
new ServiceEvent(ServiceEvent.REGISTERED, referenceMock));
// ---------------------------------------------------------------------
// Modify Service
// ---------------------------------------------------------------------
// Modifying the service does not require any changes to the use count
// of the service.
pluginManagerMock.expects.pluginModified(referenceMock)
.description("Modify Service");
trackerListener.serviceChanged(
new ServiceEvent(ServiceEvent.MODIFIED, referenceMock));
// ---------------------------------------------------------------------
// Unregister Service
// ---------------------------------------------------------------------
// Unregistering the service must decrement the use count of the
// service.
expectations.add(new OrderedExpectations() {
public void add() {
pluginManagerMock.expects.pluginUnregistering(referenceMock)
.description("Unregistering Service");