mirror of https://github.com/apache/activemq.git
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:
parent
8d7d4e6df9
commit
7118247b65
|
@ -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);
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue