public PostprocessorOutputRecord( ILogSourcePostprocessor metadata, LogSourceRecord logSourceRecord, Action scheduleRefresh, Action fireChangeNotification, LJTraceSource trace, IHeartBeatTimer heartbeat, ISynchronizationContext modelSyncContext, ISynchronizationContext threadPoolSyncContext, Telemetry.ITelemetryCollector telemetry, IOutputDataDeserializer outputDataDeserializer) { this.metadata = metadata; this.logSourceRecord = logSourceRecord; state = new LoadingState(new PostprocessorOutputRecordState.Context() { owner = this, scheduleRefresh = scheduleRefresh, fireChangeNotification = fireChangeNotification, tracer = trace, telemetry = telemetry, heartbeat = heartbeat, modelSyncContext = modelSyncContext, threadPoolSyncContext = threadPoolSyncContext, outputDataDeserializer = outputDataDeserializer }, null, null); }
public void BeforeEach() { logSources = Substitute.For <ILogSourcesManager>(); telemetry = Substitute.For <Telemetry.ITelemetryCollector>(); mockedSyncContext = new ManualSynchronizationContext(); heartbeat = Substitute.For <IHeartBeatTimer>(); progressAggregator = Substitute.For <Progress.IProgressAggregator>(); settingsAccessor = Substitute.For <Settings.IGlobalSettingsAccessor>(); logSource1 = Substitute.For <ILogSource>(); logProviderFac1 = Substitute.For <ILogProviderFactory>(); logSource1.Provider.Factory.Returns(logProviderFac1); logSource1.Provider.ConnectionParams.Returns(new ConnectionParams($"{ConnectionParamsKeys.PathConnectionParam}=/log.txt")); logSource1.Provider.Stats.Returns(new LogProviderStats() { ContentsEtag = null }); logSourcePP1 = Substitute.For <ILogSourcePostprocessor>(); logSourcePP1.Kind.Returns(PostprocessorKind.SequenceDiagram); pp1outputXmlSection = Substitute.For <Persistence.ISaxXMLStorageSection>(); logSource1.LogSourceSpecificStorageEntry.OpenSaxXMLSection("postproc-sequencediagram.xml", Persistence.StorageSectionOpenFlag.ReadOnly).Returns(pp1outputXmlSection); pp1outputXmlSection.Reader.Returns(Substitute.For <XmlReader>()); pp1PostprocessorOutput = Substitute.For <IPostprocessorOutputETag>(); outputDataDeserializer = Substitute.For <IOutputDataDeserializer>(); outputDataDeserializer.Deserialize(PostprocessorKind.SequenceDiagram, Arg.Any <LogSourcePostprocessorDeserializationParams>()).Returns(pp1PostprocessorOutput); pp1RunSummary = Substitute.For <IPostprocessorRunSummary>(); logSourcePP1.Run(null).ReturnsForAnyArgs(Task.FromResult(pp1RunSummary)); pp1RunSummary.GetLogSpecificSummary(null).ReturnsForAnyArgs((IPostprocessorRunSummary)null); manager = new LogJoint.Postprocessing.PostprocessorsManager( logSources, telemetry, mockedSyncContext, mockedSyncContext, heartbeat, progressAggregator, settingsAccessor, outputDataDeserializer, new TraceSourceFactory()); manager.RegisterLogType(new LogSourceMetadata(logProviderFac1, logSourcePP1)); }
void IManager.RegisterCrossLogSourcePostprocessor(ILogSourcePostprocessor postprocessor) { this.crossLogSourcePostprocessorsTypes.Add(postprocessor); }
static string MakeLogSourcePostprocessorFeatureId(LogSourceMetadata logSource, ILogSourcePostprocessor postproc) { return(string.Format(@"postprocessor\{0}\{1}\{2}", logSource.LogProviderFactory.CompanyName, logSource.LogProviderFactory.FormatName, postproc.Kind.ToString())); }
static string MakePostprocessorOutputFileName(ILogSourcePostprocessor pp) { return(string.Format("postproc-{0}.xml", pp.TypeID.ToLower())); }
internal static string MakePostprocessorOutputFileName(this ILogSourcePostprocessor pp) { return(string.Format("postproc-{0}.xml", pp.Kind.ToString().ToLower())); }