@Test
public void testInternalReleaseConnectionWhereConnectionIsBroken() throws InterruptedException, SQLException {

	// Test case where connection is broken
	mockConnection.logicallyClosed = new AtomicBoolean(false);
	reset(mockConnection,mockPartition, mockConnectionHandles);
	expect(mockConnection.isPossiblyBroken()).andReturn(true).once();
	expect(mockConfig.getConnectionTestStatement()).andReturn(null).once();
	// make it fail to return false
	expect(mockConnection.getMetaData()).andThrow(new SQLException()).once();
	expect(mockConnection.getOriginatingPartition()).andReturn(mockPartition).anyTimes();
	// we're about to destroy this connection, so we can create new ones.
	mockPartition.setUnableToCreateMoreTransactions(false);
	expectLastCall().once();
	// break out from the next method, we're not interested in it
	expect(mockPartition.isUnableToCreateMoreTransactions()).andReturn(true).once();
	Connection mockRealConnection = EasyMock.createNiceMock(Connection.class);
	expect(mockConnection.getInternalConnection()).andReturn(mockRealConnection).anyTimes();
	replay(mockPartition, mockConnection);
	testClass.internalReleaseConnection(mockConnection);
	verify(mockPartition, mockConnection);
}