aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/test/java
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2019-03-01 10:32:17 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2019-03-01 10:53:31 +0530
commit8d59ae0158a8b3f0d038194f42b95424e8c8b38a (patch)
tree2b96c2638722680dd6b04d511008c5b20f538945 /framework/src/test/java
parentadfc77d913cb8e54750d8fe167fde2bb4ffc57ef (diff)
Fix the code vulnerabilities
Issue-ID: CLI-129 Change-Id: I441d7897c2e47b8eda13775d66327401656300ba Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/test/java')
-rw-r--r--framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java27
1 files changed, 20 insertions, 7 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java b/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java
index 69b718d4..df94d594 100644
--- a/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java
@@ -145,13 +145,6 @@ public class OnapCommandUtilsTest {
}
@Test
- public void replaceLineForSpecialValues_envVariable() {
- String replacedLine = OnapCommandUtils.replaceLineForSpecialValues("$s{env:USER}");
-
- assertEquals(System.getenv("USER"), replacedLine);
- }
-
- @Test
public void replaceLineForSpecialValues_multipleVariables() {
String replacedLine = OnapCommandUtils.replaceLineForSpecialValues("$s{A} $s{B}");
@@ -485,6 +478,26 @@ public class OnapCommandUtilsTest {
}
}
+ @Test
+ public void testProcessRunner() {
+ try {
+ ProcessRunner pr = new ProcessRunner("dir", null);
+ pr.run();
+ System.out.println(pr.getOutput());
+ System.out.println(pr.getError());
+ System.out.println(pr.getExitCode());
+
+ pr = new ProcessRunner(new String [] {"dir", "c:"}, null);
+ pr.run();
+ System.out.println(pr.getOutput());
+ System.out.println(pr.getError());
+ System.out.println(pr.getExitCode());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
private void mockPrintMethodException() {
new MockUp<OnapCommandResult>() {
boolean isMock = true;