From caba24a1e13612fd30c8e2befa5c5d713a64dee8 Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Mon, 23 Oct 2017 16:30:33 +0530 Subject: [PATCH] Code formatting and improvements. --- .../common/extensions/AnalyticsServerExtension.java | 4 ++-- .../integration/common/extensions/BrokerServerExtension.java | 4 ++-- .../common/extensions/CustomTestServerManager.java | 3 --- .../iot/integration/common/extensions/IOTServerExtension.java | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/AnalyticsServerExtension.java b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/AnalyticsServerExtension.java index 3f9693a0..37ccd503 100644 --- a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/AnalyticsServerExtension.java +++ b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/AnalyticsServerExtension.java @@ -40,14 +40,14 @@ public class AnalyticsServerExtension extends ExecutionListenerExtension { private static final Log log = LogFactory.getLog(CarbonServerExtension.class); private String executionEnvironment; private AutomationContext automationContext; - + private final String ANALYTICS_PORT_OFFSET = "2"; @Override public void initiate() throws AutomationFrameworkException { try { automationContext = new AutomationContext("IOT", TestUserMode.SUPER_TENANT_USER); if(getParameters().get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) == null) { - getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, "2"); + getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, ANALYTICS_PORT_OFFSET); } serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters()); executionEnvironment = diff --git a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/BrokerServerExtension.java b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/BrokerServerExtension.java index 881323b6..0adf0bc0 100644 --- a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/BrokerServerExtension.java +++ b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/BrokerServerExtension.java @@ -40,14 +40,14 @@ public class BrokerServerExtension extends ExecutionListenerExtension { private static final Log log = LogFactory.getLog(CarbonServerExtension.class); private String executionEnvironment; private AutomationContext automationContext; - + private final String BROKER_PORT_OFFSET = "3"; @Override public void initiate() throws AutomationFrameworkException { try { automationContext = new AutomationContext("IOT", TestUserMode.SUPER_TENANT_USER); if(getParameters().get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) == null) { - getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, "3"); + getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, BROKER_PORT_OFFSET); } serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters()); executionEnvironment = diff --git a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CustomTestServerManager.java b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CustomTestServerManager.java index 81938011..f641d227 100644 --- a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CustomTestServerManager.java +++ b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CustomTestServerManager.java @@ -80,7 +80,6 @@ public class CustomTestServerManager { } - public Map getCommands() { return commandMap; } @@ -181,6 +180,4 @@ public class CustomTestServerManager { public void stopServer() throws AutomationFrameworkException { carbonServer.serverShutdown(portOffset); } - - } diff --git a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/IOTServerExtension.java b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/IOTServerExtension.java index 8c85eb48..71c86381 100644 --- a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/IOTServerExtension.java +++ b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/IOTServerExtension.java @@ -40,14 +40,14 @@ public class IOTServerExtension extends ExecutionListenerExtension { private static final Log log = LogFactory.getLog(CarbonServerExtension.class); private String executionEnvironment; private AutomationContext automationContext; - + private final String IOT_CORE_PORT_OFFSET = "0"; @Override public void initiate() throws AutomationFrameworkException { try { automationContext = new AutomationContext("IOT", TestUserMode.SUPER_TENANT_USER); if(getParameters().get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) == null) { - getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, "0"); + getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, IOT_CORE_PORT_OFFSET); } serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters()); executionEnvironment =