@Override protected void setUp() throws Exception { super.setUp(); NMR nmr = OsgiSupport.getReference(bundleContext, NMR.class); assertNotNull(nmr); endpointService1 = ServiceMixSupport.createAndRegisterEndpoint(nmr, service1, null); endpointService2 = ServiceMixSupport.createAndRegisterEndpoint( nmr, service2, new ExchangeProcessorImpl(service2.toString())); mockInterceptor = new MockInterceptor(); Dictionary<String, String> interceptorProps = new Hashtable<String, String>(); interceptorProps.put("role", "consumer,provider"); interceptorProps.put("scope", "request,response"); addRegistrationToCancel( bundleContext.registerService( Interceptor.class.getCanonicalName(), mockInterceptor, interceptorProps)); Thread.sleep(500); reset(resolverMock); }
@Override protected void tearDown() throws Exception { NMR nmr = OsgiSupport.getReference(bundleContext, NMR.class); assertNotNull(nmr); ServiceMixSupport.unregisterEndpoints(nmr, endpointService1, endpointService2); ServiceResolverRegistry registry = OsgiSupport.getReference(bundleContext, ServiceResolverRegistry.class); registry.unregister(resolverMock, resolverProps); assertFalse(registry.getKeys().get(0).equals(resolverMock)); super.tearDown(); }