@Test
public void testFailOpenSource() throws IOException, RuntimeException,
    FlumeSpecException, InterruptedException {

  SourceFactoryImpl srcfact = new SourceFactoryImpl();
  srcfact.setSource("failOpen", new SourceBuilder() {
    @Override
    public EventSource build(Context ctx, String... argv) {
      return new EventSource.Base() {
        @Override
        public void open() throws IOException {
          LOG.info("in FailOpenSource,open");
          throw new IOException("open always fails");
        }
      };
    }
  });
  FlumeBuilder.setSourceFactory(srcfact);
  LogicalNode node = drive("failOpen", "null"); // Check that state is failed.
  assertEquals(DriverState.ERROR, node.getDriver().getState());
}