Skip to content

Commit 471414d

Browse files
author
Alexandru Scvortov
committed
refactor tests and extend dcos
1 parent b59a70d commit 471414d

File tree

14 files changed

+33
-10
lines changed

14 files changed

+33
-10
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ namespace RabbitMQ.Client
9191
///<para>
9292
///Note that the Uri property takes a string representation of an
9393
///AMQP URI. Omitted URI parts will take default values. The
94-
///only deviations from the spec are that URIs of the form
94+
///host part of the URI cannot be omitted and URIs of the form
9595
///"amqp://foo/" (note the trailling slash) also represent the
96-
///default virtual host and that the hostname must be specified.
97-
///</para></remarks>
96+
///default virtual host. The latter issue means that virtual
97+
///hosts with an empty name are not addressable. </para></remarks>
9898
public class ConnectionFactory
9999
{
100100
/// <summary>Default user name (value: "guest")</summary>

projects/client/Unit/src/unit/TestAmqpUri.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,12 @@ private void ParseSuccess(string uri, string user, string password,
140140

141141
private void ParseFail(string uri)
142142
{
143-
try {
144-
ConnectionFactory cf = new ConnectionFactory();
145-
cf.Uri = uri;
146-
Assert.Fail("URI parse didn't fail: '" + uri + "'");
147-
} catch (Exception) {
148-
// whoosh!
149-
}
143+
Assert.Throws(
144+
Is.InstanceOf<Exception>(),
145+
delegate {
146+
ConnectionFactory cf = new ConnectionFactory();
147+
cf.Uri = uri;
148+
});
150149
}
151150
}
152151
}

projects/examples/client/AddClient/src/examples/AddClient.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public static int Main(string[] args) {
5252
if (args.Length < 1) {
5353
Console.Error.WriteLine("Usage: AddClient <uri> [<number> ...]");
5454
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
55+
Console.Error.WriteLine("Parameters:");
56+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
5557
return 2;
5658
}
5759

projects/examples/client/AddServer/src/examples/AddServer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public static int Main(string[] args) {
5353
if (args.Length < 1) {
5454
Console.Error.WriteLine("Usage: AddServer <uri>");
5555
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
56+
Console.Error.WriteLine("Parameters:");
57+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
5658
return 2;
5759
}
5860

projects/examples/client/DeclareQueue/src/examples/DeclareQueue.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public static int Main(string[] args) {
7474
{
7575
Console.Error.WriteLine("Usage: DeclareQueue [<option> ...] <uri> <queue> [<exchange> <routingkey>] ...");
7676
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
77+
Console.Error.WriteLine("Parameters:");
78+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
7779
Console.Error.WriteLine("Available options:");
7880
Console.Error.WriteLine(" /durable declare a durable queue");
7981
Console.Error.WriteLine(" /delete delete after declaring");

projects/examples/client/ExceptionTest/src/examples/ExceptionTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public static int Main(string[] args) {
5454
if (args.Length < 1) {
5555
Console.Error.WriteLine("Usage: ExceptionTest <uri>");
5656
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
57+
Console.Error.WriteLine("Parameters:");
58+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
5759
return 2;
5860
}
5961

projects/examples/client/LogTail/src/examples/LogTail.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public static int Main(string[] args) {
5454
if (args.Length < 4) {
5555
Console.Error.WriteLine("Usage: LogTail <uri> <exchange> <exchangetype> <routingkey>");
5656
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
57+
Console.Error.WriteLine("Parameters:");
58+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
5759
Console.Error.WriteLine("If the exchange name is the empty string, will instead declare a queue named");
5860
Console.Error.WriteLine("by the routingkey, and consume from that queue.");
5961
return 2;

projects/examples/client/LowlevelLogTail/src/examples/LowlevelLogTail.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public static int Main(string[] args) {
5454
if (args.Length < 4) {
5555
Console.Error.WriteLine("Usage: LowlevelLogTail <uri> <exchange> <exchangetype> <routingkey>");
5656
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
57+
Console.Error.WriteLine("Parameters:");
58+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
5759
Console.Error.WriteLine("If the exchange name is the empty string, will instead declare a queue named");
5860
Console.Error.WriteLine("by the routingkey, and consume from that queue.");
5961
return 2;

projects/examples/client/PerfTest/src/examples/PerfTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public static int Main(string[] args) {
5353
if (args.Length < 2) {
5454
Console.Error.WriteLine("Usage: PerfTest <uri> <number of messages>");
5555
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
56+
Console.Error.WriteLine("Parameters:");
57+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
5658
return 2;
5759
}
5860

projects/examples/client/SendString/src/examples/SendString.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public static int Main(string[] args) {
4949
if (args.Length < 5) {
5050
Console.Error.WriteLine("Usage: SendString <uri> <exchange> <exchangetype> <routingkey> <message>");
5151
Console.Error.WriteLine("RabbitMQ .NET client version "+typeof(IModel).Assembly.GetName().Version.ToString());
52+
Console.Error.WriteLine("Parameters:");
53+
Console.Error.WriteLine(" <uri> = \"amqp://user:pass@host:port/vhost\"");
5254
return 2;
5355
}
5456

0 commit comments

Comments
 (0)