public void TearDown() { ServerOperations.Pages().DeleteAllPages(); ServerOperations.ModuleBuilder().DeleteAllModules(string.Empty, TransactionName); ServerOperations.Taxonomies().ClearAllCategories(TaxonomiesConstants.CategoriesTaxonomyId); ServerOperations.Taxonomies().ClearAllTags(TaxonomiesConstants.TagsTaxonomyId); }
public void ClearUp() { ServerOperations.Blogs().DeleteAllBlogs(); ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath); ServerOperations.Packaging().DeleteAllPackagesFromDB(); for (int i = 0; i < this.widgetTemplatesNames.Length; i++) { ServerOperations.Widgets().DeleteWidgetTemplate(this.widgetTemplatesNames[i]); } for (int i = 0; i < ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited.Length; i++) { ServerOperations.CustomFields().RemoveCustomFieldsFromContent(BlogPostsType, ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited[i]); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(BlogPostsType, flatClassification); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(BlogPostsType, hierarchicalClassification); } ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy(hierarchicalClassification); ServerOperations.Taxonomies().DeleteFlatTaxonomy(flatClassification); for (int i = 0; i < ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited.Length; i++) { ServerOperations.CustomFields().RemoveCustomFieldsFromContent(BlogType, ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited[i]); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(BlogType, flatClassificationBlog); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(BlogType, hierarchicalClassificationBlog); } ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy(hierarchicalClassificationBlog); ServerOperations.Taxonomies().DeleteFlatTaxonomy(flatClassificationBlog); }
public void ActivateModule() { ServerOperations.ModuleBuilder().ActivateModule(ModuleName, string.Empty, TransactionName); WaitUtils.WaitForSitefinityToStart(HttpContext.Current.Request.Url .GetLeftPart(UriPartial.Authority) + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty)); }
public void ClearUp() { AuthenticationHelper.AuthenticateUser(this.AdminEmail, this.AdminPass, true); ServerOperations.News().DeleteAllNews(); ServerOperations.Pages().DeleteAllPages(); if (System.IO.Directory.Exists(this.tempFolderPath)) { ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath); } ServerOperations.Packaging().DeleteAllPackagesFromDB(); for (int i = 0; i < this.widgetTemplatesNames.Length; i++) { ServerOperations.Widgets().DeleteWidgetTemplate(this.widgetTemplatesNames[i]); } using (new UnrestrictedModeRegion()) { for (int i = 0; i < ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited.Length; i++) { ServerOperations.CustomFields().RemoveCustomFieldsFromContent(NewsType, ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited[i]); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(NewsType, flatClassification); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(NewsType, hierarchicalClassification); } } ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy(hierarchicalClassification); ServerOperations.Taxonomies().DeleteFlatTaxonomy(flatClassification); }
public void ClearUp() { AuthenticationHelper.AuthenticateUser(AdminUserName, AdminPass, true); ServerOperations.Documents().DeleteLibrary(AlbumName); ServerOperations.Pages().DeleteAllPages(); if (System.IO.Directory.Exists(this.tempFolderPath)) { ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath); } ServerOperations.Packaging().DeleteAllPackagesFromDB(); for (int i = 0; i < this.widgetTemplatesNames.Length; i++) { ServerOperations.Widgets().DeleteWidgetTemplate(this.widgetTemplatesNames[i]); } for (int i = 0; i < ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited.Length; i++) { ServerOperations.CustomFields().RemoveCustomFieldsFromContent(DocumentsType, ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited[i]); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(DocumentsType, flatClassificationDoc); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(DocumentsType, hierarchicalClassificationDoc); } ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy(hierarchicalClassificationDoc); ServerOperations.Taxonomies().DeleteFlatTaxonomy(flatClassificationDoc); }
public void ImportNewPackage() { ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath); ServerOperationsFeather.DynamicModules().ExtractStructureZip(PackageResourceEdited, InstallationPath); ServerOperations.SystemManager().RestartApplication(false); WaitUtils.WaitForSitefinityToStart(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty)); }
/// <summary> /// Ensures that all custom dynamic modules are imported. /// </summary> /// <param name="modules">The modules to import.</param> public void EnsureModuleIsImported(Dictionary <string, string> modules) { var modulesToImport = modules; bool restartApplication = false; foreach (var module in modulesToImport) { string moduleName = module.Key; string moduleResource = module.Value; if (!ServerOperations.ModuleBuilder().IsModulePresent(moduleName)) { restartApplication = true; var testsArrangementsAssembly = this.GetArrangementsAssembly(); using (Stream moduleStream = testsArrangementsAssembly.GetManifestResourceStream(moduleResource)) { ServerOperations.ModuleBuilder().ImportModule(moduleStream); ServerOperations.ModuleBuilder().ActivateModule(moduleName, string.Empty, "Module Installations"); } } else if (!ServerOperations.ModuleBuilder().IsModuleActive(moduleName)) { restartApplication = true; ServerOperations.ModuleBuilder().ActivateModule(moduleName, string.Empty, "Module Installations"); } } if (restartApplication) { ServerOperations.SystemManager().RestartApplication(false); } }
public void ClearUp() { ServerOperations.Pages().DeleteAllPages(); ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath); ServerOperations.ModuleBuilder().DeleteModule(ModuleName, string.Empty, "Module Installations"); ServerOperations.Packaging().DeletePackageFromDB(ModuleName); }
public void TearDown() { ServerOperations.Pages().DeleteAllPages(); ServerOperations.DynamicTypes().DeleteAllDynamicItemsForAllModules(); ServerOperations.ModuleBuilder().DeleteAllModules(string.Empty, "Module Installations"); FeatherServerOperations.ResourcePackages().DeleteSelectorsData(DesignerViewFileName, JsonFileName, ControllerFileName); }
public void TearDown() { this.newsOperations.DeleteAllNews(); this.taxonomyOperations.DeleteTags(this.taxaNames.ToArray()); this.blogOperations.DeleteAllBlogs(); ServerOperations.ModuleBuilder().DeleteAllModules(string.Empty, "Module Installations"); this.serverPagesOperations.DeleteAllPages(); }
public void ClearUp() { ServerOperations.ModuleBuilder().DeleteModule(ModuleName, string.Empty, "Module Installations"); ServerOperations.Packaging().DeletePackageFromDB(ModuleName); ServerOperations.Pages().DeleteAllPages(); ServerOperations.ModuleBuilder().DeleteDirectory(AppDomain.CurrentDomain.BaseDirectory + @"App_Data\Sitefinity\Export"); ServerOperations.ModuleBuilder().DeleteDirectory(AppDomain.CurrentDomain.BaseDirectory + @"App_Data\Export"); }
public void ClearUp() { ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath); ServerOperations.Packaging().DeleteAllPackagesFromDB(); for (int i = 0; i < this.widgetTemplatesNames.Length; i++) { ServerOperations.Widgets().DeleteWidgetTemplate(this.widgetTemplatesNames[i]); } }
public void Teardown() { ServerOperations.ModuleBuilder().DeleteAllModules(string.Empty, Guid.NewGuid().ToString()); var exportPath = HostingEnvironment.MapPath(ImportExportDynamicStructureTests.ExportPath); if (Directory.Exists(exportPath)) { ServerOperations.ModuleBuilder().DeleteDirectory(exportPath); } }
/// <summary> /// Imports a dynamic module. /// </summary> /// <param name="moduleResource">The dynamic module resource file.</param> public void EnsureModuleIsImported(string moduleName, string moduleResource) { string providerName = string.Empty; string transactionName = "Module Installations"; if (!ServerOperations.ModuleBuilder().IsModulePresent(moduleName)) { var assembly = this.GetTestUtilitiesAssembly(); Stream moduleStream = assembly.GetManifestResourceStream(moduleResource); using (Stream stream = moduleStream) { ServerOperations.ModuleBuilder().ImportModule(stream); ServerOperations.ModuleBuilder().ActivateModule(moduleName, providerName, transactionName); if (ServerOperations.MultiSite().CheckIsMultisiteMode()) { var providerNames = DynamicModuleManager.GetManager().AllProviders.Select(p => p.ProviderName); bool isCreated = providerNames.Contains("dynamicContentProvider"); if (!isCreated) { ServerOperations.MultiSite().CreateDynamicContentProvider("dynamicContentProvider"); } ServerOperations.SystemManager().RestartApplication(false); ServerOperations.MultiSite().AssignModuleToCurrentSite(moduleName); } else { ServerOperations.SystemManager().RestartApplication(false); } } } else if (!ServerOperations.ModuleBuilder().IsModuleActive(moduleName)) { if (ServerOperations.MultiSite().CheckIsMultisiteMode()) { var providerNames = DynamicModuleManager.GetManager().AllProviders.Select(p => p.ProviderName); bool isCreated = providerNames.Contains("dynamicContentProvider"); if (!isCreated) { ServerOperations.MultiSite().CreateDynamicContentProvider("dynamicContentProvider"); } ServerOperations.SystemManager().RestartApplication(false); ServerOperations.MultiSite().AssignModuleToCurrentSite(moduleName); } else { ServerOperations.SystemManager().RestartApplication(false); WaitUtils.WaitForSitefinityToStart(SystemManager.CurrentHttpContext.Request.Url.GetLeftPart(UriPartial.Authority) + (HostingEnvironment.ApplicationVirtualPath.TrimEnd('/') ?? string.Empty)); } } }
/// <summary> /// Imports a dynamic module. /// </summary> /// <param name="moduleResource">The dynamic module resource file.</param> public void EnsureModuleIsImported(string moduleName, string moduleResource) { string providerName = string.Empty; string transactionName = "Module Installations"; if (!ServerOperations.ModuleBuilder().IsModulePresent(moduleName)) { var assembly = this.GetTestUtilitiesAssembly(); Stream moduleStream = assembly.GetManifestResourceStream(moduleResource); using (Stream stream = moduleStream) { ServerOperations.ModuleBuilder().ImportModule(stream); ServerOperations.ModuleBuilder().ActivateModule(moduleName, providerName, transactionName); if (ServerOperations.MultiSite().CheckIsMultisiteMode()) { var providerNames = DynamicModuleManager.GetManager().AllProviders.Select(p => p.ProviderName); bool isCreated = providerNames.Contains("dynamicContentProvider"); if (!isCreated) { ServerOperations.MultiSite().CreateDynamicContentProvider("dynamicContentProvider"); } ServerOperations.SystemManager().RestartApplication(false); ServerOperations.MultiSite().AssignModuleToCurrentSite(moduleName); } else { ServerOperations.SystemManager().RestartApplication(false); } } } else if (!ServerOperations.ModuleBuilder().IsModuleActive(moduleName)) { if (ServerOperations.MultiSite().CheckIsMultisiteMode()) { var providerNames = DynamicModuleManager.GetManager().AllProviders.Select(p => p.ProviderName); bool isCreated = providerNames.Contains("dynamicContentProvider"); if (!isCreated) { ServerOperations.MultiSite().CreateDynamicContentProvider("dynamicContentProvider"); } ServerOperations.SystemManager().RestartApplication(false); ServerOperations.MultiSite().AssignModuleToCurrentSite(moduleName); } else { ServerOperations.SystemManager().RestartApplication(false); } } }
public void ClearUp() { ServerOperations.ModuleBuilder().DeleteDirectory(this.tempFolderPath); ServerOperations.ModuleBuilder().DeleteDirectory(AppDomain.CurrentDomain.BaseDirectory + @"App_Data\Deployment"); ServerOperations.Packaging().DeleteAllPackagesFromDB(); for (int i = 0; i < this.widgetTemplatesNames.Length; i++) { ServerOperations.Widgets().DeleteWidgetTemplate(this.widgetTemplatesNames[i]); } for (int i = 0; i < ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited.Length; i++) { ServerOperations.CustomFields().RemoveCustomFieldsFromContent(DocumentsType, ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited[i]); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(DocumentsType, flatClassificationDoc); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(DocumentsType, hierarchicalClassificationDoc); } for (int i = 0; i < ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited.Length; i++) { ServerOperations.CustomFields().RemoveCustomFieldsFromContent(ImagesType, ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited[i]); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(ImagesType, flatClassificationIm); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(ImagesType, hierarchicalClassificationIm); } for (int i = 0; i < ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited.Length; i++) { ServerOperations.CustomFields().RemoveCustomFieldsFromContent(VideosType, ServerOperations.CustomFieldsNames().FieldNamesWithoutClassificationsEdited[i]); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(VideosType, flatClassificationVideo); ServerOperations.CustomFields().RemoveCustomFieldsFromContent(VideosType, hierarchicalClassificationVideo); } ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy(hierarchicalClassificationDoc); ServerOperations.Taxonomies().DeleteFlatTaxonomy(flatClassificationDoc); ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy(hierarchicalClassificationIm); ServerOperations.Taxonomies().DeleteFlatTaxonomy(flatClassificationIm); ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy(hierarchicalClassificationVideo); ServerOperations.Taxonomies().DeleteFlatTaxonomy(flatClassificationVideo); }
public void ActivateModule() { ServerOperations.ModuleBuilder().ActivateModule(ModuleName, string.Empty, TransactionName); }
public void Teardown() { ServerOperations.ModuleBuilder().DeleteAllModules(string.Empty, TransactionName); }
public void Teardown() { ServerOperations.ModuleBuilder().DeleteAllModules(this.providerName, TransactionName); }
public override void FixtureTearDown() { base.FixtureTearDown(); ServerOperations.ModuleBuilder().DeleteAllModules(string.Empty, TransactionName); }
public void TearDown() { ServerOperations.ModuleBuilder().DeleteModule(ModuleName, string.Empty, "Module Installations"); this.taxonomyOperations.DeleteFlatTaxonomy(FlatTaxonomyTitle); this.taxonomyOperations.DeleteHierarchicalTaxonomy(HierarchicalTaxonomyTitle); }
public void Teardown() { ServerOperations.ModuleBuilder().DeleteAllModules(string.Empty, DynamicWidgetsHierarchicalContentTests.TransactionName); }