public void GivenILoadWorkflowFrom(string resourceName, string serverName) { if (serverName == "Remote Container") { WorkflowExecutionSteps._containerOps = new Depends(Depends.ContainerType.Warewolf, true); } if (serverName == "Remote Connection Integration") { WorkflowExecutionSteps._containerOps = new Depends(Depends.ContainerType.CIRemote, true); } if (!serverName.Equals("localhost", StringComparison.InvariantCultureIgnoreCase)) { var remoteServer = environmentModel.FindSingle(a => a.Name.Equals(serverName, StringComparison.InvariantCultureIgnoreCase)); remoteServer.ConnectAsync().Wait(60000); remoteServer.ResourceRepository.Load(true); var remoteResource = remoteServer.ResourceRepository.FindSingle(p => p.ResourceName.Equals(resourceName, StringComparison.InvariantCultureIgnoreCase)); Assert.IsNotNull(remoteResource, "Resource \"" + resourceName + "\" not found on remote server \"" + serverName + "\"."); _scenarioContext.Add(remoteResourceString, remoteResource); } else { var localResource = localHost.ResourceRepository.FindSingle(p => p.ResourceName.Equals(resourceName, StringComparison.InvariantCultureIgnoreCase)); Assert.IsNotNull(localResource, "Resource \"" + resourceName + "\" not found."); _scenarioContext.Add(localResourceString, localResource); } }
public void GivenILoadWorkflowFrom(string resourceName, string serverName) { if (!serverName.Equals("localhost", StringComparison.InvariantCultureIgnoreCase)) { var remoteServer = environmentModel.FindSingle(a => a.Name.Equals(serverName, StringComparison.InvariantCultureIgnoreCase)); remoteServer.Connect(); remoteServer.ResourceRepository.Load(true); var remoteResource = remoteServer.ResourceRepository.FindSingle(p => p.ResourceName.Equals(resourceName, StringComparison.InvariantCultureIgnoreCase)); Assert.IsNotNull(remoteResource, "Resource \"" + resourceName + "\" not found on remote server \"" + serverName + "\"."); _scenarioContext.Add(remoteResourceString, remoteResource); } else { var localResource = localHost.ResourceRepository.FindSingle(p => p.ResourceName.Equals(resourceName, StringComparison.InvariantCultureIgnoreCase)); Assert.IsNotNull(localResource, "Resource \"" + resourceName + "\" not found."); _scenarioContext.Add(localResourceString, localResource); } }
public void GivenILoadWorkflowFrom(string resourceName, string serverName) { if (serverName == "Remote Container") { WorkflowExecutionSteps._containerOps = TestLauncher.StartLocalCIRemoteContainer(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestResults")); } if (!serverName.Equals("localhost", StringComparison.InvariantCultureIgnoreCase)) { var remoteServer = environmentModel.FindSingle(a => a.Name.Equals(serverName, StringComparison.InvariantCultureIgnoreCase)); remoteServer.ConnectAsync().Wait(60000); remoteServer.ResourceRepository.Load(true); var remoteResource = remoteServer.ResourceRepository.FindSingle(p => p.ResourceName.Equals(resourceName, StringComparison.InvariantCultureIgnoreCase)); Assert.IsNotNull(remoteResource, "Resource \"" + resourceName + "\" not found on remote server \"" + serverName + "\"."); _scenarioContext.Add(remoteResourceString, remoteResource); } else { var localResource = localHost.ResourceRepository.FindSingle(p => p.ResourceName.Equals(resourceName, StringComparison.InvariantCultureIgnoreCase)); Assert.IsNotNull(localResource, "Resource \"" + resourceName + "\" not found."); _scenarioContext.Add(localResourceString, localResource); } }
public ServiceDesignerViewModel(ModelItem modelItem, IContextualResourceModel rootModel, IServerRepository serverRepository, IEventAggregator eventPublisher, IAsyncWorker asyncWorker) : base(modelItem) { ValidationMemoManager = new ValidationMemoManager(this); MappingManager = new MappingManager(this); if (modelItem.ItemType != typeof(DsfDatabaseActivity) && modelItem.ItemType != typeof(DsfPluginActivity) && modelItem.ItemType != typeof(DsfWebserviceActivity)) { AddTitleBarEditToggle(); } AddTitleBarMappingToggle(); VerifyArgument.IsNotNull("rootModel", rootModel); VerifyArgument.IsNotNull("environmentRepository", serverRepository); VerifyArgument.IsNotNull("eventPublisher", eventPublisher); VerifyArgument.IsNotNull("asyncWorker", asyncWorker); _worker = asyncWorker; _eventPublisher = eventPublisher; eventPublisher.Subscribe(this); ButtonDisplayValue = DoneText; ShowExampleWorkflowLink = Visibility.Collapsed; RootModel = rootModel; ValidationMemoManager.DesignValidationErrors = new ObservableCollection <IErrorInfo>(); FixErrorsCommand = new DelegateCommand(o => { ValidationMemoManager.FixErrors(); IsFixed = IsWorstErrorReadOnly; }); DoneCommand = new DelegateCommand(o => Done()); DoneCompletedCommand = new DelegateCommand(o => DoneCompleted()); InitializeDisplayName(); InitializeImageSource(); IsAsyncVisible = ActivityTypeToActionTypeConverter.ConvertToActionType(Type) == Common.Interfaces.Core.DynamicServices.enActionType.Workflow; OutputMappingEnabled = !RunWorkflowAsync; var activeEnvironment = serverRepository.ActiveServer; if (EnvironmentID == Guid.Empty && !activeEnvironment.IsLocalHostCheck()) { _environment = activeEnvironment; } else { var environment = serverRepository.FindSingle(c => c.EnvironmentID == EnvironmentID); if (environment == null) { IList <IServer> environments = ServerRepository.Instance.LookupEnvironments(activeEnvironment); environment = environments.FirstOrDefault(model => model.EnvironmentID == EnvironmentID); } _environment = environment; } ValidationMemoManager.InitializeValidationService(_environment); IsLoading = true; _worker.Start(() => InitializeResourceModel(_environment), b => { if (b) { UpdateDesignerAfterResourceLoad(serverRepository); } }); ViewComplexObjectsCommand = new RelayCommand(item => { ViewJsonObjects(item as IComplexObjectItemModel); }, CanViewComplexObjects); }
public void AddItemToTree(IDebugState content) { if (_contentItems.Any(a => a.DisconnectedID == content.DisconnectedID)) { return; } if (content.StateType == StateType.Duration) { var item = _contentItems.FirstOrDefault(a => a.WorkSurfaceMappingId == content.WorkSurfaceMappingId); if (item != null) { item.EndTime = content.EndTime; } } else { var environmentId = content.EnvironmentID; var isRemote = environmentId != Guid.Empty; if (isRemote) { var remoteEnvironmentModel = _serverRepository.FindSingle(model => model.EnvironmentID == environmentId); if (remoteEnvironmentModel != null) { ConnectRemoteServer(content, remoteEnvironmentModel); } if (remoteEnvironmentModel != null && content.ParentID.GetValueOrDefault() != Guid.Empty && remoteEnvironmentModel.AuthorizationService != null && !remoteEnvironmentModel.AuthorizationService.GetResourcePermissions(content.OriginatingResourceID).HasFlag(Permissions.View)) { return; } } var debugState = _contentItems.FirstOrDefault(state => state.DisconnectedID == content.DisconnectedID); if (debugState == null) { _contentItems.Add(content); } else { return; } lock (_syncContext) { if (_isRebuildingTree) { return; } } var application = Application.Current; if (application != null) { var dispatcher = application.Dispatcher; var contentToDispatch = content; if (dispatcher != null && dispatcher.CheckAccess()) { dispatcher.Invoke(() => AddItemToTreeImpl(contentToDispatch)); } } else { AddItemToTreeImpl(content); } } }