public void testRpcSourceSinksInit() throws FlumeSpecException {
FlumeConfiguration.get().set(FlumeConfiguration.EVENT_RPC_TYPE, "garbage");
Context ctx = LogicalNodeContext.testingContext();
// making sure default is Thrift
EventSource rpcSrc = srcfact.getSource(ctx, "rpcSource", "31337");
EventSink rpcSink = fact.getSink(new Context(), "rpcSink", "0.0.0.0",
"31337");
assertEquals(ThriftEventSource.class, rpcSrc.getClass());
assertEquals(ThriftEventSink.class, rpcSink.getClass());
// make sure initializing to Thrift indeed gives us ThriftEvent sources and
// sinks.
FlumeConfiguration.get().set(FlumeConfiguration.EVENT_RPC_TYPE, "THRIFT");
rpcSrc = srcfact.getSource(ctx, "rpcSource", "31337");
rpcSink = fact.getSink(new Context(), "rpcSink", "0.0.0.0", "31337");
assertEquals(ThriftEventSource.class, rpcSrc.getClass());
assertEquals(ThriftEventSink.class, rpcSink.getClass());
// make sure initializing to Avro indeed gives us AvroEvent sources and
// sinks.
FlumeConfiguration.get().set(FlumeConfiguration.EVENT_RPC_TYPE, "AVRO");
rpcSrc = srcfact.getSource(ctx, "rpcSource", "31337");
rpcSink = fact.getSink(new Context(), "rpcSink", "0.0.0.0", "31337");
assertEquals(AvroEventSource.class, rpcSrc.getClass());
assertEquals(AvroEventSink.class, rpcSink.getClass());
}