1 18 package org.apache.activemq.broker; 19 20 public class TopicSubscriptionTest extends QueueSubscriptionTest { 21 22 protected void setUp() throws Exception { 23 super.setUp(); 24 durable = true; 25 topic = true; 26 } 27 28 public void testManyProducersManyConsumers() throws Exception { 29 consumerCount = 40; 30 producerCount = 20; 31 messageCount = 100; 32 messageSize = 1; 33 prefetchCount = 10; 34 35 doMultipleClientsTest(); 36 37 assertTotalMessagesReceived(messageCount * producerCount * consumerCount); 38 } 39 40 public void testOneProducerTwoConsumersLargeMessagesOnePrefetch() throws Exception { 41 consumerCount = 2; 42 producerCount = 1; 43 messageCount = 10; 44 messageSize = 1024 * 1024 * 1; prefetchCount = 1; 46 47 doMultipleClientsTest(); 48 49 assertTotalMessagesReceived(messageCount * consumerCount * producerCount); 50 } 51 52 public void testOneProducerTwoConsumersSmallMessagesOnePrefetch() throws Exception { 53 consumerCount = 2; 54 producerCount = 1; 55 prefetchCount = 1; 56 messageSize = 1024; 57 messageCount = 1000; 58 59 doMultipleClientsTest(); 60 61 assertTotalMessagesReceived(messageCount * consumerCount * producerCount); 62 } 63 64 public void testOneProducerTwoConsumersSmallMessagesLargePrefetch() throws Exception { 65 consumerCount = 2; 66 producerCount = 1; 67 messageCount = 1000; 68 messageSize = 1024; 69 prefetchCount = messageCount * 2; 70 71 doMultipleClientsTest(); 72 73 assertTotalMessagesReceived(messageCount * consumerCount * producerCount); 74 } 75 76 public void testOneProducerTwoConsumersLargeMessagesLargePrefetch() throws Exception { 77 consumerCount = 2; 78 producerCount = 1; 79 messageCount = 10; 80 messageSize = 1024 * 1024 * 1; prefetchCount = messageCount * 2; 82 83 doMultipleClientsTest(); 84 85 assertTotalMessagesReceived(messageCount * consumerCount * producerCount); 86 } 87 88 public void testOneProducerManyConsumersFewMessages() throws Exception { 89 consumerCount = 50; 90 producerCount = 1; 91 messageCount = 10; 92 messageSize = 1; prefetchCount = 10; 94 95 doMultipleClientsTest(); 96 97 assertTotalMessagesReceived(messageCount * consumerCount * producerCount); 98 } 99 100 public void testOneProducerManyConsumersManyMessages() throws Exception { 101 consumerCount = 50; 102 producerCount = 1; 103 messageCount = 100; 104 messageSize = 1; prefetchCount = 10; 106 107 doMultipleClientsTest(); 108 109 assertTotalMessagesReceived(messageCount * consumerCount * producerCount); 110 } 111 112 113 public void testManyProducersOneConsumer() throws Exception { 114 consumerCount = 1; 115 producerCount = 20; 116 messageCount = 100; 117 messageSize = 1; prefetchCount = 10; 119 120 doMultipleClientsTest(); 121 122 assertTotalMessagesReceived(messageCount * producerCount * consumerCount); 123 } 124 } 125 | Popular Tags |