ARTEMIS-109 restore optional divert routing name
This commit is contained in:
parent
fd85bf7f75
commit
cb4d2e046e
|
@ -92,7 +92,14 @@ public class DivertConfiguration implements Serializable
|
|||
*/
|
||||
public DivertConfiguration setRoutingName(final String routingName)
|
||||
{
|
||||
this.routingName = routingName;
|
||||
if (routingName == null)
|
||||
{
|
||||
this.routingName = UUIDGenerator.getInstance().generateStringUUID();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.routingName = routingName;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue