public MetricsRESTSource getSource() { return source; }
public MetricsREST() { source = CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class); }
@Test(expected=RuntimeException.class) public void testGetInstanceNoHadoopCompat() throws Exception { //This should throw an exception because there is no compat lib on the class path. CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class); }
@Test public void ensureCompatRegistered() throws Exception { assertNotNull(CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class)); assertTrue(CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class) instanceof MetricsRESTSourceImpl); }