45
45
public class ConnectionRecovery extends BrokerTestCase {
46
46
private static final long RECOVERY_INTERVAL = 2000 ;
47
47
48
+ private static final int MANY_DECLARATIONS_LOOP_COUNT = 500 ;
49
+
48
50
@ Test public void connectionRecovery () throws IOException , InterruptedException {
49
51
assertTrue (connection .isOpen ());
50
52
closeAndWaitForRecovery ();
@@ -416,7 +418,7 @@ public void queueRecovered(String oldName, String newName) {
416
418
@ Test public void declarationOfManyAutoDeleteQueuesWithTransientConsumer () throws IOException , TimeoutException {
417
419
Channel ch = connection .createChannel ();
418
420
assertRecordedQueues (connection , 0 );
419
- for (int i = 0 ; i < 5000 ; i ++) {
421
+ for (int i = 0 ; i < MANY_DECLARATIONS_LOOP_COUNT ; i ++) {
420
422
String q = UUID .randomUUID ().toString ();
421
423
ch .queueDeclare (q , false , false , true , null );
422
424
DefaultConsumer dummy = new DefaultConsumer (ch );
@@ -430,7 +432,7 @@ public void queueRecovered(String oldName, String newName) {
430
432
@ Test public void declarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreUnbound () throws IOException , TimeoutException {
431
433
Channel ch = connection .createChannel ();
432
434
assertRecordedExchanges (connection , 0 );
433
- for (int i = 0 ; i < 5000 ; i ++) {
435
+ for (int i = 0 ; i < MANY_DECLARATIONS_LOOP_COUNT ; i ++) {
434
436
String x = UUID .randomUUID ().toString ();
435
437
ch .exchangeDeclare (x , "fanout" , false , true , null );
436
438
String q = ch .queueDeclare ().getQueue ();
@@ -446,7 +448,7 @@ public void queueRecovered(String oldName, String newName) {
446
448
@ Test public void declarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreDeleted () throws IOException , TimeoutException {
447
449
Channel ch = connection .createChannel ();
448
450
assertRecordedExchanges (connection , 0 );
449
- for (int i = 0 ; i < 5000 ; i ++) {
451
+ for (int i = 0 ; i < MANY_DECLARATIONS_LOOP_COUNT ; i ++) {
450
452
String x = UUID .randomUUID ().toString ();
451
453
ch .exchangeDeclare (x , "fanout" , false , true , null );
452
454
String q = ch .queueDeclare ().getQueue ();
@@ -460,7 +462,7 @@ public void queueRecovered(String oldName, String newName) {
460
462
@ Test public void declarationOfManyAutoDeleteExchangesWithTransientExchangesThatAreUnbound () throws IOException , TimeoutException {
461
463
Channel ch = connection .createChannel ();
462
464
assertRecordedExchanges (connection , 0 );
463
- for (int i = 0 ; i < 5000 ; i ++) {
465
+ for (int i = 0 ; i < MANY_DECLARATIONS_LOOP_COUNT ; i ++) {
464
466
String src = "src-" + UUID .randomUUID ().toString ();
465
467
String dest = "dest-" + UUID .randomUUID ().toString ();
466
468
ch .exchangeDeclare (src , "fanout" , false , true , null );
@@ -477,7 +479,7 @@ public void queueRecovered(String oldName, String newName) {
477
479
@ Test public void declarationOfManyAutoDeleteExchangesWithTransientExchangesThatAreDeleted () throws IOException , TimeoutException {
478
480
Channel ch = connection .createChannel ();
479
481
assertRecordedExchanges (connection , 0 );
480
- for (int i = 0 ; i < 5000 ; i ++) {
482
+ for (int i = 0 ; i < MANY_DECLARATIONS_LOOP_COUNT ; i ++) {
481
483
String src = "src-" + UUID .randomUUID ().toString ();
482
484
String dest = "dest-" + UUID .randomUUID ().toString ();
483
485
ch .exchangeDeclare (src , "fanout" , false , true , null );
0 commit comments