@Test(expected=RuntimeException.class) public void testGetInstanceNoHadoopCompat() throws RuntimeException { //This should throw an exception because there is no compat lib on the class path. CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class); }
@Test public void testCompatabilityRegistered() throws Exception { assertNotNull(CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class)); assertTrue(CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class) instanceof MetricsThriftServerSourceFactoryImpl); }