mirror of https://github.com/apache/activemq.git
- Added default values
- Added checking for NPE git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@412670 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
663b8a24f9
commit
c56ae926a5
|
@ -29,6 +29,8 @@ import java.util.Properties;
|
|||
public class JmsClientSupport extends JmsFactorySupport {
|
||||
private static final Log log = LogFactory.getLog(JmsClientSupport.class);
|
||||
|
||||
public static final String DEFAULT_SPI_CLASS = "org.apache.activemq.tool.spi.ActiveMQPojoSPI";
|
||||
|
||||
private static final String PREFIX_CONFIG_CLIENT = "client.";
|
||||
public static final String SESSION_AUTO_ACKNOWLEDGE = "autoAck";
|
||||
public static final String SESSION_CLIENT_ACKNOWLEDGE = "clientAck";
|
||||
|
@ -40,7 +42,7 @@ public class JmsClientSupport extends JmsFactorySupport {
|
|||
protected Session jmsSession;
|
||||
|
||||
// Client settings
|
||||
protected String spiClass;
|
||||
protected String spiClass = DEFAULT_SPI_CLASS;
|
||||
protected boolean sessTransacted = false;
|
||||
protected String sessAckMode = SESSION_AUTO_ACKNOWLEDGE;
|
||||
protected String destName = "TEST.FOO";
|
||||
|
|
|
@ -38,7 +38,7 @@ public abstract class JmsClientSystemSupport {
|
|||
protected Properties jmsClientSettings = new Properties();
|
||||
protected ThreadGroup clientThreadGroup;
|
||||
protected PerfMeasurementTool performanceSampler;
|
||||
protected String reportDirectory;
|
||||
protected String reportDirectory = "";
|
||||
|
||||
protected int numClients = 1;
|
||||
protected int totalDests = 1;
|
||||
|
|
|
@ -62,10 +62,12 @@ public class JmsFactorySupport {
|
|||
|
||||
public void setJmsFactorySettings(Properties jmsFactorySettings) {
|
||||
this.jmsFactorySettings = jmsFactorySettings;
|
||||
try {
|
||||
spiFactory.configureConnectionFactory(jmsFactory, jmsFactorySettings);
|
||||
} catch (Exception e) {
|
||||
log.warn(e);
|
||||
if (spiFactory != null) {
|
||||
try {
|
||||
spiFactory.configureConnectionFactory(jmsFactory, jmsFactorySettings);
|
||||
} catch (Exception e) {
|
||||
log.warn(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,10 +81,14 @@ public class JmsFactorySupport {
|
|||
String val = settings.getProperty(key);
|
||||
setProperty(key, val);
|
||||
}
|
||||
try {
|
||||
spiFactory.configureConnectionFactory(jmsFactory, jmsFactorySettings);
|
||||
} catch (Exception e) {
|
||||
log.warn(e);
|
||||
|
||||
if (spiFactory != null) {
|
||||
try {
|
||||
spiFactory.configureConnectionFactory(jmsFactory, jmsFactorySettings);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.warn(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,8 @@ public class PerfReportGenerator {
|
|||
|
||||
public void startGenerateReport() {
|
||||
|
||||
setReportDirectory(this.getTestSettings().getProperty("sysTest.reportDirectory"));
|
||||
setReportDirectory(this.getTestSettings().getProperty("sysTest.reportDirectory", ""));
|
||||
|
||||
|
||||
File reportDir = new File(getReportDirectory());
|
||||
|
||||
|
|
Loading…
Reference in New Issue