}
@Test
public void testBuilder() throws IOException, InterruptedException {
EventSink snk = GangliaSink.builder().build(new Context(), "localhost",
"foo", "int");
for (int i = 0; i < 10; i++) {
snk.open();
snk.append(new EventImpl("".getBytes()));
snk.close();
}
EventSink snk4 = GangliaSink.builder().build(new Context(), "localhost",
"foo", "int", FlumeConfiguration.get().getGangliaServers());
for (int i = 0; i < 10; i++) {
snk4.open();
snk4.append(new EventImpl("".getBytes()));
snk4.close();
}
try {
GangliaSink.builder().build(new Context(), "localhost", "foo", "bar");
} catch (IllegalArgumentException e) {
// expected a bad type ;
return;
}
fail("expected failure");