ARTEMIS-109 restore optional divert routing name

This commit is contained in:
jbertram 2015-06-11 16:05:34 -05:00
parent fd85bf7f75
commit cb4d2e046e
2 changed files with 25 additions and 1 deletions

View File

@ -91,8 +91,15 @@ public class DivertConfiguration implements Serializable
* @param routingName the routingName to set
*/
public DivertConfiguration setRoutingName(final String routingName)
{
if (routingName == null)
{
this.routingName = UUIDGenerator.getInstance().generateStringUUID();
}
else
{
this.routingName = routingName;
}
return this;
}

View File

@ -657,6 +657,23 @@ public class ActiveMQServerControlTest extends ManagementTestBase
}
@Test
public void testNullRouteNameOnDivert() throws Exception
{
String address = RandomUtil.randomString();
String name = RandomUtil.randomString();
String forwardingAddress = RandomUtil.randomString();
ActiveMQServerControl serverControl = createManagementControl();
checkNoResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name));
assertEquals(0, serverControl.getDivertNames().length);
serverControl.createDivert(name.toString(), null, address, forwardingAddress, true, null, null);
checkResource(ObjectNameBuilder.DEFAULT.getDivertObjectName(name));
}
@Test
public void testCreateAndDestroyDivert() throws Exception
{