@Test
public void testStatementCachePut() throws SQLException, SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException{

	CommonTestUtils.logTestInfo("Tests statement close (put in cache).");
	String sql = CommonTestUtils.TEST_QUERY;
	BoneCP dsb = null ;
	config.setMinConnectionsPerPartition(1);
	config.setMaxConnectionsPerPartition(5);
	config.setAcquireIncrement(1);
	config.setPartitionCount(1);
	config.setStatementsCacheSize(5);
	config.setStatementReleaseHelperThreads(0);
	config.setStatisticsEnabled(true);
	dsb = new BoneCP(config);
	Connection conn = dsb.getConnection();
	Statement statement = conn.prepareStatement(sql);
	statement.close();
	Field statementCache = conn.getClass().getDeclaredField("preparedStatementCache");
	statementCache.setAccessible(true);
	IStatementCache cache = (IStatementCache) statementCache.get(conn);
	
	statement = cache.get(sql);
	assertNotNull(statement);
	// Calling again should not provide the same object
	assertNull(cache.get(sql));
	// now pretend we have 1 connection being asked for the same statement
	// twice
	statement = conn.prepareStatement(sql);
	Statement statement2 = conn.prepareStatement(sql);
	statement.close(); // release it again
	statement2.close(); // release the other one
	statement2.close();
	statement.close();
	conn.close();
	dsb.shutdown();
	
	dsb.close();
	
	CommonTestUtils.logPass();
}