public class TestRpcFactoryProvider {
@Test
public void testFactoryProvider() {
Configuration conf = new Configuration();
RpcClientFactory clientFactory = null;
RpcServerFactory serverFactory = null;
clientFactory = RpcFactoryProvider.getClientFactory(conf);
serverFactory = RpcFactoryProvider.getServerFactory(conf);
Assert.assertEquals(RpcClientFactoryPBImpl.class, clientFactory.getClass());
Assert.assertEquals(RpcServerFactoryPBImpl.class, serverFactory.getClass());
conf.set(YarnConfiguration.IPC_CLIENT_FACTORY_CLASS, "unknown");
conf.set(YarnConfiguration.IPC_SERVER_FACTORY_CLASS, "unknown");
conf.set(YarnConfiguration.IPC_RECORD_FACTORY_CLASS, "unknown");