From 36aeb85214fe7c998fc5d084157ecb8e0054b606 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Mon, 6 Jun 2016 03:44:38 -0400 Subject: [PATCH] Deprecate getModuleName()/getInstanceName() in AbstractConfigTestBase The AbstractConfigTestBase currently requires a config system moduleName/instanceName to be provided by the derived class to ensure the config module is pushed and present in JMX. However blueprint-enabled apps won't have a config system module so deprecate these methods and make them optional along with the check. Change-Id: I1f2f6a993cf99ba25d766ba0ec20ed27b1a9915f Signed-off-by: Tom Pantelis --- .../it/base/AbstractConfigTestBase.java | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java b/opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java index d7c42f58a9..13639ceaed 100644 --- a/opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java +++ b/opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java @@ -78,9 +78,25 @@ public abstract class AbstractConfigTestBase { */ private static final int MODULE_TIMEOUT_MILLIS = 60000; - public abstract String getModuleName(); + /** + * This method need only be overridden if using the config system. + * + * @return the config module name + */ + @Deprecated + public String getModuleName() { + return null; + } - public abstract String getInstanceName(); + /** + * This method need only be overridden if using the config system. + * + * @return the config module instance name + */ + @Deprecated + public String getInstanceName() { + return null; + } public abstract MavenUrlReference getFeatureRepo(); @@ -156,17 +172,23 @@ public abstract class AbstractConfigTestBase { @Before public void setup() throws Exception { + String moduleName = getModuleName(); + String instanceName = getInstanceName(); + if(moduleName == null || instanceName == null) { + return; + } + LOG.info("Module: {} Instance: {} attempting to configure.", - getModuleName(),getInstanceName()); + moduleName, instanceName); Stopwatch stopWatch = Stopwatch.createStarted(); ObjectName objectName = null; for(int i = 0;i