-
Notifications
You must be signed in to change notification settings - Fork 912
/
ScheduledDeliveryHandlerTest.java
1681 lines (1277 loc) · 38.7 KB
/
ScheduledDeliveryHandlerTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.core.server.impl;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import io.netty.buffer.ByteBuf;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.ActiveMQPropertyConversionException;
import org.apache.activemq.artemis.api.core.Message;
import org.apache.activemq.artemis.api.core.Pair;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.filter.Filter;
import org.apache.activemq.artemis.core.message.impl.CoreMessage;
import org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools;
import org.apache.activemq.artemis.core.paging.PagingStore;
import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
import org.apache.activemq.artemis.core.persistence.OperationContext;
import org.apache.activemq.artemis.core.persistence.Persister;
import org.apache.activemq.artemis.core.postoffice.Binding;
import org.apache.activemq.artemis.core.server.Consumer;
import org.apache.activemq.artemis.core.server.MessageReference;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.server.RoutingContext;
import org.apache.activemq.artemis.core.server.ServerConsumer;
import org.apache.activemq.artemis.core.transaction.Transaction;
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
import org.apache.activemq.artemis.utils.RandomUtil;
import org.apache.activemq.artemis.utils.ReferenceCounter;
import org.apache.activemq.artemis.utils.UUID;
import org.apache.activemq.artemis.utils.collections.NodeStore;
import org.apache.activemq.artemis.utils.collections.LinkedListIterator;
import org.apache.activemq.artemis.utils.critical.CriticalComponentImpl;
import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Test;
public class ScheduledDeliveryHandlerTest extends Assert {
private static final Logger log = Logger.getLogger(ScheduledDeliveryHandlerTest.class);
@Test
public void testScheduleRandom() throws Exception {
ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0));
long nextMessage = 0;
long NUMBER_OF_SEQUENCES = 100000;
for (int i = 0; i < NUMBER_OF_SEQUENCES; i++) {
int numberOfMessages = RandomUtil.randomInt() % 10;
if (numberOfMessages == 0)
numberOfMessages = 1;
long nextScheduledTime = RandomUtil.randomPositiveLong();
for (int j = 0; j < numberOfMessages; j++) {
boolean tail = RandomUtil.randomBoolean();
addMessage(handler, nextMessage++, nextScheduledTime, tail);
}
}
debugList(true, handler, nextMessage);
}
@Test
public void testScheduleSameTimeHeadAndTail() throws Exception {
ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0));
long time = System.currentTimeMillis() + 10000;
for (int i = 10001; i < 20000; i++) {
addMessage(handler, i, time, true);
}
addMessage(handler, 10000, time, false);
time = System.currentTimeMillis() + 5000;
for (int i = 1; i < 10000; i++) {
addMessage(handler, i, time, true);
}
addMessage(handler, 0, time, false);
debugList(true, handler, 20000);
validateSequence(handler);
}
@Test
public void testScheduleFixedSample() throws Exception {
ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0));
addMessage(handler, 0, 48L, true);
addMessage(handler, 1, 75L, true);
addMessage(handler, 2, 56L, true);
addMessage(handler, 3, 7L, false);
addMessage(handler, 4, 69L, true);
debugList(true, handler, 5);
}
@Test
public void testScheduleWithAddHeads() throws Exception {
ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0));
addMessage(handler, 0, 1, true);
addMessage(handler, 1, 2, true);
addMessage(handler, 2, 3, true);
addMessage(handler, 3, 3, true);
addMessage(handler, 4, 4, true);
addMessage(handler, 10, 5, false);
addMessage(handler, 9, 5, false);
addMessage(handler, 8, 5, false);
addMessage(handler, 7, 5, false);
addMessage(handler, 6, 5, false);
addMessage(handler, 5, 5, false);
validateSequence(handler);
}
@Test
public void testScheduleFixedSampleTailAndHead() throws Exception {
ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0));
// mix a sequence of tails / heads, but at the end this was supposed to be all sequential
addMessage(handler, 1, 48L, true);
addMessage(handler, 2, 48L, true);
addMessage(handler, 3, 48L, true);
addMessage(handler, 4, 48L, true);
addMessage(handler, 5, 48L, true);
addMessage(handler, 0, 48L, false);
addMessage(handler, 13, 59L, true);
addMessage(handler, 14, 59L, true);
addMessage(handler, 15, 59L, true);
addMessage(handler, 16, 59L, true);
addMessage(handler, 17, 59L, true);
addMessage(handler, 12, 59L, false);
addMessage(handler, 7, 49L, true);
addMessage(handler, 8, 49L, true);
addMessage(handler, 9, 49L, true);
addMessage(handler, 10, 49L, true);
addMessage(handler, 11, 49L, true);
addMessage(handler, 6, 49L, false);
validateSequence(handler);
}
@Test
public void testScheduleNow() throws Exception {
ExecutorService executor = Executors.newFixedThreadPool(50, ActiveMQThreadFactory.defaultThreadFactory());
ScheduledThreadPoolExecutor scheduler = new ScheduledThreadPoolExecutor(1, ActiveMQThreadFactory.defaultThreadFactory());
try {
for (int i = 0; i < 100; i++) {
// it's better to run the test a few times instead of run millions of messages here
internalSchedule(executor, scheduler);
}
} finally {
scheduler.shutdownNow();
executor.shutdownNow();
}
}
private void internalSchedule(ExecutorService executor, ScheduledThreadPoolExecutor scheduler) throws Exception {
final int NUMBER_OF_MESSAGES = 200;
int NUMBER_OF_THREADS = 20;
final FakeQueueForScheduleUnitTest fakeQueue = new FakeQueueForScheduleUnitTest(NUMBER_OF_MESSAGES * NUMBER_OF_THREADS);
final ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(scheduler, fakeQueue);
final long now = System.currentTimeMillis();
final CountDownLatch latchDone = new CountDownLatch(NUMBER_OF_THREADS);
final AtomicInteger error = new AtomicInteger(0);
class ProducerThread implements Runnable {
@Override
public void run() {
try {
for (int i = 0; i < NUMBER_OF_MESSAGES; i++) {
checkAndSchedule(handler, i, now, false, fakeQueue);
}
} catch (Exception e) {
e.printStackTrace();
error.incrementAndGet();
} finally {
latchDone.countDown();
}
}
}
for (int i = 0; i < NUMBER_OF_THREADS; i++) {
executor.execute(new ProducerThread());
}
assertTrue(latchDone.await(1, TimeUnit.MINUTES));
assertEquals(0, error.get());
if (!fakeQueue.waitCompletion(2, TimeUnit.SECONDS)) {
fail("Couldn't complete queue.add, expected " + NUMBER_OF_MESSAGES + ", still missing " + fakeQueue.expectedElements.toString());
}
}
private void validateSequence(ScheduledDeliveryHandlerImpl handler) throws Exception {
long lastSequence = -1;
for (MessageReference ref : handler.getScheduledReferences()) {
assertEquals(lastSequence + 1, ref.getMessage().getMessageID());
lastSequence = ref.getMessage().getMessageID();
}
}
private void addMessage(ScheduledDeliveryHandlerImpl handler,
long nextMessageID,
long nextScheduledTime,
boolean tail) {
MessageReferenceImpl refImpl = new MessageReferenceImpl(new FakeMessage(nextMessageID), null);
refImpl.setScheduledDeliveryTime(nextScheduledTime);
handler.addInPlace(nextScheduledTime, refImpl, tail);
}
private void checkAndSchedule(ScheduledDeliveryHandlerImpl handler,
long nextMessageID,
long nextScheduledTime,
boolean tail,
Queue queue) {
MessageReferenceImpl refImpl = new MessageReferenceImpl(new FakeMessage(nextMessageID), queue);
refImpl.setScheduledDeliveryTime(nextScheduledTime);
handler.checkAndSchedule(refImpl, tail);
}
private void debugList(boolean fail,
ScheduledDeliveryHandlerImpl handler,
long numberOfExpectedMessages) throws Exception {
List<MessageReference> refs = handler.getScheduledReferences();
HashSet<Long> messages = new HashSet<>();
long lastTime = -1;
for (MessageReference ref : refs) {
assertFalse(messages.contains(ref.getMessage().getMessageID()));
messages.add(ref.getMessage().getMessageID());
if (fail) {
assertTrue(ref.getScheduledDeliveryTime() >= lastTime);
} else {
if (ref.getScheduledDeliveryTime() < lastTime) {
log.debug("^^^fail at " + ref.getScheduledDeliveryTime());
}
}
lastTime = ref.getScheduledDeliveryTime();
}
for (long i = 0; i < numberOfExpectedMessages; i++) {
assertTrue(messages.contains(Long.valueOf(i)));
}
}
class FakeMessage implements Message {
@Override
public Object getUserContext(Object key) {
return null;
}
@Override
public void setUserContext(Object key, Object value) {
}
@Override
public String getProtocolName() {
// should normally not be visible in GUI
return getClass().getName();
}
@Override
public SimpleString getReplyTo() {
return null;
}
@Override
public Message setReplyTo(SimpleString address) {
return null;
}
@Override
public Object removeAnnotation(SimpleString key) {
return null;
}
@Override
public Object getAnnotation(SimpleString key) {
return null;
}
@Override
public void persist(ActiveMQBuffer targetRecord) {
}
@Override
public int getDurableCount() {
return 0;
}
@Override
public Long getScheduledDeliveryTime() {
return null;
}
@Override
public void reloadPersistence(ActiveMQBuffer record, CoreMessageObjectPools pools) {
}
@Override
public Persister<Message> getPersister() {
return null;
}
@Override
public int getPersistSize() {
return 0;
}
final long id;
@Override
public CoreMessage toCore() {
return toCore(null);
}
@Override
public CoreMessage toCore(CoreMessageObjectPools coreMessageObjectPools) {
return null;
}
FakeMessage(final long id) {
this.id = id;
}
@Override
public FakeMessage setMessageID(long id) {
return this;
}
@Override
public long getMessageID() {
return id;
}
@Override
public int durableUp() {
return 0;
}
@Override
public int durableDown() {
return 0;
}
@Override
public Message copy(long newID) {
return null;
}
@Override
public Message copy() {
return null;
}
@Override
public int getMemoryEstimate() {
return 0;
}
@Override
public int getRefCount() {
return 0;
}
@Override
public byte[] getDuplicateIDBytes() {
return new byte[0];
}
@Override
public Object getDuplicateProperty() {
return null;
}
@Override
public void messageChanged() {
}
@Override
public UUID getUserID() {
return null;
}
@Override
public String getAddress() {
return null;
}
@Override
public SimpleString getAddressSimpleString() {
return null;
}
@Override
public Message setAddress(String address) {
return null;
}
@Override
public Message setAddress(SimpleString address) {
return null;
}
@Override
public boolean isDurable() {
return false;
}
@Override
public FakeMessage setDurable(boolean durable) {
return this;
}
@Override
public long getExpiration() {
return 0;
}
@Override
public boolean isExpired() {
return false;
}
@Override
public FakeMessage setExpiration(long expiration) {
return this;
}
@Override
public long getTimestamp() {
return 0;
}
@Override
public FakeMessage setTimestamp(long timestamp) {
return this;
}
@Override
public byte getPriority() {
return 0;
}
@Override
public FakeMessage setPriority(byte priority) {
return this;
}
@Override
public int getEncodeSize() {
return 0;
}
@Override
public boolean isLargeMessage() {
return false;
}
@Override
public Message putBooleanProperty(SimpleString key, boolean value) {
return null;
}
@Override
public Message putBooleanProperty(String key, boolean value) {
return null;
}
@Override
public Message putByteProperty(SimpleString key, byte value) {
return null;
}
@Override
public Message putByteProperty(String key, byte value) {
return null;
}
@Override
public Message putBytesProperty(SimpleString key, byte[] value) {
return null;
}
@Override
public Message putBytesProperty(String key, byte[] value) {
return null;
}
@Override
public Message putShortProperty(SimpleString key, short value) {
return null;
}
@Override
public Message putShortProperty(String key, short value) {
return null;
}
@Override
public Message putCharProperty(SimpleString key, char value) {
return null;
}
@Override
public Message putCharProperty(String key, char value) {
return null;
}
@Override
public Message putIntProperty(SimpleString key, int value) {
return null;
}
@Override
public Message putIntProperty(String key, int value) {
return null;
}
@Override
public Message putLongProperty(SimpleString key, long value) {
return null;
}
@Override
public Message putLongProperty(String key, long value) {
return null;
}
@Override
public Message putFloatProperty(SimpleString key, float value) {
return null;
}
@Override
public Message putFloatProperty(String key, float value) {
return null;
}
@Override
public Message putDoubleProperty(SimpleString key, double value) {
return null;
}
@Override
public Message putDoubleProperty(String key, double value) {
return null;
}
@Override
public Message putStringProperty(SimpleString key, SimpleString value) {
return null;
}
@Override
public Message putStringProperty(SimpleString key, String value) {
return null;
}
@Override
public Message putStringProperty(String key, String value) {
return null;
}
@Override
public Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Object removeProperty(SimpleString key) {
return null;
}
@Override
public Object removeProperty(String key) {
return null;
}
@Override
public boolean containsProperty(SimpleString key) {
return false;
}
@Override
public boolean containsProperty(String key) {
return false;
}
@Override
public Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Boolean getBooleanProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Byte getByteProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Double getDoubleProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Integer getIntProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Long getLongProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Object getObjectProperty(SimpleString key) {
return null;
}
@Override
public Object getObjectProperty(String key) {
return null;
}
@Override
public Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Short getShortProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public Float getFloatProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public String getStringProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public String getStringProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException {
return null;
}
@Override
public byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException {
return new byte[0];
}
@Override
public byte[] getBytesProperty(String key) throws ActiveMQPropertyConversionException {
return new byte[0];
}
@Override
public Set<SimpleString> getPropertyNames() {
return null;
}
@Override
public Map<String, Object> toMap() {
return null;
}
@Override
public Map<String, Object> toPropertyMap() {
return null;
}
@Override
public Message setUserID(Object userID) {
return null;
}
@Override
public void receiveBuffer(ByteBuf buffer) {
}
@Override
public int getUsage() {
return 0;
}
@Override
public int usageUp() {
return 0;
}
@Override
public int usageDown() {
return 0;
}
@Override
public int refUp() {
return 0;
}
@Override
public int refDown() {
return 0;
}
@Override
public void sendBuffer(ByteBuf buffer, int count) {
}
@Override
public long getPersistentSize() throws ActiveMQException {
return 0;
}
@Override
public Object getOwner() {
return null;
}
@Override
public void setOwner(Object object) {
}
}
public class FakeQueueForScheduleUnitTest extends CriticalComponentImpl implements Queue {
@Override
public void setPurgeOnNoConsumers(boolean value) {
}
@Override
public boolean isEnabled() {
return false;
}
@Override
public void setEnabled(boolean value) {
}
@Override
public PagingStore getPagingStore() {
return null;
}
@Override
public int durableUp(Message message) {
return 1;
}
@Override
public int durableDown(Message message) {
return 1;
}
@Override
public void refUp(MessageReference messageReference) {
}
@Override
public MessageReference removeWithSuppliedID(String serverID, long id, NodeStore<MessageReference> nodeStore) {
return null;
}
@Override
public void expireReferences(Runnable done) {
}
@Override
public void refDown(MessageReference messageReference) {
}
@Override
public void removeAddress() throws Exception {
}
@Override
public long getAcknowledgeAttempts() {
return 0;
}
@Override
public boolean allowsReferenceCallback() {
return false;
}
@Override
public int getConsumersBeforeDispatch() {
return 0;
}
@Override
public void setConsumersBeforeDispatch(int consumersBeforeDispatch) {
}
@Override
public long getDelayBeforeDispatch() {
return 0;
}
@Override
public void setDelayBeforeDispatch(long delayBeforeDispatch) {
}
@Override
public long getDispatchStartTime() {
return 0;
}
@Override
public boolean isDispatching() {
return false;
}
@Override
public void setDispatching(boolean dispatching) {
}
@Override
public void setMaxConsumer(int maxConsumers) {
}
@Override
public int getGroupBuckets() {
return 0;
}
@Override
public void setGroupBuckets(int groupBuckets) {
}
@Override
public boolean isGroupRebalance() {
return false;
}
@Override
public void setGroupRebalance(boolean groupRebalance) {
}
@Override
public boolean isGroupRebalancePauseDispatch() {
return false;
}
@Override
public void setGroupRebalancePauseDispatch(boolean groupRebalancePauseDisptach) {
}
@Override
public SimpleString getGroupFirstKey() {
return null;
}
@Override
public void setGroupFirstKey(SimpleString groupFirstKey) {
}
@Override
public boolean isConfigurationManaged() {
return false;
}
@Override
public void setConfigurationManaged(boolean configurationManaged) {
}
@Override
public void recheckRefCount(OperationContext context) {
}
@Override
public void unproposed(SimpleString groupID) {
}
public FakeQueueForScheduleUnitTest(final int expectedElements) {
super(EmptyCriticalAnalyzer.getInstance(), 1);
this.expectedElements = new CountDownLatch(expectedElements);
}