Ejemplo n.º 1
0
        public void Run(int messageCount, int runtime, int timeOut, int readerCount,
                        int routeCount, ConnectionInfoTypes type)
        {
            var queueName        = GenerateQueueName.Create();
            var connectionString = new ConnectionInfo(type).ConnectionString;
            var consumer         = new DotNetWorkQueue.IntegrationTests.Shared.Route.Implementation.RouteMultiTests();

            consumer.Run <RedisQueueInit, RedisQueueCreation>(new QueueConnection(queueName, connectionString),
                                                              messageCount, runtime, timeOut, readerCount, routeCount, false, x => { },
                                                              Helpers.GenerateData, Helpers.Verify, VerifyQueueCount);
        }
Ejemplo n.º 2
0
        public void Run(int messageCount, int runtime, int timeOut, int readerCount,
                        int routeCount, bool enableChaos, IntegrationConnectionInfo.ConnectionTypes connectionType)
        {
            using (var connectionInfo = new IntegrationConnectionInfo(connectionType))
            {
                var queueName = GenerateQueueName.Create();
                var consumer  = new DotNetWorkQueue.IntegrationTests.Shared.Route.Implementation.RouteMultiTests();
                consumer.Run <LiteDbMessageQueueInit, LiteDbMessageQueueCreation>(new QueueConnection(queueName,
                                                                                                      connectionInfo.ConnectionString),
                                                                                  messageCount, runtime, timeOut, readerCount, routeCount, enableChaos, x => { Helpers.SetOptions(x, false, false, true, true); },
                                                                                  Helpers.GenerateData, Helpers.Verify, Helpers.VerifyQueueCount);
            }

            using (var connectionInfo = new IntegrationConnectionInfo(connectionType))
            {
                var queueName   = GenerateQueueName.Create();
                var logProvider = LoggerShared.Create(queueName, GetType().Name);
                using (var queueCreator =
                           new QueueCreationContainer <LiteDbMessageQueueInit>(
                               serviceRegister => serviceRegister.Register(() => logProvider, LifeStyles.Singleton)))
                {
                    var            queueConnection = new DotNetWorkQueue.Configuration.QueueConnection(queueName, connectionInfo.ConnectionString);
                    ICreationScope scope           = null;
                    var            oCreation       = queueCreator.GetQueueCreation <LiteDbMessageQueueCreation>(queueConnection);
                    try
                    {
                        oCreation.Options.EnableStatusTable = true;
                        oCreation.Options.EnableRoute       = true;

                        var result = oCreation.CreateQueue();
                        Assert.True(result.Success, result.ErrorMessage);
                        scope = oCreation.Scope;

                        var routeTest = new RouteMultiTestsShared();
                        routeTest.RunTest <LiteDbMessageQueueInit, FakeMessageA>(queueConnection,
                                                                                 true, messageCount, logProvider, Helpers.GenerateData, Helpers.Verify, false,
                                                                                 GenerateRoutes(routeCount, 1), GenerateRoutes(routeCount, routeCount + 1), runtime,
                                                                                 timeOut, readerCount, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(12), oCreation.Scope,
                                                                                 "second(*%3)", enableChaos);

                        new VerifyQueueRecordCount(queueName, connectionInfo.ConnectionString, oCreation.Options, scope)
                        .Verify(0, false, false);
                    }
                    finally
                    {
                        oCreation?.RemoveQueue();
                        oCreation?.Dispose();
                        scope?.Dispose();
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void Run(int messageCount, int runtime, int timeOut, int readerCount,
                        bool useTransactions, int routeCount, bool enableChaos)
        {
            var queueName = GenerateQueueName.Create();
            var consumer  = new DotNetWorkQueue.IntegrationTests.Shared.Route.Implementation.RouteMultiTests();

            consumer.Run <PostgreSqlMessageQueueInit, PostgreSqlMessageQueueCreation>(new QueueConnection(queueName,
                                                                                                          ConnectionInfo.ConnectionString),
                                                                                      messageCount, runtime, timeOut, readerCount, routeCount, enableChaos, x => Helpers.SetOptions(x,
                                                                                                                                                                                    true, !useTransactions, useTransactions, false,
                                                                                                                                                                                    false, !useTransactions, true, false, true),
                                                                                      Helpers.GenerateData, Helpers.Verify, Helpers.VerifyQueueCount);
        }
Ejemplo n.º 4
0
 public void Run(int messageCount, int runtime, int timeOut, int readerCount,
                 bool inMemoryDb, int routeCount, bool enableChaos)
 {
     using (var connectionInfo = new IntegrationConnectionInfo(inMemoryDb))
     {
         var queueName = GenerateQueueName.Create();
         var producer  = new DotNetWorkQueue.IntegrationTests.Shared.Route.Implementation.RouteMultiTests();
         producer.Run <SqLiteMessageQueueInit, SqLiteMessageQueueCreation>(new QueueConnection(queueName, connectionInfo.ConnectionString), messageCount, runtime, timeOut, readerCount, routeCount,
                                                                           enableChaos, x => Helpers.SetOptions(x,
                                                                                                                false, true, false, false, true, true, false, true),
                                                                           Helpers.GenerateData, Helpers.Verify, Helpers.VerifyQueueCount);
     }
 }