Skip to content

Commit

Permalink
fixed topology manager expor test
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Utzig committed May 30, 2017
1 parent a5019a8 commit 01e4d41
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,16 @@ private ServiceReference createUserService(IMocksControl c) {
}

private ServiceReference createUserService(IMocksControl c, Object exportedInterfaces) {
final ServiceReference sref = c.createMock(ServiceReference.class);
final ServiceReference<Object> sref = c.createMock(ServiceReference.class);
EasyMock.expect(sref.getProperty(EasyMock.same(RemoteConstants.SERVICE_EXPORTED_INTERFACES)))
.andReturn(exportedInterfaces).anyTimes();
Bundle srefBundle = c.createMock(Bundle.class);
BundleContext srefContext = c.createMock(BundleContext.class);
EasyMock.expect(srefBundle.getState()).andReturn(Bundle.ACTIVE).anyTimes();
EasyMock.expect(srefBundle.getBundleContext()).andReturn(srefContext).anyTimes();
Object serviceInstance = new Object();
EasyMock.expect(srefContext.getService(sref)).andReturn(serviceInstance).anyTimes();
EasyMock.expect(srefContext.ungetService(sref)).andReturn(true).anyTimes();
if(!"".equals(exportedInterfaces)) {
EasyMock.expect(sref.getBundle()).andReturn(srefBundle).atLeastOnce();
EasyMock.expect(srefBundle.getSymbolicName()).andReturn("serviceBundleName").atLeastOnce();
Expand Down

0 comments on commit 01e4d41

Please # to comment.