public void ConfigurationShouldWorkIfIthasAllSections() { using (var configuration = new Config.Configuration(@"Configuration\ConfigFiles\Basic.json")) { Collector collector = configuration.CreateCollector(); Assert.NotNull(collector); } }
public void ConfigurationShouldBeAbleToLoadExternalAssembliesForSinks() { using (var configuration = new Config.Configuration(@"Configuration\ConfigFiles\FakeSink.json")) { Collector collector = configuration.CreateCollector(); Assert.NotNull(collector); } }
public void ConfigurationShouldBeAbleToLoadExternalAssembliesForSuppliers() { using (var configuration = new Config.Configuration(@"Configuration\ConfigFiles\ProcessorCounters.json")) { Collector collector = configuration.CreateCollector(); Assert.NotNull(collector); } }
public void DefaultFallback() { var config = new Config.Configuration(); Assert.AreEqual(false, config.settings.task.isEnabled); Assert.AreEqual(false, config.settings.cache.isEnabled); Assert.AreEqual(false, config.settings.update.isPreReleaseEnabled); Assert.AreEqual(false, config.settings.update.isDisabled); Assert.AreEqual(0, config.outputs.Count); }
/// <summary> /// zk 反向更新 /// </summary> /// <param name="proxy">代理层配置</param> private static void UpdateHttpProxy(Config.Configuration proxy) { var items = proxy.HttpProxy.Items.Select(x => x.Name)?.ToArray(); if (items == null || items.Length < 1) { logger.LogWarning("代理层配置为空,将不进行更新 GrantHttpProxy.UpdateHttpProxy.items == null || items.Length < 1"); } Reg(items); }
public override void Initialize(string file) { Config.Configuration config = new Config.Configuration(file); protocol = (IProtocolParse)ObjectFactory.CreateInstance(config.Type); ip = config.IP; port = config.Port; server = new Server(); server.OnReceive += new ReceiveEventHandler(server_OnReceive); }
public void ConfigurationFailsIfMissingSinks() { Assert.Throws(typeof (InvalidOperationException), () => { using (var configuration = new Config.Configuration(@"Configuration\ConfigFiles\MissingSinks.json")) { Collector collector = configuration.CreateCollector(); } }); }
public override void Initialize(string file) { Config.Configuration config = new Config.Configuration(file); protocol = (IProtocolParse)ObjectFactory.CreateInstance(config.Type); ip = config.IP; port = config.Port; client = new Client("192.168.10.103", 2000); client.OnReceive += new ReceiveEventHandler(client_OnReceive); client.Connect(); //client.Write("9876543210"); //string s = client.Read(); }
public override bool Execute(IServerConnection server, IPlayer p, params string[] args) { try { Log.Info("reloading config"); Config.Configuration reloadedConfig = Config.Configuration.Load(); Program.Config = reloadedConfig; p.Message("Configuration reloaded."); } catch (Exception ex) { p.Error("Error reloading config: {0}", ex.Message); Log.Error("Error reloading config"); Log.Error(ex.ToString()); } return(true); }
public override void Initialize(string file) { Config.Configuration config = new Config.Configuration(file); protocol = (IProtocolParse)ObjectFactory.CreateInstance(config.Type); ip = config.IP; port = config.Port; server = new Server(); server.OnReceive += new ReceiveEventHandler(server_OnReceive); time1 = new System.Timers.Timer(); time1.Interval = 10000; dtTime = DateTime.Now; //time1.Elapsed += new System.Timers.ElapsedEventHandler(OnTimer); time1.Elapsed += new System.Timers.ElapsedEventHandler(time1_Elapsed); time1.Start(); }
public override void Initialize(string file) { Config.Configuration config = new Config.Configuration(file); if (config.Type != null) protocol = (IProtocolParse)ObjectFactory.CreateInstance(config.Type); else protocol = new BarcodeParse(); BarcodeParse.separator = config.Separator; serialPort.ReadTimeout = 100; serialPort.PortName = config.PortName; serialPort.BaudRate = config.BaudRate; serialPort.Parity = config.Parity; serialPort.DataBits = config.DataBits; serialPort.StopBits = config.StopBits; isHex = config.IsHex; serialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(serialPort_DataReceived); }
public GetSentSmsLogs(Config.Configuration configuration) { this.configuration = configuration; }
public LogEndTag(Config.Configuration configuration) { this.configuration = configuration; }
public CreateScenario(Config.Configuration configuration) { this.configuration = configuration; }
public GetScenarios(Config.Configuration configuration) { this.configuration = configuration; }
public void WhenConfigurationChangesTheSupplierIsDisposed() { var tempFile = Path.GetTempFileName(); try { Log.Logger.Debug("Starting test WhenConfigurationChangesTheSupplierIsDisposed"); File.Copy(@"Configuration\ConfigFiles\ProcessorCounters.json", tempFile, true); using ( var configuration = new Config.Configuration(tempFile)) { Assert.NotNull(configuration.Supplier); var supplier = (dynamic) configuration.Supplier; Assert.Equal("ProcessorCounters", supplier.GetType().Name); Assert.Equal(false, supplier.Disposed); File.Copy(@"Configuration\ConfigFiles\Basic.json", tempFile, true); Thread.Sleep(200); Assert.Equal(true, supplier.Disposed); } } finally { File.Delete(tempFile); } }
public SendMultipleBinarySms(Config.Configuration configuration) { this.configuration = configuration; }
public SendSimpleOmniMessage(Config.Configuration configuration) { this.configuration = configuration; }
public SendMultipleSmsTextual(Config.Configuration configuration) { this.configuration = configuration; }
public NumberContextNotify(Config.Configuration configuration) { this.configuration = configuration; }
public SendMultipleTextualSmsAdvanced(Config.Configuration configuration) { this.configuration = configuration; }
public void getSystemHandle(Config.Configuration inSystem) { system = inSystem; }
public void IfAnyChangesHappensToTheConfigFileAnEventShouldBeRaised() { var tempFile = Path.GetTempFileName(); try { Log.Logger.Debug("Starting test IfAnyChangesHappensToTheConfigFileAnEventShouldBeRaised"); File.Copy(@"Configuration\ConfigFiles\Basic.json", tempFile, true); using ( var configuration = new Config.Configuration(tempFile)) { bool triggered = false; configuration.Changed += (s, e) => { triggered = true; }; File.Copy(@"Configuration\ConfigFiles\FakeSink.json", tempFile, true); Thread.Sleep(200); Assert.True(triggered); } } finally { File.Delete(tempFile); } }
public void WhenConfigurationChangesAllDisposableSinksAreDisposed() { var tempFile = Path.GetTempFileName(); try { Log.Logger.Debug("Starting test WhenConfigurationChangesAllDisposableSinksAreDisposed"); File.Copy(@"Configuration\ConfigFiles\FakeSink.json", tempFile, true); using ( var configuration = new Config.Configuration(tempFile)) { Assert.Equal(1, configuration.Sinks.Count()); var sink = (dynamic) configuration.Sinks.First(); Assert.Equal("SendToNull", sink.GetType().Name); Assert.Equal(false, sink.Disposed); File.Copy(@"Configuration\ConfigFiles\Basic.json", tempFile, true); Thread.Sleep(200); Assert.Equal(true, sink.Disposed); } } finally { File.Delete(tempFile); } }
public void WhenConfigurationChangesTheSupplierChanges() { var tempFile = Path.GetTempFileName(); try { File.Copy(@"Configuration\ConfigFiles\ProcessorCounters.json", tempFile, true); using ( var configuration = new Config.Configuration(tempFile)) { Assert.NotNull(configuration.Supplier); Assert.Equal("ProcessorCounters", configuration.Supplier.GetType().Name); File.Copy(@"Configuration\ConfigFiles\Basic.json",tempFile, true); Thread.Sleep(200); Assert.Equal("ConfigFileDefinitions", configuration.Supplier.GetType().Name); } } finally { File.Delete(tempFile); } }
public ManageBulkStatus(Config.Configuration configuration) { this.configuration = configuration; }
public GetOMNIReports(Config.Configuration configuration) { this.configuration = configuration; }
public RescheduleBulk(Config.Configuration configuration) { this.configuration = configuration; }
public GetOmniLogs(Config.Configuration configuration) { this.configuration = configuration; }
public GetReceivedSmsLogs(Config.Configuration configuration) { this.configuration = configuration; }
public void getSystemHandle(Config.Configuration inSystem) { system = inSystem; }
public GetSpecificScenario(Config.Configuration configuration) { this.configuration = configuration; }
public NumberContextQuery(Config.Configuration configuration) { this.configuration = configuration; }
public SendSingleBinarySms(Config.Configuration configuration) { this.configuration = configuration; }
public void WhenConfigurationChangesTheSinkCollectionChanges() { var tempFile = Path.GetTempFileName(); try { Log.Logger.Debug("Starting test WhenConfigurationChangesTheSinkCollectionChanges"); File.Copy(@"Configuration\ConfigFiles\FakeSink.json", tempFile, true); using ( var configuration = new Config.Configuration(tempFile)) { Assert.Equal(1, configuration.Sinks.Count()); Assert.Equal("SendToNull", configuration.Sinks.First().GetType().Name); File.Copy(@"Configuration\ConfigFiles\Basic.json",tempFile, true); Thread.Sleep(200); Assert.Equal("ConsoleSink", configuration.Sinks.First().GetType().Name); } } finally { File.Delete(tempFile); } }
public GetCampaigns(Config.Configuration configuration) { this.configuration = configuration; }
public void ConfigurationShouldUseConfigJsonAsDefault() { using (var configuration = new Config.Configuration()) { Collector collector = configuration.CreateCollector(); Assert.NotNull(collector); } }
public GetSentSmsDeliveryReports(Config.Configuration configuration) { this.configuration = configuration; }
public SendAdvancedOmniMessage(Config.Configuration configuration) { this.configuration = configuration; }
public SendMultipleSmsBinaryAdvanced(Config.Configuration configuration) { this.configuration = configuration; }
public GetAccountBalance(Config.Configuration configuration) { this.configuration = configuration; }
public PreviewSms(Config.Configuration configuration) { this.configuration = configuration; }
public GetBulks(Config.Configuration configuration) { this.configuration = configuration; }
public AddDestination(Config.Configuration configuration) { this.configuration = configuration; }
public GetReceivedMessages(Config.Configuration configuration) { this.configuration = configuration; }