@Test
public void testMultipleChannels() throws Exception {

  Configuration conf = new Configuration();
  conf.set(CONFNAME, "*,*,/allowed");
  HostRestrictingAuthorizationFilter filter =
      HostRestrictingAuthorizationFilterHandler.initializeState(conf);
  EmbeddedChannel channel1 = new CustomEmbeddedChannel("127.0.0.1", 1006,
      new HostRestrictingAuthorizationFilterHandler(filter));
  EmbeddedChannel channel2 = new CustomEmbeddedChannel("127.0.0.2", 1006,
      new HostRestrictingAuthorizationFilterHandler(filter));
  EmbeddedChannel channel3 = new CustomEmbeddedChannel("127.0.0.3", 1006,
      new HostRestrictingAuthorizationFilterHandler(filter));
  FullHttpRequest allowedHttpRequest =
      new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,
          HttpMethod.GET,
          WebHdfsFileSystem.PATH_PREFIX + "/allowed/file_one?op=OPEN");
  FullHttpRequest allowedHttpRequest2 =
      new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,
          HttpMethod.GET,
          WebHdfsFileSystem.PATH_PREFIX + "/allowed/file_two?op=OPEN");
  FullHttpRequest allowedHttpRequest3 =
      new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,
          HttpMethod.GET,
          WebHdfsFileSystem.PATH_PREFIX + "/allowed/file_three?op=OPEN");
  assertTrue("Should successfully accept request",
      channel1.writeInbound(allowedHttpRequest));
  assertTrue("Should successfully accept request, second time",
      channel2.writeInbound(allowedHttpRequest2));
  // verify closing one channel does not affect remaining channels
  channel1.close();
  assertTrue("Should successfully accept request, third time",
      channel3.writeInbound(allowedHttpRequest3));
}