} else { if (defaultDestination != null) { if (!destination.equals(defaultDestination)) { throw new UnsupportedOperationException("Where a default destination is specified " + "for the sender and a destination is " + "specified in the arguments to the send, " + "these destinations must be equal");
@Test public void testEquals() throws Exception { String destinationName = RandomUtil.randomString(); String address = QUEUE_QUALIFIED_PREFIX + destinationName; ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address); ActiveMQDestination sameDestination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address); ActiveMQDestination differentDestination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address + RandomUtil.randomString()); Assert.assertFalse(destination.equals(null)); Assert.assertTrue(destination.equals(destination)); Assert.assertTrue(destination.equals(sameDestination)); Assert.assertFalse(destination.equals(differentDestination)); }
if (defaultDestination != null && !destination.equals(defaultDestination)) {
if (defaultDestination != null && !destination.equals(defaultDestination)) {
} else { if (defaultDestination != null) { if (!destination.equals(defaultDestination)) { throw new UnsupportedOperationException("Where a default destination is specified " + "for the sender and a destination is " + "specified in the arguments to the send, " + "these destinations must be equal");
} else { if (defaultDestination != null) { if (!destination.equals(defaultDestination)) { throw new UnsupportedOperationException("Where a default destination is specified " + "for the sender and a destination is " + "specified in the arguments to the send, " + "these destinations must be equal");