public void Invoke_WithNoResponseItems() { var message = new RebuildSiteModelTAGNotifierEvent(); var listener = new RebuildSiteModelTAGNotifierListener(); listener.Invoke(Guid.Empty, message).Should().BeTrue(); }
public void TAGFileProcessed(Guid projectUid, IProcessTAGFileResponseItem[] processedItems) { var notification = new RebuildSiteModelTAGNotifierEvent { ProjectUid = projectUid, ResponseItems = processedItems }; //Ignite.GetCluster().ForAttribute(_roleAttribute, "True").GetMessaging().Send(notification, RebuildSiteModelTAGNotifierListener.SITE_MODEL_REBUILDER_TAG_FILE_PROCESSED_EVENT_TOPIC_NAME); var compute = Ignite.GetCluster().ForAttribute(_roleAttribute, "True").GetCompute(); if (compute == null) { _log.LogWarning("No compute projection acquired, exiting"); return; } var result = compute.Broadcast(_func, notification); if (result.Count != 1) { _log.LogWarning($"Single response not received, encountered {result.Count}"); result.ForEach((x, i) => _log.LogWarning($"Response {i}: NodeUid: {x.NodeUid} Success: {x.Success}")); return; } if (!result.First().Success) { _log.LogWarning($"Rebuild site model TAG file notification event failed, nodeUid = {result.First().NodeUid}"); } }
public void Invoke_WithNoRebuilderManager() { var message = new RebuildSiteModelTAGNotifierEvent { ProjectUid = Guid.NewGuid(), ResponseItems = new[] { new ProcessTAGFileResponseItem { AssetUid = Guid.NewGuid(), Exception = "", FileName = "ATagFile.tag", ReadResult = TAGReadResult.NoError, SubmissionFlags = TAGFileSubmissionFlags.AddToArchive | TAGFileSubmissionFlags.NotifyRebuilderOnProceesing, Success = true, OriginSource = TAGFileOriginSource.LegacyTAGFileSource // Only legacy TAG files supported for rebuilding } } }; var listener = new RebuildSiteModelTAGNotifierListener(); listener.Invoke(Guid.Empty, message).Should().BeTrue(); }