From dfba995652e5d15934b2d6f5164dfb4cb5e741da Mon Sep 17 00:00:00 2001 From: "yongsung1.kim" Date: Thu, 17 Apr 2014 19:23:01 +0900 Subject: [PATCH] [INST] Increase download retry count for test. In normal case, download retry count is 10times. In test case, download retry count is 200times. Change-Id: Ib5a9ee9d302bc3c57cfedeacde9985881ec4084a Signed-off-by: yongsung1.kim --- .../src/org/tizen/installmanager/cli/CliInstall.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java b/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java index 05ad26f..6d9279f 100644 --- a/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java +++ b/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java @@ -69,6 +69,7 @@ public class CliInstall { private static final String DISTRIBUTION_INFO = "distribution.info"; private static final String ESSENTIAL_COMPONENT = "ESSENTIAL-COMPONENT"; private static final int NETWORK_RETRY_COUNT = 10; + private static final int NETWORK_RETRY_COUNT_FOR_TEST = 200; private static ViewController controller = null; @@ -560,7 +561,12 @@ public class CliInstall { private static boolean installPackages(PackageSet installablePackages, String targetDir) throws IMExitException { - int repeatCount = NETWORK_RETRY_COUNT; + int repeatCount = 0; + if (Options.doTest) { + repeatCount = NETWORK_RETRY_COUNT_FOR_TEST; + } else { + repeatCount = NETWORK_RETRY_COUNT; + } for (int i = repeatCount; i > 0; i--) { try { if (InstallManager.getInstance().install(installablePackages, targetDir, null)) { @@ -570,8 +576,8 @@ public class CliInstall { } } catch (IMNetworkException e) { Log.ExceptionLog(e); - ErrorController.setNetworkRetryCount(NETWORK_RETRY_COUNT - i); - System.out.println("Network error has occured. retry the download => " + (NETWORK_RETRY_COUNT - i)); + ErrorController.setNetworkRetryCount(repeatCount - i + 1); + System.out.println("Network error has occured. retry the download => " + (repeatCount - i + 1)); continue; } } -- 2.7.4