summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-05-15 17:57:41 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-05-15 17:57:41 +0530
commit5626ae003ba80f876a68a05ed0c7920a08dedd4a (patch)
tree237d20d58fd4e89f57430df8bc22de67a72d4aa5
parent8e70d033456ca50379fd6d684093da3191e8e85a (diff)
Add stablity and perf test case
Issue-ID: CLI-100 Change-Id: I85df939f13bf88213625d19b74a69d07be900a41 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
-rw-r--r--validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java35
1 files changed, 32 insertions, 3 deletions
diff --git a/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java b/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java
index c046e530..181ae515 100644
--- a/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java
+++ b/validate/validation/src/test/java/org/onap/cli/validation/OnapValidationTest.java
@@ -28,6 +28,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -37,6 +38,7 @@ import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cli.fw.error.OnapCommandInvalidSample;
+import org.onap.cli.fw.error.OnapCommandProductVersionInvalid;
import org.onap.cli.fw.registrar.OnapCommandRegistrar;
import org.onap.cli.fw.schema.OnapCommandSchemaInfo;
import org.onap.cli.main.OnapCli;
@@ -59,17 +61,44 @@ public class OnapValidationTest {
public static final String SAMPLE_OUTPUT = "output";
public static final String SAMPLE_MOCO = "moco";
- OnapCli cli = null;
+ OnapCli cli = new OnapCli();
private static Logger LOG = LoggerFactory.getLogger(OnapValidationTest.class);
private void handle(String[] args) {
- cli = new OnapCli(args);
+ cli.resetExitCode();
+ cli.setArgs(args);
cli.handle();
}
+ /**
+ * Add Test annotation to this method for running the stability and perf testing
+ * @throws OnapCommandProductVersionInvalid
+ * @throws OnapCommandException
+ * @throws InterruptedException
+ */
+ //@Test
+ public void stablitityPerformanceBeijingTest() throws OnapCommandProductVersionInvalid, OnapCommandException {
+ System.out.println(new Date());
+ while (true) {
+ OnapCommandRegistrar.getRegistrar().setEnabledProductVersion("onap-beijing");
+ for (String cmd : OnapCommandRegistrar.getRegistrar().listCommandsForEnabledProductVersion()) {
+ System.out.println(cmd + ":");
+ Date start = new Date();
+ this.handle(new String[] { cmd, "-V"});
+ Date end = new Date();
+ System.out.println("[ Total time " + (end.getTime() - start.getTime()) + " ms ]\n");
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ System.out.println(new Date());
+ }
+ }
+ }
+ }
+
@Test
- public void validateCommandSchemas() throws IOException, OnapCommandException {
+ public void validateCommandSchemas() throws OnapCommandException {
for (String version: OnapCommandRegistrar.getRegistrar().getAvailableProductVersions()) {
OnapCommandRegistrar.getRegistrar().setEnabledProductVersion(version);
System.out.println(version);