Fixing unit test so that it uses a random port and changing the default
platform details to be "java" if there is an error
This commit is contained in:
Christopher L. Shannon (cshannon) 2016-07-28 13:10:44 -04:00
parent 8d7d4e6df9
commit 7118247b65
2 changed files with 5 additions and 4 deletions

View File

@ -157,7 +157,7 @@ public final class ActiveMQConnectionMetaData implements ConnectionMetaData {
* @return String containing the platform details
*/
private static String getPlatformDetails() {
String details = "unknown";
String details = "java";
try {
StringBuilder platformInfo = new StringBuilder(128);

View File

@ -31,6 +31,7 @@ import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQConnectionMetaData;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;
import org.apache.activemq.command.WireFormatInfo;
import org.apache.activemq.transport.DefaultTransportListener;
import org.junit.Test;
@ -42,8 +43,7 @@ public class WireFormatInfoPropertiesTest {
static final Logger LOG = LoggerFactory.getLogger(WireFormatInfoPropertiesTest.class);
protected BrokerService master;
protected final String brokerUri = "tcp://localhost:61616";
protected String brokerUri;
@Test
public void testClientProperties() throws Exception{
@ -104,7 +104,8 @@ public class WireFormatInfoPropertiesTest {
private BrokerService createBrokerService() throws Exception {
BrokerService service = new BrokerService();
service.addConnector(brokerUri);
TransportConnector connector = service.addConnector("tcp://localhost:0");
brokerUri = connector.getPublishableConnectString();
service.setPersistent(false);
service.setUseJmx(false);
service.setBrokerName("Master");