コード例 #1
0
        internal virtual ILogBus CreateILogBus()
        {
            // TODO: creare l'istanza di una classe concreta appropriata.
            LogbusService target = new LogbusService();

            LogbusServerConfiguration config = new LogbusServerConfiguration()
            {
                corefilter = new FacilityEqualsFilter()
                {
                    facility = SyslogFacility.Security
                },
                inchannels = new InboundChannelDefinition[]
                {
                    new InboundChannelDefinition()
                    {
                        type = "It.Unina.Dis.Logbus.InChannels.SyslogUdpReceiver, It.Unina.Dis.Logbus"
                    }
                }
            };

            target.Configuration = config;
            target.Configure();

            return(target);
        }
コード例 #2
0
        public void TestDeployAsmx()
        {
            try
            {
                LogbusServerConfiguration config = new LogbusServerConfiguration();
                config.webserver = new WebServerConfiguration {
                    active = true
                };
                PluginDefinition plugDef = new PluginDefinition()
                {
                    type = typeof(DummyPlugin).AssemblyQualifiedName
                };
                config.plugins = new PluginDefinition[] { plugDef };
                using (LogbusService logbus = new LogbusService())
                {
                    logbus.Configure(config);
                    logbus.Start();

                    //Test HTTP request
                    DummyStub stub = new DummyStub()
                    {
                        Url = "http://localhost:8065/Dummy.asmx"
                    };

                    Assert.AreEqual <int>(5, stub.Sum(3, 2));
                }
            }
            catch (Exception ex)
            {
                Assert.Fail("Test failed: {0}", ex.ToString());
            }
        }
コード例 #3
0
 public void ConfigurationTest()
 {
     //App.config configuration
     using (LogbusService target = new LogbusService())
     {
         target.Configure();
     }
 }
コード例 #4
0
        public void GetAvailableTransportsTest()
        {
            LogbusService target = new LogbusService();

            target.Configure(new LogbusServerConfiguration());
            string[] expected = new string[] { "udp" };
            string[] actual;
            actual = target.GetAvailableTransports();
            Assert.AreEqual(1, actual.Length);
            Assert.AreEqual(expected[0], actual[0]);
        }