msg.putStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID, new SimpleString("dupl-1"));
prod1.send(msg);
prod2.send(msg);
JMSQueueControl queueControl = createManagementControl();
JMSQueueControl otherQueueControl = ManagementControlHelper.createJMSQueueControl((HornetQQueue)otherQueue,
mbeanServer);
Assert.assertEquals(1, queueControl.getMessageCount());
Assert.assertEquals(1, otherQueueControl.getMessageCount());
int moved = queueControl.moveMessages(null, otherQueueName, true);
assertEquals(1, moved);
assertEquals(0, queueControl.getDeliveringCount());
session.start();
ClientConsumer cons1 = session.createConsumer(queue.getAddress());
assertNull(cons1.receiveImmediate());
cons1.close();
ClientConsumer cons2 = session.createConsumer(otherQueue.getAddress());
msg = cons2.receive(10000);
assertNotNull(msg);
msg.acknowledge();
cons2.close();
session.close();
sf.close();
locator.close();
Assert.assertEquals(0, queueControl.getMessageCount());
Assert.assertEquals(0, otherQueueControl.getMessageCount());
serverManager.destroyQueue(otherQueueName);
}