### Question:
ECFileCache { public RedisAccessBase getRedisAccess() { return monitor.get(); } ECFileCache(short clusterId, short partitionId); String createFileCacheKey(Integer size); long putFile(final String fileCacheKeyStr, long chunkPos, final InputStream inputStream, final long crc32); byte[] getFile(final String fileCacheKeyStr); InputStream asInputStream(final String fileCacheKeyStr); InputStream asInputStream(final String fileCacheKeyStr, InputStream endChunkStream); void deleteFile(final String fileCacheKeyStr); void putExtraInfo(final String keyStr, byte[] data); byte[] getExtraInfo(final String keyStr); RedisAccessBase getRedisAccess();  }### Answer:
@Test public void testInvalidRedis() throws IOException, ECFileCacheException { if (eraseRedis) { System.out.println("some redis data unreachable, do not run this case: " + ((new Exception()).getStackTrace())[0].getMethodName()); return; } Map<Integer, DecoratedJedisPool> keyedPool = client.getRedisAccess().getKeyedPool(); Map<Integer, DecoratedJedisPool> storedKeyedPool = new HashMap<Integer, DecoratedJedisPool>(keyedPool); keyedPool.put(0, null); keyedPool.put(1, null); testPutGetDeleteImpl(); keyedPool.put(0, null); keyedPool.put(1, null); keyedPool.put(2, null); keyedPool.put(3, null); try { testPutGetDeleteImpl(); Assert.fail("should not reach here"); } catch (ECFileCacheException e) { Assert.assertTrue(StringUtils.contains(e.getMessage(), "fail count > CODING_BLOCK_NUM.")); } keyedPool.put(3, storedKeyedPool.get(3)); keyedPool.remove(0); keyedPool.remove(1); keyedPool.remove(2); testPutGetDeleteImpl(); keyedPool.remove(3); try { testPutGetDeleteImpl(); Assert.fail("should not reach here"); } catch (ECFileCacheException e) { Assert.assertTrue(StringUtils.startsWith(e.getMessage(), "can not allocate offset id for cacheKey")); } for (int i = 0; i < 5; ++i) { keyedPool.put(i, storedKeyedPool.get(i)); } for (int i = 0; i < 5; ++i) { Assert.assertNotNull(keyedPool.get(i)); } }