Example #1
0
        public async Task CreateQueuesForEndpointWithRetries_CloudFormation()
        {
            var endpointName              = "mycreateretriesendpoint-cloudformation";
            var errorQueueName            = "mycreateretriesendpointerror-cloudformation";
            var auditQueueName            = "mycreateretriesendpointaudit-cloudformation";
            var queueCreationTemplatePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.json");
            var endpointTemplatePath      = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/CreateEndpointQueues.json");

            await DeleteEndpointQueuesCloudFormation.DeleteQueuesForEndpoint(endpointName)
            .ConfigureAwait(false);

            await QueueDeletionUtilsCloudFormation.DeleteQueue(errorQueueName)
            .ConfigureAwait(false);

            await QueueDeletionUtilsCloudFormation.DeleteQueue(auditQueueName)
            .ConfigureAwait(false);

            try
            {
                await CreateEndpointQueuesCloudFormation.CreateQueuesForEndpoint(endpointName, endpointTemplatePath, includeRetries : true)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : errorQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : auditQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, TimeSpan.FromDays(4), includeRetries : true)
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueuesCloudFormation.DeleteQueuesForEndpoint(endpointName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(errorQueueName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }
Example #2
0
        public async Task CreateQueuesForEndpointDefaultMaxTTL_CloudFormation(string delayedDeliveryMethod)
        {
            var randomName     = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
            var endpointName   = $"mycreatedefaultendpoint-cloudformation-{randomName}";
            var errorQueueName = $"mycreatedefaulterror-cloudformation-{randomName}";
            var auditQueueName = $"mycreatedefaultaudit-cloudformation-{randomName}";

            var queueCreationTemplatePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/QueueCreation.json");
            var endpointTemplatePath      = Path.Combine(TestContext.CurrentContext.TestDirectory, "QueueCreation/CreateEndpointQueues.json");

            try
            {
                await CreateEndpointQueuesCloudFormation.CreateQueuesForEndpoint(endpointName, endpointTemplatePath, delayedDeliveryMethod : delayedDeliveryMethod)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : errorQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await QueueCreationUtilsCloudFormation.CreateQueue(
                    queueName : auditQueueName,
                    templatePath : queueCreationTemplatePath)
                .ConfigureAwait(false);

                await AssertQueuesExist(endpointName, errorQueueName, auditQueueName, TimeSpan.FromDays(4), delayedDeliveryMethod : delayedDeliveryMethod)
                .ConfigureAwait(false);
            }
            finally
            {
                await DeleteEndpointQueuesCloudFormation.DeleteQueuesForEndpoint(endpointName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(errorQueueName)
                .ConfigureAwait(false);

                await QueueDeletionUtilsCloudFormation.DeleteQueue(auditQueueName)
                .ConfigureAwait(false);
            }
        }