@Test public void testFinalize() throws Exception { DBConnectionManager dbcManagerSpy = getDBConnectionManagerSpyWithPooling(); Connection connMock = mock(Connection.class); doReturn(connMock).when(dbcManagerSpy).getPooledConnection(any(DBType.class) , any(String.class), any(String.class), any(String.class)); dbcManagerSpy.getConnection(DBType.DB2, EMPTY_STRING, DB_URL, DHARMA_USER, DHARMA_PASSWORD, getPoolingProperties()); doNothing().when(dbcManagerSpy).shutdownDbmsPools(); dbcManagerSpy.finalize(); verify(dbcManagerSpy, times(1)).shutdownDbmsPools(); }
public void finalize() throws Exception { if (this.isPoolingEnabled) { this.shutdownDbmsPools(); } }
DBConnectionManager { public void finalize() throws Exception { if (this.isPoolingEnabled) { this.shutdownDbmsPools(); } } }
DBConnectionManager { public void finalize() throws Exception { if (this.isPoolingEnabled) { this.shutdownDbmsPools(); } } protected  DBConnectionManager(); }
DBConnectionManager { public void finalize() throws Exception { if (this.isPoolingEnabled) { this.shutdownDbmsPools(); } } protected  DBConnectionManager(); static DBConnectionManager getInstance(); void finalize(); synchronized Connection getConnection(DBType aDbType, String aAuthType, String aDbUrl, String aUsername, String aPassword, Properties properties); void cleanDataSources(); synchronized void shutdownDbmsPools(); int getDbmsPoolSize(); int getConnectionSize(DBType aDbType, String aDbUrl); int getCheckedOutConnectionSize(DBType aDbType, String aDbUrl); int getCheckedInConnectionSize(DBType aDbType, String aDbUrl); int getTotalConnectionSize(); int getTotalCheckedOutConnectionSize(); int getTotalCheckedInConnectionSize(); }
DBConnectionManager { public void finalize() throws Exception { if (this.isPoolingEnabled) { this.shutdownDbmsPools(); } } protected  DBConnectionManager(); static DBConnectionManager getInstance(); void finalize(); synchronized Connection getConnection(DBType aDbType, String aAuthType, String aDbUrl, String aUsername, String aPassword, Properties properties); void cleanDataSources(); synchronized void shutdownDbmsPools(); int getDbmsPoolSize(); int getConnectionSize(DBType aDbType, String aDbUrl); int getCheckedOutConnectionSize(DBType aDbType, String aDbUrl); int getCheckedInConnectionSize(DBType aDbType, String aDbUrl); int getTotalConnectionSize(); int getTotalCheckedOutConnectionSize(); int getTotalCheckedInConnectionSize();  }