mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-27 22:09:18 +00:00
This closes #3345
This commit is contained in:
commit
905f897cb7
@ -464,7 +464,7 @@ public class ActiveMQDestination extends JNDIStorable implements Destination, Se
|
||||
// Public --------------------------------------------------------
|
||||
|
||||
public String getAddress() {
|
||||
return simpleAddress.toString();
|
||||
return simpleAddress != null ? simpleAddress.toString() : null;
|
||||
}
|
||||
|
||||
public SimpleString getSimpleAddress() {
|
||||
|
@ -21,6 +21,8 @@ import javax.jms.Queue;
|
||||
import javax.jms.Topic;
|
||||
|
||||
import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
|
||||
import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
|
||||
import org.apache.activemq.artemis.jms.client.ActiveMQTopic;
|
||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||
import org.apache.activemq.artemis.utils.RandomUtil;
|
||||
import org.junit.Assert;
|
||||
@ -81,6 +83,26 @@ public class ActiveMQDestinationTest extends ActiveMQTestBase {
|
||||
Assert.assertTrue(destination instanceof Destination);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueueToStringNPE() {
|
||||
ActiveMQDestination destination = new ActiveMQQueue();
|
||||
try {
|
||||
System.out.println("Destination: " + destination.toString());
|
||||
} catch (NullPointerException npe) {
|
||||
Assert.fail("Caught NPE!");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTopicToStringNPE() {
|
||||
ActiveMQDestination destination = new ActiveMQTopic();
|
||||
try {
|
||||
System.out.println("Destination: " + destination.toString());
|
||||
} catch (NullPointerException npe) {
|
||||
Assert.fail("Caught NPE!");
|
||||
}
|
||||
}
|
||||
|
||||
// Package protected ---------------------------------------------
|
||||
|
||||
// Protected -----------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user