@Test
public void testConnectionRefused() {

  ((FlumeLog4jAvroAppender) avroLogger.getAppender("avro")).setPort(44000);
  boolean caughtException = false;
  try {
    avroLogger.info("message 1");
  } catch (Throwable t) {
    logger.debug("Logging to a non-existant server failed (as expected)", t);
    caughtException = true;
  }
  Assert.assertTrue(caughtException);
}