/**
 * Verifies that when a borrowed object is mutated in a way that does not
 * preserve equality and hashcode, the pool can recognized it on return.
 *
 * JIRA: POOL-284
 */
Verifies that when a borrowed object is mutated in a way that does not
preserve equality and hashcode, the pool can recognized it on return.


/ ** * Verifies that when a borrowed object is mutated in a way that does not * preserve equality and hashcode the pool can recognized it on return . * * JIRA : POOL - 284 * /
func (suit *PoolTestSuite) TestMutable() {
	pool := NewObjectPoolWithDefaultConfig(NewPooledObjectFactorySimple(func() (interface{}, error) {
		return make(map[string]string), nil
	}))
	m1 := suit.NoErrorWithResult(pool.BorrowObject()).(map[string]string)
	m2 := suit.NoErrorWithResult(pool.BorrowObject()).(map[string]string)
	m1["k1"] = "v1"
	m2["k2"] = "v2"
	suit.NoError(pool.ReturnObject(m1))
	suit.NoError(pool.ReturnObject(m2))
	suit.Equal(2, pool.GetNumIdle())
	pool.Close()
}
func ( suit * PoolTestSuite ) TestMutable ( ) { pool := NewObjectPoolWithDefaultConfig ( NewPooledObjectFactorySimple ( func ( ) ( interface { } , error ) { return make ( map [ string ] string ) , nil } ) ) m1 := suit . NoErrorWithResult ( pool . BorrowObject ( ) ) . ( map [ string ] string ) m2 := suit . NoErrorWithResult ( pool . BorrowObject ( ) ) . ( map [ string ] string ) m1 [ " " ] = " " m2 [ " " ] = " " suit . NoError ( pool . ReturnObject ( m1 ) ) suit . NoError ( pool . ReturnObject ( m2 ) ) suit . Equal ( 2 , pool . GetNumIdle ( ) ) pool . Close ( ) }
Verifies that when a borrowed object is mutated in a way that does not
preserve equality and hashcode, the pool can recognized it on return.
Verifies that when a borrowed object is mutated in a way that does not preserve equality and hashcode the pool can recognized it on return .