Exemple #1
0
        public void Admon_PerformStorageMaintenanceTestWithParameters()
        {
            SetupApplicationsGroupsAndUsers(Permission.ManageAllApps);

            SecurityCredentials sc = new SecurityCredentials("username1", HashUtil.GetHash("password1", HashType.MD5));

            _managerStorage.AddApplication(new ApplicationStorageView("username1"));
            _managerStorage.AddExecutor(new ExecutorStorageView(true, true, DateTime.Now, "test", 1, "test", 1, 1, 1, 1));

            StorageMaintenanceParameters maintenanceParameters = new StorageMaintenanceParameters();

            maintenanceParameters.RemoveAllExecutors    = true;
            maintenanceParameters.RemoveAllApplications = true;

            // just to keep things honest make sure there is something there
            Assert.AreNotEqual(0, _managerStorage.GetExecutors().Length);
            Assert.AreNotEqual(0, _managerStorage.GetApplications().Length);

            Admon_PerformStorageMaintenance(sc, maintenanceParameters);

            Assert.AreEqual(0, _managerStorage.GetExecutors().Length);
            Assert.AreEqual(0, _managerStorage.GetApplications().Length);
        }
        public void RemoveApplicationsByApplicationStateTestNothingToRemove()
        {
            Maintenance maintenance = new Maintenance();

            Assert.AreEqual(0, _managerStorage.GetApplications().Length);

            maintenance.RemoveApplications(_managerStorage);

            Assert.AreEqual(0, _managerStorage.GetApplications().Length);
        }