Skip to content

Commit d72fa26

Browse files
author
Alvaro Videla
committed
improves uri handling
1 parent 187f2c7 commit d72fa26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/src/com/rabbitmq/examples/perf/ScenarioFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77

88
public class ScenarioFactory {
99
public static Scenario fromJSON(Map json, ConnectionFactory factory) {
10+
String uri = "amqp://localhost";
1011
String type = read("type", json, String.class);
1112
String name = read("name", json, String.class);
1213
Integer interval = read("interval", json, Integer.class, 1000);
1314
List paramsJSON = read("params", json, List.class);
1415

15-
String uri = read("uri", json, String.class);
1616
try {
17+
uri = read("uri", json, String.class);
1718
factory.setUri(uri);
1819
} catch(Exception e) {
19-
System.out.println("scenario: " + name + " with malformed uri: "
20-
+ uri + " - " + e.getMessage());
21-
System.exit(1);
20+
throw new RuntimeException("scenario: " + name + " with malformed uri: "
21+
+ uri + " - " + e.getMessage());
2222
}
2323

2424
MulticastParams[] params = new MulticastParams[paramsJSON.size()];

0 commit comments

Comments
 (0)