コード例 #1
0
 public void Run <TTransportInit, TJobQueueCreator, TTransportCreate>(
     QueueConnection queueConnection,
     int producerCount)
     where TTransportInit : ITransportInit, new()
     where TJobQueueCreator : class, IJobQueueCreation
     where TTransportCreate : class, IQueueCreation
 {
     using (var queueCreator =
                new QueueCreationContainer <TTransportInit>())
     {
         var oCreation = queueCreator.GetQueueCreation <TTransportCreate>(queueConnection);
         var scope     = oCreation.Scope;
         using (var queueContainer =
                    new QueueContainer <TTransportInit>(x => x.RegisterNonScopedSingleton(scope)))
         {
             try
             {
                 var tests = new JobSchedulerTestsShared();
                 tests.RunTestMultipleProducers <TTransportInit, TJobQueueCreator>(
                     queueConnection, true, producerCount,
                     queueContainer.CreateTimeSync(queueConnection.Connection),
                     LoggerShared.Create(queueConnection.Queue, GetType().Name), scope);
             }
             finally
             {
                 oCreation.RemoveQueue();
                 oCreation.Dispose();
                 scope?.Dispose();
             }
         }
     }
 }
コード例 #2
0
        public void Run(
            bool interceptors,
            int producerCount)
        {
            var queueName = GenerateQueueName.Create();
            using (var queueContainer = new QueueContainer<SqlServerMessageQueueInit>(x => {
            }))
            {
                try
                {
                    var tests = new JobSchedulerTestsShared();
                    tests.RunTestMultipleProducers<SqlServerMessageQueueInit, SqlServerJobQueueCreation>(queueName,
                        ConnectionInfo.ConnectionString, interceptors, producerCount, queueContainer.CreateTimeSync(ConnectionInfo.ConnectionString));
                }
                finally
                {

                    using (var queueCreator =
                        new QueueCreationContainer<SqlServerMessageQueueInit>())
                    {
                        using (
                            var oCreation =
                                queueCreator.GetQueueCreation<SqlServerMessageQueueCreation>(queueName,
                                    ConnectionInfo.ConnectionString)
                            )
                        {
                            oCreation.RemoveQueue();
                        }
                    }
                }
            }
        }
コード例 #3
0
 public void Run(
     int producerCount,
     bool inMemoryDb)
 {
     using (var connectionInfo = new IntegrationConnectionInfo(inMemoryDb))
     {
         var queueName = GenerateQueueName.Create();
         using (var queueContainer = new QueueContainer <SqLiteMessageQueueInit>(x => {
         }))
         {
             try
             {
                 var tests = new JobSchedulerTestsShared();
                 tests.RunTestMultipleProducers <SqLiteMessageQueueInit, SqliteJobQueueCreation>(queueName,
                                                                                                 connectionInfo.ConnectionString, true, producerCount, queueContainer.CreateTimeSync(connectionInfo.ConnectionString), LoggerShared.Create(queueName, GetType().Name));
             }
             finally
             {
                 using (var queueCreator =
                            new QueueCreationContainer <SqLiteMessageQueueInit>())
                 {
                     using (
                         var oCreation =
                             queueCreator.GetQueueCreation <SqLiteMessageQueueCreation>(queueName,
                                                                                        connectionInfo.ConnectionString)
                         )
                     {
                         oCreation.RemoveQueue();
                     }
                 }
             }
         }
     }
 }
コード例 #4
0
        public void Run(
            bool interceptors,
            int producerCount)
        {
            var queueName = GenerateQueueName.Create();

            using (var queueContainer = new QueueContainer <SqlServerMessageQueueInit>(x => {
            }))
            {
                try
                {
                    var tests = new JobSchedulerTestsShared();
                    tests.RunTestMultipleProducers <SqlServerMessageQueueInit, SqlServerJobQueueCreation>(queueName,
                                                                                                          ConnectionInfo.ConnectionString, interceptors, producerCount, queueContainer.CreateTimeSync(ConnectionInfo.ConnectionString), LoggerShared.Create(queueName, GetType().Name));
                }
                finally
                {
                    using (var queueCreator =
                               new QueueCreationContainer <SqlServerMessageQueueInit>())
                    {
                        using (
                            var oCreation =
                                queueCreator.GetQueueCreation <SqlServerMessageQueueCreation>(queueName,
                                                                                              ConnectionInfo.ConnectionString)
                            )
                        {
                            oCreation.RemoveQueue();
                        }
                    }
                }
            }
        }
コード例 #5
0
        public void RunMultiple(
            int producerCount,
            ConnectionInfoTypes type)
        {
            var queueName        = GenerateQueueName.Create();
            var connectionString = new ConnectionInfo(type).ConnectionString;

            using (var queueContainer = new QueueContainer <RedisQueueInit>(x => {
            }))
            {
                try
                {
                    var tests = new JobSchedulerTestsShared();
                    tests.RunTestMultipleProducers <RedisQueueInit, RedisJobQueueCreation>(queueName,
                                                                                           connectionString, true, producerCount, queueContainer.CreateTimeSync(connectionString), LoggerShared.Create(queueName, GetType().Name));
                }
                finally
                {
                    using (var queueCreator =
                               new QueueCreationContainer <RedisQueueInit>())
                    {
                        using (
                            var oCreation =
                                queueCreator.GetQueueCreation <RedisQueueCreation>(queueName,
                                                                                   connectionString)
                            )
                        {
                            oCreation.RemoveQueue();
                        }
                    }
                }
            }
        }
コード例 #6
0
        public void RunMultiple(
           bool interceptors,
           int producerCount,
           ConnectionInfoTypes type)
        {
            var queueName = GenerateQueueName.Create();
            var connectionString = new ConnectionInfo(type).ConnectionString;
            using (var queueContainer = new QueueContainer<RedisQueueInit>(x => {
            }))
            {
                try
                {
                    var tests = new JobSchedulerTestsShared();
                    tests.RunTestMultipleProducers<RedisQueueInit, RedisJobQueueCreation>(queueName,
                        connectionString, interceptors, producerCount, queueContainer.CreateTimeSync(connectionString));
                }
                finally
                {

                    using (var queueCreator =
                        new QueueCreationContainer<RedisQueueInit>())
                    {
                        using (
                            var oCreation =
                                queueCreator.GetQueueCreation<RedisQueueCreation>(queueName,
                                    connectionString)
                            )
                        {
                            oCreation.RemoveQueue();
                        }
                    }
                }
            }
        }