DeviceTypeExtensionServiceComponent { protected void activate(ComponentContext ctx) { try { if (log.isDebugEnabled()) { log.debug("Activating Device Type Extension Service Component"); } ctx.getBundleContext() .registerService(DeviceTypeGeneratorService.class, new DeviceTypeGeneratorServiceImpl(), null); if (log.isDebugEnabled()) { log.debug("Device Type Extension Service Component successfully activated"); } } catch (Throwable e) { log.error("Error occurred while initializing device type extension component ", e); } }    }
@Test(description = "This test case tests the behaviour of the Service Component when there is a possible " + "exception") public void testActivateWithException() { DeviceTypeExtensionServiceComponent deviceTypeExtensionServiceComponent = new DeviceTypeExtensionServiceComponent(); deviceTypeExtensionServiceComponent.activate(null); }
@Test(description = "This test case tests the behaviour of the Service Component when the pre-conditions are " + "satisfied") public void testActivateWithoutException() { DeviceTypeExtensionServiceComponent deviceTypeExtensionServiceComponent = new DeviceTypeExtensionServiceComponent(); deviceTypeExtensionServiceComponent.activate(MockOsgi.newComponentContext()); }