435 assertTrue("does not exist after installation: " + aFilename, iItu.exists(aSuite)); |
408 assertTrue("does not exist after installation: " + aFilename, iItu.exists(aSuite)); |
436 // Check that IntegrityService root dir does not exist. |
409 // Check that IntegrityService root dir does not exist. |
437 assertNoIsDir(); |
410 assertNoIsDir(); |
438 |
411 |
439 // List. |
412 // List. |
440 //Log.logOut("InstallerEngineTest.doInstallUninstall: list -v"); |
413 Log.logOut("InstallerEngineTest.doInstallUninstall: list -v"); |
441 //result = Installer.mainWithResult(new String[] { "list", "-v" }); |
414 result = Installer.mainWithResult(new String[] { "list", "-v" }); |
442 //assertResult(result, Installer.ERR_NONE); |
415 assertResult(result, Installer.ERR_NONE); |
443 //Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus"); |
416 Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus"); |
444 //result = Installer.mainWithResult(new String[] { "list", "-otastatus" }); |
417 result = Installer.mainWithResult(new String[] { "list", "-otastatus" }); |
445 //assertResult(result, Installer.ERR_NONE); |
418 assertResult(result, Installer.ERR_NONE); |
446 |
419 |
447 // Update with cancellation. |
420 // Update with cancellation. |
448 Log.logOut("InstallerEngineTest.doInstallUninstall: update with cancellation " + aFilename); |
421 Log.logOut("InstallerEngineTest.doInstallUninstall: update with cancellation " + aFilename); |
449 result = Installer.mainWithResult(cancelArgs); |
422 result = Installer.mainWithResult(cancelArgs); |
450 // Check result code. |
423 // Check result code. |
595 } |
568 } |
596 |
569 |
597 public void testDownloadJadOk() |
570 public void testDownloadJadOk() |
598 { |
571 { |
599 Log.logOut("InstallerEngineTest.testDownloadJadOk begins"); |
572 Log.logOut("InstallerEngineTest.testDownloadJadOk begins"); |
600 SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); |
573 SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); |
601 doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld_ota.jad", true, iDefaultOptions); |
574 doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_gcf.jsp", true, iDefaultOptions); |
602 } |
575 } |
603 |
576 |
604 public void testDownloadJarOk() |
577 public void testDownloadJarOk() |
605 { |
578 { |
606 Log.logOut("InstallerEngineTest.testDownloadJarOk begins"); |
579 Log.logOut("InstallerEngineTest.testDownloadJarOk begins"); |
607 SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); |
580 SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); |
608 doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld.jar", false, iDefaultOptions); |
581 doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/JBenchmark2.jar", false, iDefaultOptions); |
609 } |
582 } |
610 |
583 |
611 public void testDownloadJadHttpRedirectOk() |
584 public void testDownloadJadHttpRedirectOk() |
612 { |
585 { |
613 Log.logOut("InstallerEngineTest.testDownloadJadHttpRedirectOk begins"); |
586 Log.logOut("InstallerEngineTest.testDownloadJadHttpRedirectOk begins"); |
614 SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); |
587 SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); |
615 doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=5", true, iDefaultOptions); |
588 doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=5", true, iDefaultOptions); |
616 } |
589 } |
617 |
590 |
618 public void testDownloadJarHttpRedirectOk() |
591 public void testDownloadJarHttpRedirectOk() |
619 { |
592 { |
620 Log.logOut("InstallerEngineTest.testDownloadJarHttpRedirectOk begins"); |
593 Log.logOut("InstallerEngineTest.testDownloadJarHttpRedirectOk begins"); |
621 SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); |
594 SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); |
622 doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jar", false, iDefaultOptions); |
595 doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jar", false, iDefaultOptions); |
623 } |
596 } |
624 |
597 |
625 public void testDownloadJadHttpAuthOk() |
598 public void testDownloadJadHttpAuthOk() |
626 { |
599 { |
627 Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthOk begins"); |
600 Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthOk begins"); |
628 SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); |
601 SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); |
629 iDefaultOptions.addElement("-username=guest"); |
602 iDefaultOptions.addElement("-username=guest"); |
630 iDefaultOptions.addElement("-password=guest"); |
603 iDefaultOptions.addElement("-password=guest"); |
631 doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); |
604 doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); |
632 } |
605 } |
633 |
606 |
634 public void testDownloadJadHttpAuthNok() |
607 public void testDownloadJadHttpAuthNok() |
635 { |
608 { |
636 Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthNok begins"); |
609 Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthNok begins"); |
637 String[] args = new String[] |
610 String[] args = new String[] |
638 { |
611 { |
639 "install", |
612 "install", |
640 "-silent", |
613 "-silent", |
641 "-jad=http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", |
614 "-jad=http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", |
642 }; |
615 }; |
643 int result = Installer.mainWithResult(args); |
616 int result = Installer.mainWithResult(args); |
644 // Check result code. |
617 // Check result code. |
645 assertResult(result, Installer.ERR_CANCEL); |
618 assertResult(result, Installer.ERR_CANCEL); |
646 // Check exception |
619 // Check exception |
647 assertTrue("failed installation returns incorrect exception " + |
620 assertTrue("failed installation returns incorrect exception " + |
648 Installer.getExecuteException(), |
621 Installer.getExecuteException(), |
649 iItu.isExceptionReason |
622 iItu.isExceptionReason |
650 (Installer.getExecuteException(), |
623 (Installer.getExecuteException(), |
651 InstallerErrorMessage.INST_CANCEL, |
624 InstallerErrorMessage.INST_CANCEL, |
652 InstallerDetailedErrorMessage.INST_CANCEL, |
625 InstallerDetailedErrorMessage.NO_MSG, |
653 OtaStatusCode.USER_CANCELLED)); |
626 OtaStatusCode.USER_CANCELLED)); |
654 assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); |
627 assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); |
655 } |
628 } |
656 |
629 |
657 public void testDownloadJadHttpRedirectCountExceeded() |
630 public void testDownloadJadHttpRedirectCountExceeded() |
715 assertTrue("failed installation returns incorrect exception " + |
688 assertTrue("failed installation returns incorrect exception " + |
716 Installer.getExecuteException(), |
689 Installer.getExecuteException(), |
717 iItu.isExceptionReason |
690 iItu.isExceptionReason |
718 (Installer.getExecuteException(), |
691 (Installer.getExecuteException(), |
719 InstallerErrorMessage.INST_CANCEL, |
692 InstallerErrorMessage.INST_CANCEL, |
720 InstallerDetailedErrorMessage.INST_CANCEL, |
693 InstallerDetailedErrorMessage.NO_MSG, |
721 OtaStatusCode.USER_CANCELLED)); |
694 OtaStatusCode.USER_CANCELLED)); |
722 assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); |
695 assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); |
723 Log.log("InstallerEngineTest.testDownloadJadCancel: end"); |
696 Log.log("InstallerEngineTest.testDownloadJadCancel: end"); |
724 } |
697 } |
725 |
698 |
1010 callInstallerOk(new String[] { "list", "-storage" }); |
983 callInstallerOk(new String[] { "list", "-storage" }); |
1011 callInstallerOk(new String[] { "list", "-otastatus" }); |
984 callInstallerOk(new String[] { "list", "-otastatus" }); |
1012 callInstallerOk(new String[] { "list", "-systemproperties" }); |
985 callInstallerOk(new String[] { "list", "-systemproperties" }); |
1013 callInstallerOk(new String[] { "launch", "-nouid" }); |
986 callInstallerOk(new String[] { "launch", "-nouid" }); |
1014 callInstallerOk(new String[] { "launch", "-uid=invaliduid" }); |
987 callInstallerOk(new String[] { "launch", "-uid=invaliduid" }); |
1015 callInstallerOk(new String[] { "uninstallall", "-silent" }); |
988 callInstallerOk(new String[] { "uninstallall" }); |
1016 callInstallerOk(new String[] { "unregister" }); |
989 callInstallerOk(new String[] { "unregister" }); |
1017 callInstallerOk(new String[] { "test", "-nomainclass" }); |
990 callInstallerOk(new String[] { "test", "-nomainclass" }); |
1018 } |
991 } |
1019 |
992 |
1020 public void testApplicationInfo() |
993 public void testApplicationInfo() |
1131 */ |
1104 */ |
1132 public void testInstallAuthAndBig() |
1105 public void testInstallAuthAndBig() |
1133 { |
1106 { |
1134 Log.logOut("InstallerEngineTest.testInstallAuthAndBig begins"); |
1107 Log.logOut("InstallerEngineTest.testInstallAuthAndBig begins"); |
1135 // Do first installation with doInstallUninstall helper |
1108 // Do first installation with doInstallUninstall helper |
1136 SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); |
1109 SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); |
1137 iDefaultOptions.addElement("-username=guest"); |
1110 iDefaultOptions.addElement("-username=guest"); |
1138 iDefaultOptions.addElement("-password=guest"); |
1111 iDefaultOptions.addElement("-password=guest"); |
1139 doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); |
1112 doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); |
1140 |
1113 |
1141 // Then start installation which downloads a large file. |
1114 // Then start installation which downloads a large file. |
1142 Log.log("InstallerEngineTest.testInstallAuthAndBig begin to install big app"); |
1115 Log.log("InstallerEngineTest.testInstallAuthAndBig begin to install big app"); |
1143 String[] args = new String[] |
1116 String[] args = new String[] |
1144 { |
1117 { |
1145 "install", |
1118 "install", |
1146 "-silent", |
1119 "-silent", |
1147 "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad", |
1120 "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp", |
1148 }; |
1121 }; |
1149 int result = Installer.mainWithResult(args); |
1122 int result = Installer.mainWithResult(args); |
1150 // Check result code. |
1123 // Check result code. |
1151 assertResult(result, Installer.ERR_NONE); |
1124 assertResult(result, Installer.ERR_NONE); |
1152 // Check exception |
1125 // Check exception |