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