@Test public void shouldNotCloseAccessManagerFactoryTrackerOnStopBecauseNotOpened() throws Exception { BundleContext bundleContext = mock(BundleContext.class); final AccessManagerFactoryTracker accessManagerFactoryTracker = mock(AccessManagerFactoryTracker.class); Activator activator = new Activator() { @Override protected AccessManagerFactoryTracker getAccessManagerFactoryTracker() { return null; } }; activator.stop(bundleContext); verify(accessManagerFactoryTracker, never()).close(); }
@Override public void stop( BundleContext bundleContext ) throws Exception { AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker(); if (null != managerFactoryTracker) { managerFactoryTracker.close(); } }
Activator implements BundleActivator, ServiceListener { @Override public void stop( BundleContext bundleContext ) throws Exception { AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker(); if (null != managerFactoryTracker) { managerFactoryTracker.close(); } } }
Activator implements BundleActivator, ServiceListener { @Override public void stop( BundleContext bundleContext ) throws Exception { AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker(); if (null != managerFactoryTracker) { managerFactoryTracker.close(); } }  }
Activator implements BundleActivator, ServiceListener { @Override public void stop( BundleContext bundleContext ) throws Exception { AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker(); if (null != managerFactoryTracker) { managerFactoryTracker.close(); } }  @Override void serviceChanged( ServiceEvent event ); @Override void start( BundleContext bundleContext ); @Override void stop( BundleContext bundleContext ); }
Activator implements BundleActivator, ServiceListener { @Override public void stop( BundleContext bundleContext ) throws Exception { AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker(); if (null != managerFactoryTracker) { managerFactoryTracker.close(); } }  @Override void serviceChanged( ServiceEvent event ); @Override void start( BundleContext bundleContext ); @Override void stop( BundleContext bundleContext );  }