@Test public void testPDI12439PurRepositoryConnectorDoesntNPEAfterMultipleDisconnects() { PurRepository mockPurRepository = mock( PurRepository.class ); PurRepositoryMeta mockPurRepositoryMeta = mock( PurRepositoryMeta.class ); RootRef mockRootRef = mock( RootRef.class ); PurRepositoryConnector purRepositoryConnector = new PurRepositoryConnector( mockPurRepository, mockPurRepositoryMeta, mockRootRef ); purRepositoryConnector.disconnect(); purRepositoryConnector.disconnect(); }
@Override public synchronized void disconnect() { if ( serviceManager != null ) { serviceManager.close(); } serviceManager = null; }
PurRepositoryConnector implements IRepositoryConnector { @Override public synchronized void disconnect() { if ( serviceManager != null ) { serviceManager.close(); } serviceManager = null; } }
PurRepositoryConnector implements IRepositoryConnector { @Override public synchronized void disconnect() { if ( serviceManager != null ) { serviceManager.close(); } serviceManager = null; } PurRepositoryConnector( PurRepository purRepository, PurRepositoryMeta repositoryMeta, RootRef rootRef ); }
PurRepositoryConnector implements IRepositoryConnector { @Override public synchronized void disconnect() { if ( serviceManager != null ) { serviceManager.close(); } serviceManager = null; } PurRepositoryConnector( PurRepository purRepository, PurRepositoryMeta repositoryMeta, RootRef rootRef ); synchronized RepositoryConnectResult connect( final String username, final String password ); @Override synchronized void disconnect(); LogChannelInterface getLog(); @Override ServiceManager getServiceManager(); static boolean inProcess(); }
PurRepositoryConnector implements IRepositoryConnector { @Override public synchronized void disconnect() { if ( serviceManager != null ) { serviceManager.close(); } serviceManager = null; } PurRepositoryConnector( PurRepository purRepository, PurRepositoryMeta repositoryMeta, RootRef rootRef ); synchronized RepositoryConnectResult connect( final String username, final String password ); @Override synchronized void disconnect(); LogChannelInterface getLog(); @Override ServiceManager getServiceManager(); static boolean inProcess();  }