1 18 package org.apache.activemq.filter; 19 20 import junit.framework.TestCase; 21 import org.apache.activemq.command.ActiveMQDestination; 22 import org.apache.activemq.command.ActiveMQTopic; 23 24 public class DestinationMapMemoryTest extends TestCase { 25 26 27 public void testLongDestinationPath() throws Exception { 28 ActiveMQTopic d1 = new ActiveMQTopic("1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18"); 29 DestinationMap map = new DestinationMap(); 30 map.put(d1, d1); 31 } 32 33 public void testVeryLongestinationPaths() throws Exception { 34 35 for (int i = 1; i < 100; i++) { 36 String name = "1"; 37 for (int j = 2; j <= i; j++) { 38 name += "." + j; 39 } 40 try { 42 ActiveMQDestination d1 = createDestination(name); 43 DestinationMap map = new DestinationMap(); 44 map.put(d1, d1); 45 } 46 catch (Throwable e) { 47 fail("Destination name too long: " + name + " : " + e); 48 } 49 } 50 } 51 52 protected ActiveMQDestination createDestination(String name) { 53 return new ActiveMQTopic(name); 54 } 55 } 56 | Popular Tags |