Make config-it-base capable of accepting additional options from derived classes. 23/36923/6
authorKevin Wang <kwang@brocade.com>
Wed, 30 Mar 2016 23:24:00 +0000 (16:24 -0700)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 1 Apr 2016 21:28:43 +0000 (21:28 +0000)
Change-Id: I654224bf9c927e0b393f92036f759b487a8075ad
Signed-off-by: Kevin Wang <kevixw@gmail.com>
opendaylight/config/config-it-base/src/main/java/org/opendaylight/controller/config/it/base/AbstractConfigTestBase.java

index 05bcfbc..d7c42f5 100644 (file)
@@ -32,6 +32,7 @@ import org.opendaylight.controller.config.api.ConfigRegistry;
 import org.opendaylight.controller.config.util.ConfigRegistryJMXClient;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
 import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
 import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
 import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
@@ -92,6 +93,15 @@ public abstract class AbstractConfigTestBase {
         return option;
     }
 
+    /**
+     * Override this method to provide more options to config
+     *
+     * @return An array of additional config options
+     */
+    protected Option[] getAdditionalOptions() {
+        return null;
+    }
+
     public String logConfiguration(Class<?> klazz) {
         return "log4j.logger." + klazz.getPackage().getName();
     }
@@ -141,7 +151,7 @@ public abstract class AbstractConfigTestBase {
                 getLoggingOption(),
                 mvnLocalRepoOption(),
                 editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j.rootLogger", "INFO, stdout, osgi:*")};
-        return options;
+        return OptionUtils.combine(options, getAdditionalOptions());
     }
 
     @Before

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.