Skip to content

Commit

Permalink
RavenDB-21956 Cleanup queues after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
djordjedjukic authored and kalczur committed Apr 12, 2024
1 parent a683a77 commit 9036847
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,21 @@ protected string GenerateLargeString()

return builder.ToString();
}

private void CleanupQueues()
{
QueueServiceClient client = new(ConnectionString);
var queues = client.GetQueues();

foreach (var queue in queues)
{
client.DeleteQueue(queue.Name);
}
}

public override void Dispose()
{
base.Dispose();
CleanupQueues();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void Error_if_script_does_not_contain_any_loadTo_method()
{
Name = "test",
ConnectionStringName = "test",
BrokerType = QueueBrokerType.RabbitMq,
BrokerType = QueueBrokerType.AzureQueueStorage,
Transforms =
{
new Transformation
Expand All @@ -114,9 +114,9 @@ public void Error_if_script_does_not_contain_any_loadTo_method()
config.Initialize(new QueueConnectionString
{
Name = "Foo",
BrokerType = QueueBrokerType.RabbitMq,
RabbitMqConnectionSettings =
new RabbitMqConnectionSettings() { ConnectionString = "amqp://guest:guest@localhost:5672/" }
BrokerType = QueueBrokerType.AzureQueueStorage,
AzureQueueStorageConnectionSettings =
new AzureQueueStorageConnectionSettings() { ConnectionString = ConnectionString }
});

List<string> errors;
Expand Down

0 comments on commit 9036847

Please sign in to comment.