summaryrefslogtreecommitdiffstats
path: root/cadi
diff options
context:
space:
mode:
Diffstat (limited to 'cadi')
-rw-r--r--cadi/aaf/src/main/java/org/onap/aaf/cadi/cm/CmAgent.java13
-rw-r--r--cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_CmAgent.java11
2 files changed, 19 insertions, 5 deletions
diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/cm/CmAgent.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/cm/CmAgent.java
index f900a1f4..bcc156c8 100644
--- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/cm/CmAgent.java
+++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/cm/CmAgent.java
@@ -79,9 +79,12 @@ public class CmAgent {
private static ErrMessage errMsg;
private static Map<String,PlaceArtifact> placeArtifact;
private static RosettaEnv env;
+
+ private static boolean doExit;
public static void main(String[] args) {
int exitCode = 0;
+ doExit = true;
try {
AAFSSO aafsso = new AAFSSO(args);
if(aafsso.loginOnly()) {
@@ -93,7 +96,9 @@ public class CmAgent {
env = new RosettaEnv(access.getProperties());
Deque<String> cmds = new ArrayDeque<String>();
for(String p : args) {
- if(p.indexOf('=')<0) {
+ if("-noexit".equalsIgnoreCase(p)) {
+ doExit = false;
+ } else if(p.indexOf('=') < 0) {
cmds.add(p);
}
}
@@ -110,7 +115,9 @@ public class CmAgent {
System.out.println(" showpass <mechID> [<machine>]");
System.out.println(" check <mechID> [<machine>]");
System.out.println(" genkeypair");
- System.exit(1);
+ if (doExit) {
+ System.exit(1);
+ }
}
TIMEOUT = Integer.parseInt(env.getProperty(Config.AAF_CONN_TIMEOUT, "5000"));
@@ -183,7 +190,7 @@ public class CmAgent {
} catch (Exception e) {
e.printStackTrace();
}
- if(exitCode!=0) {
+ if(exitCode != 0 && doExit) {
System.exit(exitCode);
}
}
diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_CmAgent.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_CmAgent.java
index 34ccf57b..fbeb360f 100644
--- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_CmAgent.java
+++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_CmAgent.java
@@ -56,54 +56,61 @@ public class JU_CmAgent {
String[] args;
args = new String[] {
"-login",
- "-noexit",
+ "-noExit",
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
- "noexit=true",
+ "-noExit",
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
"place",
+ "-noExit",
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
+ "-noExit",
"create"
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
+ "-noExit",
"read"
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
+ "-noExit",
"copy"
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
+ "-noExit",
"update"
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
+ "-noExit",
"delete"
};
CmAgent.main(args);
inStream.reset();
args = new String[] {
+ "-noExit",
"showpass"
};
CmAgent.main(args);