diff options
author | Simran Singhal <singhalsimran0@gmail.com> | 2020-11-14 16:14:36 +0530 |
---|---|---|
committer | Simran Singhal <singhalsimran0@gmail.com> | 2020-11-15 19:47:00 +0530 |
commit | 66b0d7f3a4772d4b7cf84503b2171abe46ebd557 (patch) | |
tree | 5c9a4c643406f1382c31dcbcd2e7403466aabbd2 /profiles/robot/src/main/java/org/onap | |
parent | c1746d5f32728608f2cec44910ac431a07d7c67d (diff) |
Auto discover and register all robot test cases
Issue-ID: VNFSDK-614
Change-Id: I5227425f29fb11ef4255e88d873a167b608d5360
Signed-off-by: Simran Singhal <singhalsimran0@gmail.com>
Diffstat (limited to 'profiles/robot/src/main/java/org/onap')
-rw-r--r-- | profiles/robot/src/main/java/org/onap/cli/fw/robot/cmd/OnapRobotCommand.java | 13 | ||||
-rw-r--r-- | profiles/robot/src/main/java/org/onap/cli/fw/robot/conf/OnapCommandRobotConstants.java | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/profiles/robot/src/main/java/org/onap/cli/fw/robot/cmd/OnapRobotCommand.java b/profiles/robot/src/main/java/org/onap/cli/fw/robot/cmd/OnapRobotCommand.java index fa995951..c4dc1bc8 100644 --- a/profiles/robot/src/main/java/org/onap/cli/fw/robot/cmd/OnapRobotCommand.java +++ b/profiles/robot/src/main/java/org/onap/cli/fw/robot/cmd/OnapRobotCommand.java @@ -19,11 +19,14 @@ package org.onap.cli.fw.robot.cmd; import java.util.List; import java.util.Map; +import org.onap.cli.fw.conf.OnapCommandConfig; import org.onap.cli.fw.schema.OnapCommandSchema; +import org.onap.cli.fw.cmd.OnapCommand; import org.onap.cli.fw.cmd.cmd.OpenCommandShellCmd; import org.onap.cli.fw.robot.conf.OnapCommandRobotConstants; import org.onap.cli.fw.robot.schema.OnapCommandSchemaRobotLoader; import org.onap.cli.fw.error.OnapCommandException; +import org.onap.cli.fw.registrar.OnapCommandRegistrar; /** * Oclip robot Command. @@ -32,8 +35,16 @@ import org.onap.cli.fw.error.OnapCommandException; @OnapCommandSchema(type = OnapCommandRobotConstants.ROBOT_SCHEMA_PROFILE) public class OnapRobotCommand extends OpenCommandShellCmd { - public OnapRobotCommand() { + public OnapRobotCommand() throws OnapCommandException { super.addDefaultSchemas(OnapCommandRobotConstants.DEFAULT_PARAMETER_ROBOT_FILE_NAME); + if(Boolean.parseBoolean(OnapCommandConfig.getPropertyValue(OnapCommandRobotConstants.ROBOT_DISCOVER_TESTCASES))) + this.discover(); + } + + public void discover() throws OnapCommandException { + OnapCommand cmd = OnapCommandRegistrar.getRegistrar().get("auto-discover-robot-testcases"); + cmd.getParametersMap().get("api-tests-folder-path").setValue(OnapCommandRobotConstants.ROBOT_API_TESTS_FOLDER_PATH); + cmd.execute(); } @Override diff --git a/profiles/robot/src/main/java/org/onap/cli/fw/robot/conf/OnapCommandRobotConstants.java b/profiles/robot/src/main/java/org/onap/cli/fw/robot/conf/OnapCommandRobotConstants.java index 9aac11e7..c0814895 100644 --- a/profiles/robot/src/main/java/org/onap/cli/fw/robot/conf/OnapCommandRobotConstants.java +++ b/profiles/robot/src/main/java/org/onap/cli/fw/robot/conf/OnapCommandRobotConstants.java @@ -21,11 +21,16 @@ package org.onap.cli.fw.robot.conf; * */ public class OnapCommandRobotConstants { + public static final String CONF = "open-cli-robot.properties"; public static final String ROBOT_SCHEMA_PROFILE = "robot"; public static final String ROBOT = "robot"; public static final String DEFAULT_PARAMETER_ROBOT_FILE_NAME = "default_input_parameters_robot.yaml"; + // discover robot testcases + public static final String ROBOT_DISCOVER_TESTCASES = "cli.robot.discover"; + public static final String ROBOT_API_TESTS_FOLDER_PATH = "cli.robot.api_tests_folder_path"; + private OnapCommandRobotConstants() { //as per coding standard ! } |