From 6d61878b532f47991b169e163fb9d729ab7c9d3c Mon Sep 17 00:00:00 2001 From: sinthuja Date: Tue, 10 Oct 2017 23:38:44 +0530 Subject: [PATCH] Line formatting and adding missing class comments. --- .../publisher/DataPublisherServiceComponentTest.java | 9 ++++++--- .../data/publisher/util/TestComponentContext.java | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java index 5449d6f489..d5ffb75d48 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java @@ -40,12 +40,14 @@ public class DataPublisherServiceComponentTest extends BaseAnalyticsDataPublishe } @Test (description = "Test bundle activation with exception thrown when service resgistration") - public void activateWithException() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public void activateWithException() throws NoSuchMethodException, IllegalAccessException, + InvocationTargetException { this.activate(new TestComponentContext()); } @Test(dependsOnMethods = "activateWithException", description = "Test the bundle activation with succesful path") - public void activateWithoutException() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + public void activateWithoutException() throws NoSuchMethodException, InvocationTargetException, + IllegalAccessException { this.activate(MockOsgi.newComponentContext()); } @@ -56,7 +58,8 @@ public class DataPublisherServiceComponentTest extends BaseAnalyticsDataPublishe method.invoke(this.serviceComponent, MockOsgi.newComponentContext()); } - private void activate(ComponentContext componentContext) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + private void activate(ComponentContext componentContext) throws NoSuchMethodException, InvocationTargetException, + IllegalAccessException { Method method = this.serviceComponent.getClass().getDeclaredMethod("activate", ComponentContext.class); method.setAccessible(true); method.invoke(this.serviceComponent, componentContext); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java index 1caecf5c4b..adcb3cba2f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java @@ -25,6 +25,9 @@ import org.osgi.service.component.ComponentInstance; import java.util.Dictionary; +/** + * Mock implementation for component context. + */ public class TestComponentContext implements ComponentContext { @Override public Dictionary getProperties() {