Skip to content

Commit dc90d1d

Browse files
committed
Add test for queue sequence to / from specified via JSON
Fixes #813 * Add a test that demonstrates use of `queue-pattern`, `queue-sequence-from` and `queue-sequence-to`
1 parent eff8ad5 commit dc90d1d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/main/java/com/rabbitmq/perf/MulticastParams.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,18 @@ Map<String, Object> getQueueArguments() {
371371
return queueArguments;
372372
}
373373

374+
String getQueuePattern() {
375+
return queuePattern;
376+
}
377+
378+
int getQueueSequenceFrom() {
379+
return queueSequenceFrom;
380+
}
381+
382+
int getQueueSequenceTo() {
383+
return queueSequenceTo;
384+
}
385+
374386
public void setBodyContentType(String bodyContentType) {
375387
this.bodyContentType = bodyContentType;
376388
}

src/test/java/com/rabbitmq/perf/ScenarioFactoryTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public void paramsFromJSON() {
3333
+ " 'rate': 10, 'exclusive': true, "
3434
+ " 'confirm': 10, "
3535
+ " 'queue-arguments': 'x-max-length=10,x-dead-letter-exchange=some.exchange.name,x-single-active-consumer=true', "
36+
+ " 'queue-pattern': 'gh-813-%d', "
37+
+ " 'queue-sequence-from': 0, "
38+
+ " 'queue-sequence-to': 3, "
3639
+ " 'flags': 'persistent,mandatory', "
3740
+ " 'auto-delete': 'false', "
3841
+ " 'body': ['file1.json','file2.json'], 'body-content-type' : 'application/json'}]}]";
@@ -54,6 +57,9 @@ public void paramsFromJSON() {
5457
.containsEntry("x-max-length", 10L)
5558
.containsEntry("x-dead-letter-exchange", "some.exchange.name")
5659
.containsEntry("x-single-active-consumer", true);
60+
assertThat(params.getQueuePattern()).isEqualTo("gh-813-%d");
61+
assertThat(params.getQueueSequenceFrom()).isEqualTo(0);
62+
assertThat(params.getQueueSequenceTo()).isEqualTo(3);
5763
assertThat(params.getFlags()).hasSize(2).containsExactly("persistent", "mandatory");
5864
assertThat(params.isAutoDelete()).isFalse();
5965
}

0 commit comments

Comments
 (0)