Ejemplo n.º 1
0
 protected void AndGivenALogRepository()
 {
     _logRepository = new FlowFileLogRepo
     {
         DataDir = _baseDirectory
     };
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Creates a new instance.
        /// </summary>
        /// <param name="config">Processor configuration settings.</param>
        /// <param name="reader">The reader to read incoming data from.</param>
        /// <param name="getController">Function to create a new procesor.</param>
        public FlowFileController(
            ProcessorConfiguration <TIn, TOut> config,
            IReader <TIn> reader,
            Func <IFlowFileController, Processor <TIn, TOut> > getController = null)
        {
            Guard.ArgumentNotNull(reader, nameof(reader));
            Guard.ArgumentNotNull(config, nameof(config));

            _getFlowFileController = getController;
            _flowFileLogRepo       = new FlowFileLogRepo();

            // ReSharper disable once ConvertIfStatementToNullCoalescingExpression
            if (_getFlowFileController == null)
            {
                _getFlowFileController = controller => throw new NotImplementedException();
            }

            Config = config;

            // assign name from type name by default
            ControllerName = $"{GetType().Name.Replace("`2", "")}-{typeof(TIn).Name}-{typeof(TOut).Name}";

            Flow = new FlowId(typeof(TOut).Name);

            _reader = reader;
        }
        protected void GivenAFlowFileDataSourceAndRepository()
        {
            if (Directory.Exists(_dataSourceDir))
            {
                Directory.Delete(_dataSourceDir, true);
            }

            Directory.CreateDirectory(_dataSourceDir);

            var repo = new FlowFileLogRepo(_dataSourceDir);

            this._flowFileRepo = repo;
        }