[Title] Fix bug that-test option does not work with -ni option.
authoryongsung1.kim <yongsung1.kim@samsung.com>
Mon, 5 Aug 2013 08:07:49 +0000 (17:07 +0900)
committeryongsung1.kim <yongsung1.kim@samsung.com>
Mon, 5 Aug 2013 08:07:49 +0000 (17:07 +0900)
[Desc.]
[Issue] redmine #10139

Change-Id: I814ed3f4c8f74a81dd437e67d6352eda16a27b7d

InstallManager_java/src/org/tizen/installmanager/core/Options.java

index 2d5b391..355e86e 100644 (file)
@@ -204,6 +204,8 @@ public class Options {
                                        executablePath = iter.next();
                                        Log.log("executable path : " + executablePath);
                                }
+                       } else if (arg.equals(OptionConstant.OPTION_TEST)) {
+                               doTest = true;
                        } else if (arg.equals("-install")) {
                                if (iter.hasNext()) {
                                        doInstallNoUI = true;
@@ -332,8 +334,6 @@ public class Options {
                                        Log.err("-distribution requires distribution description");
                                        throw new IMFatalException(OptionConstant.MSG_DISTRIBUTION_NOT_PROVIDED);
                                }
-                       } else if (arg.equals(OptionConstant.OPTION_TEST)) {
-                               doTest = true;
                        } else if (arg.equals("-removeOldSDK")) {
                                doRemoveOldSDK = true;
                        } else if (arg.equals("-property")) {
@@ -508,6 +508,16 @@ public class Options {
                        }
                }
                
+               // set test
+               argIter = argArray.iterator();
+               while (argIter.hasNext()) {
+                       if (argIter.next().equalsIgnoreCase("-test")) {
+                               argIter.remove();
+                               Options.doTest = true;
+                               Log.log("Set to test working performance.");
+                       }
+               }
+               
                argIter = argArray.iterator();
                while (argIter.hasNext()) {
                        if (argIter.next().equalsIgnoreCase("-ni")) {
@@ -516,9 +526,7 @@ public class Options {
                                        if (Platform.isLinux()) {
                                                argIter = argArray.iterator();
                                                while (argIter.hasNext()) {
-                                                       if (!argIter.next().equalsIgnoreCase("-passwd")) {
-                                                               throw new IMFatalException(ErrorCode.WRONG_OPTION);
-                                                       } else {
+                                                       if (argIter.next().equalsIgnoreCase("-passwd")) {
                                                                argIter.remove();
                                                                if (argIter.hasNext()) {
                                                                        suPass = argIter.next();
@@ -529,6 +537,9 @@ public class Options {
                                                                }
                                                        }
                                                }
+                                               if (suPass == "") {
+                                                       throw new IMFatalException(ErrorCode.WRONG_OPTION);
+                                               }
                                        } else if (Platform.isWindows()) {
                                                interactive = true;
                                        } else if (Platform.isMacOS()) {