[jboss-cvs] JBossAS SVN: r63430 - in projects/admin-console/trunk: docs/Jms and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jun 8 13:26:46 EDT 2007
Author: chilin
Date: 2007-06-08 13:26:46 -0400 (Fri, 08 Jun 2007)
New Revision: 63430
Modified:
projects/admin-console/trunk/.classpath
projects/admin-console/trunk/docs/Jms/jms_elements.xls
projects/admin-console/trunk/docs/Jms/pdf/jms_elements.pdf
projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/BaseJmsAction.java
projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/JmsForm.java
projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/SaveJmsAction.java
projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/ViewJmsAction.java
projects/admin-console/trunk/src/main/org/jboss/admin/model/jms/Jms.java
projects/admin-console/trunk/src/main/org/jboss/admin/service/DeploymentServiceHelper.java
projects/admin-console/trunk/src/main/org/jboss/admin/service/MBeanServerHelper.java
projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/Constants.java
projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceDestinationHelper.java
projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceJmsHelper.java
projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/MBeanServerJmsHelper.java
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/classes/messages/jmsmessages.properties
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/persistenceSql.properties
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/struts-config.xml
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/tiles-defs.xml
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/validation.xml
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailConnFactory.jsp
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms.jsp
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms2.jsp
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms3.jsp
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms4.jsp
projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms5.jsp
projects/admin-console/trunk/src/test/org/jboss/admin/console/web/struts/jms/SaveJmsActionTest.java
projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceDestinationHelperTest.java
projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceJmsHelperTest.java
projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/MBeanServerJmsHelperTest.java
projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsPageTest.java
projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsQueueTest.java
projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsTopicTest.java
Log:
Made changes to support clustered post office.
Updated unit tests and webtests to cover the new jms pages (User Sql, PostOffice Sql, ConnectionFactory Settings, Clustered Settings).
Modified: projects/admin-console/trunk/.classpath
===================================================================
--- projects/admin-console/trunk/.classpath 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/.classpath 2007-06-08 17:26:46 UTC (rev 63430)
@@ -24,7 +24,7 @@
<classpathentry kind="var" path="JBOSS_HEAD/thirdparty/apache-lang/lib/commons-lang-2.1.jar"/>
<classpathentry kind="var" path="JBOSS_HOME/server/default/lib/commons-logging.jar"/>
<classpathentry kind="var" path="JBOSS_HOME/server/default/lib/jboss-messaging.jar"/>
- <classpathentry kind="var" path="JBOSS_HEAD/thirdparty/apache-pool/lib/commons-pool.jar"/>
+
<classpathentry kind="lib" path="tmp_libs/commons-validator-1.1.3.jar"/>
<classpathentry kind="var" path="JBOSS_HEAD/thirdparty/cglib/lib/cglib.jar"/>
<classpathentry kind="var" path="JBOSS_HEAD/thirdparty/asm/lib/asm.jar"/>
Modified: projects/admin-console/trunk/docs/Jms/jms_elements.xls
===================================================================
(Binary files differ)
Modified: projects/admin-console/trunk/docs/Jms/pdf/jms_elements.pdf
===================================================================
(Binary files differ)
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/BaseJmsAction.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/BaseJmsAction.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/BaseJmsAction.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -35,95 +35,123 @@
*/
public abstract class BaseJmsAction extends BaseAction {
- /**
- * The service that manages the jms attributes.
- */
- private JmsService jms;
+ /**
+ * The service that manages the jms attributes.
+ */
+ private JmsService jms;
- /**
- * Key used to locate jms service in the servlet context.
- */
- protected static final String SERVLET_CONTEXT_JMS_SERVICE_KEY = "jmsService";
+ /**
+ * Key used to locate jms service in the servlet context.
+ */
+ protected static final String SERVLET_CONTEXT_JMS_SERVICE_KEY = "jmsService";
- /**
- * Gets the jms service.
- * </p>
- * <p>
- * Unless setJmsService has already been called, the first time through this
- * method will check the servlet context for a JmsService implementation
- * stored under SERVLET_CONTEXT_JMS_SERVICE_KEY. If one is not found then a
- * JmsServiceImpl instance is used. This is to enable StrutsTestCase based
- * unit tests to provide a mock implementation of the JmsService.
- *
- * @return The jms service.
- */
- public JmsService getJmsService() {
- if (jms == null) {
- JmsService service = (JmsService) getServlet().getServletContext()
- .getAttribute(SERVLET_CONTEXT_JMS_SERVICE_KEY);
+ /**
+ * Gets the jms service.
+ * </p>
+ * <p>
+ * Unless setJmsService has already been called, the first time through this
+ * method will check the servlet context for a JmsService implementation
+ * stored under SERVLET_CONTEXT_JMS_SERVICE_KEY. If one is not found then a
+ * JmsServiceImpl instance is used. This is to enable StrutsTestCase based
+ * unit tests to provide a mock implementation of the JmsService.
+ *
+ * @return The jms service.
+ */
+ public JmsService getJmsService() {
+ if (jms == null) {
+ JmsService service = (JmsService) getServlet().getServletContext()
+ .getAttribute(SERVLET_CONTEXT_JMS_SERVICE_KEY);
- if (service == null) {
- service = new JmsServiceImpl();
- }
- jms = service;
- }
- return jms;
- }
+ if (service == null) {
+ service = new JmsServiceImpl();
+ }
+ jms = service;
+ }
+ return jms;
+ }
- /**
- * Break the long string of msg sql properties into individual sql statements
- * and store them into the msgSqlMap.
- *
- * @param jmsForm
- * The jms form bean where the msgSqlMap is located.
- */
- protected void buildMsgSqlMap(JmsForm jmsForm) {
- String SEPARATOR = AdminConstants.LINE_SEPARATOR;
- String key;
- String value;
- int inx;
- String sqlProperties = jmsForm.getMsgSqlProperties();
- if (sqlProperties != null) {
- String[] props = sqlProperties.split(SEPARATOR);
- for (int i = 0; i < props.length; i++) {
- if (!props[i].startsWith("#")) {
- inx = props[i].indexOf("=");
- key = props[i].substring(0, inx);
- value = props[i].substring(inx + 1);
- value = value.replaceAll("\\\\", ""); // Get rid of the
- // escape characters
- jmsForm.setMsgSqlEntry(key.trim(), value.trim());
- }
- }
- }
- }
+ /**
+ * Break the long string of msg sql properties into individual sql
+ * statements and store them into the msgSqlMap.
+ *
+ * @param jmsForm
+ * The jms form bean where the msgSqlMap is located.
+ */
+ protected void buildMsgSqlMap(JmsForm jmsForm) {
+ String SEPARATOR = AdminConstants.LINE_SEPARATOR;
+ String key;
+ String value;
+ int inx;
+ String sqlProperties = jmsForm.getMsgSqlProperties();
+ if (sqlProperties != null) {
+ String[] props = sqlProperties.split(SEPARATOR);
+ for (int i = 0; i < props.length; i++) {
+ if (!props[i].startsWith("#")) {
+ inx = props[i].indexOf("=");
+ key = props[i].substring(0, inx);
+ value = props[i].substring(inx + 1);
+ // Get rid of the escape characters by replacing "\\=" with
+ // "="
+ value = value.replaceAll("\\\\=", "=");
+ jmsForm.setMsgSqlEntry(key.trim(), value.trim());
+ }
+ }
+ }
+ }
- /**
- * Break the long string of user sql properties into individual sql statements
- * and store them into the userSqlMap.
- *
- * @param jmsForm
- * The jms form bean where the userSqlMap is located.
- */
- protected void buildUserSqlMap(JmsForm jmsForm) {
- String SEPARATOR = AdminConstants.LINE_SEPARATOR;
- String key;
- String value;
- int inx;
- String sqlProperties = jmsForm.getUserSqlProperties();
- if (sqlProperties != null) {
- String[] props = sqlProperties.split(SEPARATOR);
- for (int i = 0; i < props.length; i++) {
- if (!props[i].startsWith("#")) {
- inx = props[i].indexOf("=");
- key = props[i].substring(0, inx);
- value = props[i].substring(inx + 1);
- value = value.replaceAll("\\\\=", "="); // replace "\\=" by
- // "="
- jmsForm.setUserSqlEntry(key.trim(), value.trim());
- }
- }
- }
- }
+ /**
+ * Break the long string of user sql properties into individual sql
+ * statements and store them into the userSqlMap.
+ *
+ * @param jmsForm
+ * The jms form bean where the userSqlMap is located.
+ */
+ protected void buildUserSqlMap(JmsForm jmsForm) {
+ String SEPARATOR = AdminConstants.LINE_SEPARATOR;
+ String key;
+ String value;
+ int inx;
+ String sqlProperties = jmsForm.getUserSqlProperties();
+ if (sqlProperties != null) {
+ String[] props = sqlProperties.split(SEPARATOR);
+ for (int i = 0; i < props.length; i++) {
+ if (!props[i].startsWith("#")) {
+ inx = props[i].indexOf("=");
+ key = props[i].substring(0, inx);
+ value = props[i].substring(inx + 1);
+ // Replace "\\=" by "="
+ value = value.replaceAll("\\\\=", "=");
+ jmsForm.setUserSqlEntry(key.trim(), value.trim());
+ }
+ }
+ }
+ }
+
+ /**
+ * Break the long string of PostOffice sql properties into individual sql
+ * statements and store them into the postOfficeSqlMap.
+ *
+ * @param jmsForm
+ * The jms form bean where the postOfficeSqlMap is located.
+ */
+ protected void buildPostOfficeSqlMap(JmsForm jmsForm) {
+ String SEPARATOR = AdminConstants.LINE_SEPARATOR;
+ String key;
+ String value;
+ int inx;
+ String sqlProperties = jmsForm.getPostOfficeSqlProperties();
+ if (sqlProperties != null) {
+ String[] props = sqlProperties.split(SEPARATOR);
+ for (int i = 0; i < props.length; i++) {
+ if (!props[i].startsWith("#")) {
+ inx = props[i].indexOf("=");
+ key = props[i].substring(0, inx);
+ value = props[i].substring(inx + 1);
+ // Replace "\\=" by "="
+ value = value.replaceAll("\\\\=", "=");
+ jmsForm.setPostOfficeSqlEntry(key.trim(), value.trim());
+ }
+ }
+ }
+ }
}
-
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/JmsForm.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/JmsForm.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/JmsForm.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -36,6 +36,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;
+import org.w3c.dom.Element;
/**
* The JmsForm type holds the form data for Jms attributes.
@@ -168,7 +169,13 @@
private String maxParams;
/**
- * The name of the DataSource used by the persistence manager
+ * The JNDI name of the DataSource used by the persistence manager
+ */
+ private String msgDataSource;
+
+ /**
+ * The name of the DataSource used by the persistence manager, without the
+ * JNDI prefix
*/
private String msgDataSourceName;
@@ -207,7 +214,13 @@
private boolean createUserTablesOnStartup;
/**
- * The name of the DataSource used by the JMSUserManager
+ * The JNDI name of the DataSource used by the JMSUserManager
+ */
+ private String userDataSource;
+
+ /**
+ * The name of the DataSource used by the JMSUserManager, without the JNDI
+ * prefix
*/
private String userDataSourceName;
@@ -245,6 +258,73 @@
*/
private String postOfficeName;
+/* --- Clustered Attributes --- */
+
+ /**
+ * The name of the JGroups group to use.
+ */
+ private String groupName;
+
+ /**
+ * Timeout for getState().
+ */
+ private String stateTimeout;
+
+ /**
+ * Timeout for getState().
+ */
+ private String castTimeout;
+
+ /**
+ * The period in milliseconds between a post office casting it's statistics across the cluster.
+ */
+ private String statsSendPeriod;
+
+ /**
+ * The fully qualified class name of the class to use to implement the message pull policy for rebalancing.
+ */
+ private String messagePullPolicy;
+
+ /**
+ * The fully qualified class name of the class to use to implement the factory that generates cluster routers.
+ */
+ private String clusterRouterFactory;
+
+ /**
+ * The ObjectName of the JGroups Multiplexer used to create JChannels.
+ */
+ private String channelFactoryName;
+
+ /**
+ * The name of the stack used on multiplexer for Sync Channels.
+ */
+ private String syncChannelName;
+
+ /**
+ * The name of the stack used on multiplexer for Async Channels.
+ */
+ private String asyncChannelName;
+
+ /**
+ * The partition name used to identify JMS/Postoffice on the JGroups Multiplexor.
+ */
+ private String channelPartitionName;
+
+ /**
+ * The size of the thread pool used to perform various asynchronous clustering operations.
+ */
+ private String threadPoolSize;
+
+ /**
+ * The JGroups stack configuration for the synchronous channel.
+ */
+ private Map syncChannelConfig;
+
+ /**
+ * The JGroups stack configuration for the asynchronous channel.
+ */
+ private Map asyncChannelConfig;
+
/*
* ********** Attributes from the ConnectionFactory MBean **********
*/
@@ -282,6 +362,11 @@
* created from this connection factory
*/
private String dupsOKBatchSize;
+
+ /**
+ * The element containing the JNDI bindings this connection factory is to be bound under.
+ */
+ private String jndiBindingsText;
/**
* The pluggable load balancing policy factory that is used to decide the
@@ -303,6 +388,11 @@
/*
* *************** Other Attributes ********************************
*/
+
+ /**
+ * Indicate if the post office supports clustered configuration.
+ */
+ private boolean clusteredPostOffice;
/**
* Save the persistence dataSource name. Needed when a new dataSource is selected.
@@ -613,6 +703,20 @@
}
/**
+ * @return Returns the msgDataSource.
+ */
+ public String getMsgDataSource() {
+ return msgDataSource;
+ }
+
+ /**
+ * @param msgDataSource The msgDataSource to set.
+ */
+ public void setMsgDataSource(String msgDataSource) {
+ this.msgDataSource = msgDataSource;
+ }
+
+ /**
* @return Returns the msgDataSourceName.
*/
public String getMsgDataSourceName() {
@@ -866,6 +970,20 @@
}
/**
+ * @return Returns the userDataSource.
+ */
+ public String getUserDataSource() {
+ return userDataSource;
+ }
+
+ /**
+ * @param userDataSource The userDataSource to set.
+ */
+ public void setUserDataSource(String userDataSource) {
+ this.userDataSource = userDataSource;
+ }
+
+ /**
* @return Returns the userDataSourceName.
*/
public String getUserDataSourceName() {
@@ -950,6 +1068,202 @@
}
/**
+ * @return Returns the asyncChannelConfig.
+ */
+ public Map getAsyncChannelConfig() {
+ return asyncChannelConfig;
+ }
+
+ /**
+ * @param asyncChannelConfig The asyncChannelConfig to set.
+ */
+ public void setAsyncChannelConfig(Map asyncChannelConfig) {
+ this.asyncChannelConfig = asyncChannelConfig;
+ }
+
+ /**
+ * @return Returns the asyncChannelName.
+ */
+ public String getAsyncChannelName() {
+ return asyncChannelName;
+ }
+
+ /**
+ * @param asyncChannelName The asyncChannelName to set.
+ */
+ public void setAsyncChannelName(String asyncChannelName) {
+ this.asyncChannelName = asyncChannelName;
+ }
+
+ /**
+ * @return Returns the castTimeout.
+ */
+ public String getCastTimeout() {
+ return castTimeout;
+ }
+
+ /**
+ * @param castTimeout The castTimeout to set.
+ */
+ public void setCastTimeout(String castTimeout) {
+ this.castTimeout = castTimeout;
+ }
+
+ /**
+ * @return Returns the channelFactoryName.
+ */
+ public String getChannelFactoryName() {
+ return channelFactoryName;
+ }
+
+ /**
+ * @param channelFactoryName The channelFactoryName to set.
+ */
+ public void setChannelFactoryName(String channelFactoryName) {
+ this.channelFactoryName = channelFactoryName;
+ }
+
+ /**
+ * @return Returns the channelPartitionName.
+ */
+ public String getChannelPartitionName() {
+ return channelPartitionName;
+ }
+
+ /**
+ * @param channelPartitionName The channelPartitionName to set.
+ */
+ public void setChannelPartitionName(String channelPartitionName) {
+ this.channelPartitionName = channelPartitionName;
+ }
+
+ /**
+ * @return Returns the clusteredPostOffice.
+ */
+ public boolean isClusteredPostOffice() {
+ return clusteredPostOffice;
+ }
+
+ /**
+ * @param clusteredPostOffice The clusteredPostOffice to set.
+ */
+ public void setClusteredPostOffice(boolean clusteredPostOffice) {
+ this.clusteredPostOffice = clusteredPostOffice;
+ }
+
+ /**
+ * @return Returns the clusterRouterFactory.
+ */
+ public String getClusterRouterFactory() {
+ return clusterRouterFactory;
+ }
+
+ /**
+ * @param clusterRouterFactory The clusterRouterFactory to set.
+ */
+ public void setClusterRouterFactory(String clusterRouterFactory) {
+ this.clusterRouterFactory = clusterRouterFactory;
+ }
+
+ /**
+ * @return Returns the groupName.
+ */
+ public String getGroupName() {
+ return groupName;
+ }
+
+ /**
+ * @param groupName The groupName to set.
+ */
+ public void setGroupName(String groupName) {
+ this.groupName = groupName;
+ }
+
+ /**
+ * @return Returns the messagePullPolicy.
+ */
+ public String getMessagePullPolicy() {
+ return messagePullPolicy;
+ }
+
+ /**
+ * @param messagePullPolicy The messagePullPolicy to set.
+ */
+ public void setMessagePullPolicy(String messagePullPolicy) {
+ this.messagePullPolicy = messagePullPolicy;
+ }
+
+ /**
+ * @return Returns the stateTimeout.
+ */
+ public String getStateTimeout() {
+ return stateTimeout;
+ }
+
+ /**
+ * @param stateTimeout The stateTimeout to set.
+ */
+ public void setStateTimeout(String stateTimeout) {
+ this.stateTimeout = stateTimeout;
+ }
+
+ /**
+ * @return Returns the statsSendPeriod.
+ */
+ public String getStatsSendPeriod() {
+ return statsSendPeriod;
+ }
+
+ /**
+ * @param statsSendPeriod The statsSendPeriod to set.
+ */
+ public void setStatsSendPeriod(String statsSendPeriod) {
+ this.statsSendPeriod = statsSendPeriod;
+ }
+
+ /**
+ * @return Returns the syncChannelConfig.
+ */
+ public Map getSyncChannelConfig() {
+ return syncChannelConfig;
+ }
+
+ /**
+ * @param syncChannelConfig The syncChannelConfig to set.
+ */
+ public void setSyncChannelConfig(Map syncChannelConfig) {
+ this.syncChannelConfig = syncChannelConfig;
+ }
+
+ /**
+ * @return Returns the syncChannelName.
+ */
+ public String getSyncChannelName() {
+ return syncChannelName;
+ }
+
+ /**
+ * @param syncChannelName The syncChannelName to set.
+ */
+ public void setSyncChannelName(String syncChannelName) {
+ this.syncChannelName = syncChannelName;
+ }
+
+ /**
+ * @return Returns the threadPoolSize.
+ */
+ public String getThreadPoolSize() {
+ return threadPoolSize;
+ }
+
+ /**
+ * @param threadPoolSize The threadPoolSize to set.
+ */
+ public void setThreadPoolSize(String threadPoolSize) {
+ this.threadPoolSize = threadPoolSize;
+ }
+
+ /**
* @return Returns the clustered.
*/
public boolean isClustered() {
@@ -1021,6 +1335,20 @@
}
/**
+ * @return Returns the jndiBindingsText.
+ */
+ public String getJndiBindingsText() {
+ return jndiBindingsText;
+ }
+
+ /**
+ * @param jndiBindingsText The jndiBindingsText to set.
+ */
+ public void setJndiBindingsText(String jndiBindingsText) {
+ this.jndiBindingsText = jndiBindingsText;
+ }
+
+ /**
* @return Returns the loadBalancingFactory.
*/
public String getLoadBalancingFactory() {
@@ -1157,6 +1485,32 @@
}
return dsOptions;
}
+
+ /**
+ * Gets the asyncChannelConfig entry with the specified key
+ * @param key
+ * The key of the map entry
+ * @return Returns the map entry with the specified key.
+ */
+ public Object getAsyncChannelConfigEntry(String key) {
+ Object result = null;
+ if (key != null)
+ result = asyncChannelConfig.get(key);
+ return result;
+ }
+
+ /**
+ * Gets the syncChannelConfig entry with the specified key
+ * @param key
+ * The key of the map entry
+ * @return Returns the map entry with the specified key.
+ */
+ public Object getSyncChannelConfigEntry(String key) {
+ Object result = null;
+ if (key != null)
+ result = syncChannelConfig.get(key);
+ return result;
+ }
/**
* Gets the msgSqlMap entry with the specified key.
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/SaveJmsAction.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/SaveJmsAction.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/SaveJmsAction.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -179,6 +179,8 @@
.setMsgSqlProperties(concatSqlProperties(jmsForm.getMsgSqlMap()));
jmsForm.setUserSqlProperties(concatSqlProperties(jmsForm
.getUserSqlMap()));
+ jmsForm.setPostOfficeSqlProperties(concatSqlProperties(jmsForm
+ .getPostOfficeSqlMap()));
/*
* Copy the jms properties from the form object to the value object:
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/ViewJmsAction.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/ViewJmsAction.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/console/web/struts/jms/ViewJmsAction.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -78,14 +78,17 @@
*/
buildMsgSqlMap(jmsForm);
buildUserSqlMap(jmsForm);
+ buildPostOfficeSqlMap(jmsForm);
/*
* Save a copy of the data source names and the sql maps:
*/
jmsForm.setSavedMsgDataSourceName(jmsForm.getMsgDataSourceName());
jmsForm.setSavedUserDataSourceName(jmsForm.getUserDataSourceName());
+ jmsForm.setSavedPostOfficeDataSourceName(jmsForm.getPostOfficeDataSourceName());
jmsForm.saveMsgSqlMap();
jmsForm.saveUserSqlMap();
+ jmsForm.savePostOfficeSqlMap();
request.getSession().setAttribute("jms", jmsForm);
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/model/jms/Jms.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/model/jms/Jms.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/model/jms/Jms.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -253,6 +253,73 @@
* The name of the post office
*/
private String postOfficeName;
+
+ /* --- Clustered Attributes --- */
+
+ /**
+ * The name of the JGroups group to use.
+ */
+ private String groupName;
+
+ /**
+ * Timeout for getState().
+ */
+ private long stateTimeout;
+
+ /**
+ * Timeout for getState().
+ */
+ private long castTimeout;
+
+ /**
+ * The period in milliseconds between a post office casting it's statistics across the cluster.
+ */
+ private long statsSendPeriod;
+
+ /**
+ * The fully qualified class name of the class to use to implement the message pull policy for rebalancing.
+ */
+ private String messagePullPolicy;
+
+ /**
+ * The fully qualified class name of the class to use to implement the factory that generates cluster routers.
+ */
+ private String clusterRouterFactory;
+
+ /**
+ * The ObjectName of the JGroups Multiplexer used to create JChannels.
+ */
+ private String channelFactoryName;
+
+ /**
+ * The name of the stack used on multiplexer for Sync Channels.
+ */
+ private String syncChannelName;
+
+ /**
+ * The name of the stack used on multiplexer for Async Channels.
+ */
+ private String asyncChannelName;
+
+ /**
+ * The partition name used to identify JMS/Postoffice on the JGroups Multiplexor.
+ */
+ private String channelPartitionName;
+
+ /**
+ * The size of the thread pool used to perform various asynchronous clustering operations.
+ */
+ private int threadPoolSize;
+
+ /**
+ * The JGroups stack configuration for the synchronous channel.
+ */
+ private Map syncChannelConfig;
+
+ /**
+ * The JGroups stack configuration for the asynchronous channel.
+ */
+ private Map asyncChannelConfig;
/*
* ********** Attributes from the ConnectionFactory MBean **********
@@ -291,6 +358,11 @@
* created from this connection factory
*/
private int dupsOKBatchSize;
+
+ /**
+ * The element containing the JNDI bindings this connection factory is to be bound under.
+ */
+ private String jndiBindingsText;
/**
* The pluggable load balancing policy factory that is used to decide the
@@ -312,6 +384,11 @@
/*
* *************** Other Attributes ********************************
*/
+
+ /**
+ * Indicate if the post office supports clustered configuration.
+ */
+ private boolean clusteredPostOffice;
/**
* The names of all the available dataSources.
@@ -925,6 +1002,202 @@
}
/**
+ * @return Returns the asyncChannelConfig.
+ */
+ public Map getAsyncChannelConfig() {
+ return asyncChannelConfig;
+ }
+
+ /**
+ * @param asyncChannelConfig The asyncChannelConfig to set.
+ */
+ public void setAsyncChannelConfig(Map asyncChannelConfig) {
+ this.asyncChannelConfig = asyncChannelConfig;
+ }
+
+ /**
+ * @return Returns the asyncChannelName.
+ */
+ public String getAsyncChannelName() {
+ return asyncChannelName;
+ }
+
+ /**
+ * @param asyncChannelName The asyncChannelName to set.
+ */
+ public void setAsyncChannelName(String asyncChannelName) {
+ this.asyncChannelName = asyncChannelName;
+ }
+
+ /**
+ * @return Returns the castTimeout.
+ */
+ public long getCastTimeout() {
+ return castTimeout;
+ }
+
+ /**
+ * @param castTimeout The castTimeout to set.
+ */
+ public void setCastTimeout(long castTimeout) {
+ this.castTimeout = castTimeout;
+ }
+
+ /**
+ * @return Returns the channelFactoryName.
+ */
+ public String getChannelFactoryName() {
+ return channelFactoryName;
+ }
+
+ /**
+ * @param channelFactoryName The channelFactoryName to set.
+ */
+ public void setChannelFactoryName(String channelFactoryName) {
+ this.channelFactoryName = channelFactoryName;
+ }
+
+ /**
+ * @return Returns the channelPartitionName.
+ */
+ public String getChannelPartitionName() {
+ return channelPartitionName;
+ }
+
+ /**
+ * @param channelPartitionName The channelPartitionName to set.
+ */
+ public void setChannelPartitionName(String channelPartitionName) {
+ this.channelPartitionName = channelPartitionName;
+ }
+
+ /**
+ * @return Returns the clusteredPostOffice.
+ */
+ public boolean isClusteredPostOffice() {
+ return clusteredPostOffice;
+ }
+
+ /**
+ * @param clusteredPostOffice The clusteredPostOffice to set.
+ */
+ public void setClusteredPostOffice(boolean clusteredPostOffice) {
+ this.clusteredPostOffice = clusteredPostOffice;
+ }
+
+ /**
+ * @return Returns the clusterRouterFactory.
+ */
+ public String getClusterRouterFactory() {
+ return clusterRouterFactory;
+ }
+
+ /**
+ * @param clusterRouterFactory The clusterRouterFactory to set.
+ */
+ public void setClusterRouterFactory(String clusterRouterFactory) {
+ this.clusterRouterFactory = clusterRouterFactory;
+ }
+
+ /**
+ * @return Returns the groupName.
+ */
+ public String getGroupName() {
+ return groupName;
+ }
+
+ /**
+ * @param groupName The groupName to set.
+ */
+ public void setGroupName(String groupName) {
+ this.groupName = groupName;
+ }
+
+ /**
+ * @return Returns the messagePullPolicy.
+ */
+ public String getMessagePullPolicy() {
+ return messagePullPolicy;
+ }
+
+ /**
+ * @param messagePullPolicy The messagePullPolicy to set.
+ */
+ public void setMessagePullPolicy(String messagePullPolicy) {
+ this.messagePullPolicy = messagePullPolicy;
+ }
+
+ /**
+ * @return Returns the stateTimeout.
+ */
+ public long getStateTimeout() {
+ return stateTimeout;
+ }
+
+ /**
+ * @param stateTimeout The stateTimeout to set.
+ */
+ public void setStateTimeout(long stateTimeout) {
+ this.stateTimeout = stateTimeout;
+ }
+
+ /**
+ * @return Returns the statsSendPeriod.
+ */
+ public long getStatsSendPeriod() {
+ return statsSendPeriod;
+ }
+
+ /**
+ * @param statsSendPeriod The statsSendPeriod to set.
+ */
+ public void setStatsSendPeriod(long statsSendPeriod) {
+ this.statsSendPeriod = statsSendPeriod;
+ }
+
+ /**
+ * @return Returns the syncChannelConfig.
+ */
+ public Map getSyncChannelConfig() {
+ return syncChannelConfig;
+ }
+
+ /**
+ * @param syncChannelConfig The syncChannelConfig to set.
+ */
+ public void setSyncChannelConfig(Map syncChannelConfig) {
+ this.syncChannelConfig = syncChannelConfig;
+ }
+
+ /**
+ * @return Returns the syncChannelName.
+ */
+ public String getSyncChannelName() {
+ return syncChannelName;
+ }
+
+ /**
+ * @param syncChannelName The syncChannelName to set.
+ */
+ public void setSyncChannelName(String syncChannelName) {
+ this.syncChannelName = syncChannelName;
+ }
+
+ /**
+ * @return Returns the threadPoolSize.
+ */
+ public int getThreadPoolSize() {
+ return threadPoolSize;
+ }
+
+ /**
+ * @param threadPoolSize The threadPoolSize to set.
+ */
+ public void setThreadPoolSize(int threadPoolSize) {
+ this.threadPoolSize = threadPoolSize;
+ }
+
+ /**
* @return Returns the clustered.
*/
public boolean isClustered() {
@@ -995,6 +1268,20 @@
}
/**
+ * @return Returns the jndiBindingsText.
+ */
+ public String getJndiBindingsText() {
+ return jndiBindingsText;
+ }
+
+ /**
+ * @param jndiBindingsText The jndiBindingsText to set.
+ */
+ public void setJndiBindingsText(String jndiBindingsText) {
+ this.jndiBindingsText = jndiBindingsText;
+ }
+
+ /**
* @return Returns the loadBalancingFactory.
*/
public String getLoadBalancingFactory() {
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/service/DeploymentServiceHelper.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/service/DeploymentServiceHelper.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/service/DeploymentServiceHelper.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -30,6 +30,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.admin.AdminConstants;
import org.jboss.services.deployment.DeploymentServiceMBean;
import org.jboss.services.deployment.MBeanData;
import org.w3c.dom.Element;
@@ -68,7 +69,7 @@
/**
* Misc strings used during security roles conversion.
*/
- private static final String SEPARATOR = "\r\n";
+ protected static final String SEPARATOR = AdminConstants.LINE_SEPARATOR;
private static final String SECURITY_NODE = "<security>";
@@ -87,6 +88,7 @@
private static final String TRUE_VALUE = "'true'";
private static final String FALSE_VALUE = "'false'";
+
private MBeanServerHelper mbeanServerHelper;
@@ -220,7 +222,7 @@
*/
for (int i = 0; i < roleArray.length; i++) {
roleStr = roleArray[i];
- if (roleStr != null && !"".equals(roles.trim())) {
+ if (roleStr != null && !"".equals(roleStr.trim())) {
nameInx = roleStr.indexOf(":");
if (nameInx < 0)
nameInx = roleStr.length();
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/service/MBeanServerHelper.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/service/MBeanServerHelper.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/service/MBeanServerHelper.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -366,5 +366,4 @@
}
return roleList.toString();
}
-
}
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/Constants.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/Constants.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/Constants.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -43,6 +43,7 @@
DEFAULT_TEMP_QUEUE_FULL_SIZE = "DefaultTempQueueFullSize",
DEFAULT_TEMP_QUEUE_PAGE_SIZE = "DefaultTempQueuePageSize",
DUPS_OK_BATCH_SIZE = "DupsOKBatchSize",
+ JNDI_BINDINGS = "JNDIBindings",
LOAD_BALANCING_FACTORY = "LoadBalancingFactory",
PREFETCH_SIZE = "PrefetchSize",
SERVER_PEER = "ServerPeer",
@@ -74,11 +75,25 @@
DATA_SOURCE = "DataSource",
SQL_PROPERTIES = "SqlProperties",
TRANSACTION_MANAGER = "TransactionManager",
- DATA_SOURCE_BINDING = "DataSourceBinding",
USING_BATCH_UPDATES = "UsingBatchUpdates",
USING_BINARY_STREAM = "UsingBinaryStream",
USING_TRAILING_BYTE = "UsingTrailingByte",
- POST_OFFICE_NAME = "PostOfficeName";
+ POST_OFFICE_NAME = "PostOfficeName",
+
+ // Attributes of clustered PostOffice:
+ ASYNC_CHANNEL_CONFIG = "AsyncChannelConfig",
+ ASYNC_CHANNEL_NAME = "AsyncChannelName",
+ CAST_TIMEOUT = "CastTimeout",
+ CHANNEL_FACTORY_NAME = "ChannelFactoryName",
+ CHANNEL_PARTITION_NAME = "ChannelPartitionName",
+ CLUSTER_ROUTER_FACTORY = "ClusterRouterFactory",
+ GROUP_NAME = "GroupName",
+ MESSAGE_PULL_POLICY = "MessagePullPolicy",
+ STATS_SEND_PERIOD = "StatsSendPeriod",
+ STATE_TIMEOUT = "StateTimeout",
+ SYNC_CHANNEL_CONFIG = "SyncChannelConfig",
+ SYNC_CHANNEL_NAME = "SyncChannelName",
+ THREAD_POOL_SIZE = "ThreadPoolSize";
protected static final String
CONNECTION_FACTORY_MBEAN = "jboss.messaging.connectionfactory:service=ConnectionFactory",
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceDestinationHelper.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceDestinationHelper.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceDestinationHelper.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -39,6 +39,7 @@
import org.jboss.admin.model.jms.Topic;
import org.jboss.admin.service.DeploymentServiceHelper;
import org.jboss.admin.service.MBeanServerHelper;
+import org.jboss.admin.service.datasource.DataSourceService;
import org.jboss.deployment.DeploymentInfo;
import org.jboss.services.deployment.DeploymentServiceMBean;
@@ -502,4 +503,12 @@
putProperty(Constants.CommonAttributes.SECURITY_CONFIG, secConfig,
props);
}
+
+ /**
+ * This method is available for testing purposes only.
+ * @param jms
+ */
+ protected void setJms(Jms jms) {
+ this.jms = jms;
+ }
}
\ No newline at end of file
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceJmsHelper.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceJmsHelper.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/DeploymentServiceJmsHelper.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -22,7 +22,10 @@
package org.jboss.admin.service.jms;
+import java.util.Iterator;
+import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -39,6 +42,24 @@
*/
public class DeploymentServiceJmsHelper extends DeploymentServiceHelper {
/**
+ * Misc strings used during jndi bindings conversion.
+ */
+ private static final String BINDINGS_NODE = "<bindings>";
+
+ private static final String BINDINGS_NODE_END = "</bindings>";
+
+ private static final String BINDING_NODE = "<binding>";
+
+ private static final String BINDING_NODE_END = "</binding>";
+
+ /**
+ * Misc strings used during channel config conversion.
+ */
+ private static final String CONFIG_NODE = "<config>";
+
+ private static final String CONFIG_NODE_END = "</config>";
+
+ /**
* Logger for this class
*/
private static Log logger = LogFactory
@@ -75,6 +96,9 @@
.getDefaultTempQueuePageSize(), attrs);
putProperty(Constants.JmsAttributes.DUPS_OK_BATCH_SIZE, jms
.getDupsOKBatchSize(), attrs);
+ String bindingsXml = convertJndiBindingsToXml(jms
+ .getJndiBindingsText());
+ putProperty(Constants.JmsAttributes.JNDI_BINDINGS, bindingsXml, attrs);
putProperty(Constants.JmsAttributes.PREFETCH_SIZE, jms
.getPrefetchSize(), attrs);
@@ -124,8 +148,7 @@
.getPersistenceManagerName(), depends);
putProperty(Constants.JmsAttributes.JMS_USER_MANAGER, jms
.getUserManagerName(), depends);
- putProperty(Constants.JmsAttributes.CONNECTOR, jms.getConnectorName(),
- depends);
+ putProperty("", jms.getConnectorName(), depends); // Blank key
updateMBeanAttributes(Constants.JmsAttributes.SERVER_PEER_MBEAN, attrs,
depends);
@@ -157,8 +180,7 @@
depends.clear();
String dataSourceBinding = Constants.JmsAttributes.DATA_SOURCE_BINDING_PREFIX
+ jms.getMsgDataSourceName();
- putProperty(Constants.JmsAttributes.DATA_SOURCE_BINDING,
- dataSourceBinding, depends);
+ putProperty("", dataSourceBinding, depends); // Blank key
putProperty(Constants.JmsAttributes.TRANSACTION_MANAGER, jms
.getTransactionManagerName(), depends);
@@ -185,8 +207,7 @@
depends.clear();
dataSourceBinding = Constants.JmsAttributes.DATA_SOURCE_BINDING_PREFIX
+ jms.getUserDataSourceName();
- putProperty(Constants.JmsAttributes.DATA_SOURCE_BINDING,
- dataSourceBinding, depends);
+ putProperty("", dataSourceBinding, depends); // Blank key
putProperty(Constants.JmsAttributes.TRANSACTION_MANAGER, jms
.getTransactionManagerName(), depends);
@@ -210,12 +231,41 @@
.getPostOfficeSqlProperties(), attrs);
putProperty(Constants.JmsAttributes.POST_OFFICE_NAME, jms
.getPostOfficeName(), attrs);
+ if (jms.isClusteredPostOffice()) {
+ putProperty(Constants.JmsAttributes.GROUP_NAME, jms
+ .getGroupName(), attrs);
+ putProperty(Constants.JmsAttributes.STATE_TIMEOUT, jms
+ .getStateTimeout(), attrs);
+ putProperty(Constants.JmsAttributes.CAST_TIMEOUT, jms
+ .getCastTimeout(), attrs);
+ putProperty(Constants.JmsAttributes.STATS_SEND_PERIOD, jms
+ .getStatsSendPeriod(), attrs);
+ putProperty(Constants.JmsAttributes.MESSAGE_PULL_POLICY, jms
+ .getMessagePullPolicy(), attrs);
+ putProperty(Constants.JmsAttributes.CLUSTER_ROUTER_FACTORY, jms
+ .getClusterRouterFactory(), attrs);
+ putProperty(Constants.JmsAttributes.CHANNEL_FACTORY_NAME, jms
+ .getChannelFactoryName(), attrs);
+ putProperty(Constants.JmsAttributes.SYNC_CHANNEL_NAME, jms
+ .getSyncChannelName(), attrs);
+ putProperty(Constants.JmsAttributes.ASYNC_CHANNEL_NAME, jms
+ .getAsyncChannelName(), attrs);
+ putProperty(Constants.JmsAttributes.CHANNEL_PARTITION_NAME, jms
+ .getChannelPartitionName(), attrs);
+ putProperty(Constants.JmsAttributes.THREAD_POOL_SIZE, jms
+ .getThreadPoolSize(), attrs);
+ String syncChannelConfig = convertChannelConfigToXml(jms
+ .getSyncChannelConfig());
+ putProperty(Constants.JmsAttributes.SYNC_CHANNEL_CONFIG, syncChannelConfig, attrs);
+ String asyncChannelConfig = convertChannelConfigToXml(jms
+ .getAsyncChannelConfig());
+ putProperty(Constants.JmsAttributes.ASYNC_CHANNEL_CONFIG, asyncChannelConfig, attrs);
+ }
depends.clear();
dataSourceBinding = Constants.JmsAttributes.DATA_SOURCE_BINDING_PREFIX
+ jms.getPostOfficeDataSourceName();
- putProperty(Constants.JmsAttributes.DATA_SOURCE_BINDING,
- dataSourceBinding, depends);
+ putProperty("", dataSourceBinding, depends); // Blank key
putProperty(Constants.JmsAttributes.TRANSACTION_MANAGER, jms
.getTransactionManagerName(), depends);
putProperty(Constants.JmsAttributes.SERVER_PEER, jms
@@ -224,4 +274,65 @@
updateMBeanAttributes(Constants.JmsAttributes.POST_OFFICE_MBEAN, attrs,
depends);
}
+
+ /**
+ * Converts the jndi bindings to xml syntax expected by an MBean.
+ *
+ * @param bindings
+ * The jndi bindings separated by "\r\n"
+ * @return The jndi bindings in xml syntax
+ */
+ private String convertJndiBindingsToXml(String bindings) {
+ StringBuffer bindingsXml = new StringBuffer();
+
+ if (bindings != null && !"".equals(bindings.trim())) {
+ String bindingStr;
+ String[] bindingsArray = bindings.split(SEPARATOR);
+ bindingsXml.append(BINDINGS_NODE);
+
+ /*
+ * Convert each binding to the desired syntax:
+ */
+ for (int i = 0; i < bindingsArray.length; i++) {
+ bindingStr = bindingsArray[i];
+ if (bindingStr != null && !"".equals(bindingStr.trim())) {
+ bindingsXml.append(BINDING_NODE);
+ bindingsXml.append(bindingStr);
+ bindingsXml.append(BINDING_NODE_END);
+ }
+ }
+ bindingsXml.append(BINDINGS_NODE_END);
+ }
+ return bindingsXml.toString();
+ }
+
+ /**
+ * Converts the channel configuration to xml syntax expected by an MBean.
+ *
+ * @param channelConfig
+ * The channel configuration
+ * @return The channel configuration in xml syntax
+ */
+ private String convertChannelConfigToXml(Map channelConfig) {
+ StringBuffer configXml = new StringBuffer();
+
+ if (channelConfig != null && !channelConfig.isEmpty()) {
+ String configName = null;
+ String configStr = null;
+ configXml.append(CONFIG_NODE);
+ Set allKeys = channelConfig.keySet();
+
+ /*
+ * Convert each config entry to the desired syntax:
+ */
+ Iterator i = allKeys.iterator();
+ while (i.hasNext()) {
+ configName = (String) i.next();
+ configStr = (String)channelConfig.get(configName);
+ configXml.append("<" + configName + " " + configStr + ">");
+ }
+ configXml.append(CONFIG_NODE_END);
+ }
+ return configXml.toString();
+ }
}
\ No newline at end of file
Modified: projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/MBeanServerJmsHelper.java
===================================================================
--- projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/MBeanServerJmsHelper.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/main/org/jboss/admin/service/jms/MBeanServerJmsHelper.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -32,6 +32,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.admin.AdminConstants;
import org.jboss.admin.model.datasource.DataSource;
import org.jboss.admin.model.datasource.LocalTxDataSource;
import org.jboss.admin.model.datasource.NoTxDataSource;
@@ -41,6 +42,9 @@
import org.jboss.admin.service.datasource.DataSourceService;
import org.jboss.admin.service.datasource.DataSourceServiceImpl;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.NamedNodeMap;
/**
* Contains JBossMQ specific attributes and methods related to accessing the
@@ -50,344 +54,507 @@
* @version $Revision: 56034 $
*/
public class MBeanServerJmsHelper extends MBeanServerHelper {
- private static Log logger = LogFactory.getLog(MBeanServerJmsHelper.class);
+ private static Log logger = LogFactory.getLog(MBeanServerJmsHelper.class);
- /**
- * This service is used to look up all the data sources. The variable is
- * available for testing by calling setDataSource( datasource ) with a mock
- * DataSource object.
- */
- private DataSourceService dataSource;
+ /**
+ * This service is used to look up all the data sources. The variable is
+ * available for testing by calling setDataSource( datasource ) with a mock
+ * DataSource object.
+ */
+ private DataSourceService dataSource;
- /**
- * constructor
- */
- public MBeanServerJmsHelper(MBeanServer mbeanServer) {
- super(mbeanServer);
- }
+ /**
+ * constructor
+ */
+ public MBeanServerJmsHelper(MBeanServer mbeanServer) {
+ super(mbeanServer);
+ }
- /**
- * public no-arg constructor required for tests
- */
- public MBeanServerJmsHelper() {
- super();
- }
+ /**
+ * public no-arg constructor required for tests
+ */
+ public MBeanServerJmsHelper() {
+ super();
+ }
- /**
- * Populate the Jms object with attribute values from various MBeans
- *
- * @param jms
- * The Jms object
- */
- protected void populateJmsData(Jms jms) {
- ObjectName connectionFactory = null;
- ObjectName serverPeer = null;
- ObjectName persistenceManager = null;
- ObjectName userManager = null;
- ObjectName postOffice = null;
- ObjectName defaultDLQ = null;
- ObjectName defaultExpiryQueue = null;
-
- /*
- * Get the ObjectName of the ConectionFactory:
- */
-
- try {
- connectionFactory = new ObjectName(Constants.JmsAttributes.CONNECTION_FACTORY_MBEAN);
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get ConnectionFactory ObjectName, cause:");
- logger.error(e);
- }
- }
+ /**
+ * Populate the Jms object with attribute values from various MBeans
+ *
+ * @param jms
+ * The Jms object
+ */
+ protected void populateJmsData(Jms jms) {
+ ObjectName connectionFactory = null;
+ ObjectName serverPeer = null;
+ ObjectName persistenceManager = null;
+ ObjectName userManager = null;
+ ObjectName postOffice = null;
+ ObjectName defaultDLQ = null;
+ ObjectName defaultExpiryQueue = null;
- /*
- * Get attributes from the ConnectionFactory MBean:
- */
- if (connectionFactory != null) {
- try {
- ObjectName connector = getMBeanObjectNameAttribute(
- connectionFactory, Constants.JmsAttributes.CONNECTOR);
- if (connector != null && !connector.equals("")) {
- jms.setConnectorName(connector.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get Connector ObjectName, cause:");
- logger.error(e);
- }
- }
- jms.setClustered(getMBeanBooleanAttribute(connectionFactory,
- Constants.JmsAttributes.CLUSTERED));
- jms.setDefaultTempQueueDownCacheSize(getMBeanIntAttribute(connectionFactory,
- Constants.JmsAttributes.DEFAULT_TEMP_QUEUE_DOWN_CACHE_SIZE));
- jms.setDefaultTempQueueFullSize(getMBeanIntAttribute(connectionFactory,
- Constants.JmsAttributes.DEFAULT_TEMP_QUEUE_FULL_SIZE));
- jms.setDefaultTempQueuePageSize(getMBeanIntAttribute(connectionFactory,
- Constants.JmsAttributes.DEFAULT_TEMP_QUEUE_PAGE_SIZE));
- jms.setDupsOKBatchSize(getMBeanIntAttribute(connectionFactory,
- Constants.JmsAttributes.DUPS_OK_BATCH_SIZE));
-// jms.setLoadBalancingFactory(getMBeanStringAttribute(connectionFactory,
-// Constants.JmsAttributes.LOAD_BALANCING_FACTORY));
- jms.setPrefetchSize(getMBeanIntAttribute(connectionFactory,
- Constants.JmsAttributes.PREFETCH_SIZE));
- try {
- serverPeer = getMBeanObjectNameAttribute(
- connectionFactory, Constants.JmsAttributes.SERVER_PEER);
- if (serverPeer != null && !serverPeer.equals("")) {
- jms.setServerPeerName(serverPeer.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get ServerPeer ObjectName, cause:");
- logger.error(e);
- }
- }
- }
-
- /*
- * Get attributes from the ServerPeer MBean:
- */
- if (serverPeer != null) {
- jms.setDefaultQueueJNDIContext(getMBeanStringAttribute(serverPeer,
- Constants.JmsAttributes.DEFAULT_QUEUE_JNDI_CONTEXT));
-
- Element elem = (Element) getMBeanAttribute(
- serverPeer,
- Constants.JmsAttributes.DEFAULT_SECURITY_CONFIG);
- jms.setDefaultSecurityConfig(elem);
- jms.setDefaultSecurityRoles(convertSecurityConfigToText(elem));
-
- jms.setDefaultTopicJNDIContext(getMBeanStringAttribute(serverPeer,
- Constants.JmsAttributes.DEFAULT_TOPIC_JNDI_CONTEXT));
- jms.setJmsProviderName(getMBeanStringAttribute(serverPeer,
- Constants.JmsAttributes.JMS_PROVIDER_NAME));
- jms.setJmsVersion(getMBeanStringAttribute(serverPeer,
- Constants.JmsAttributes.JMS_VERSION));
- jms.setProviderVersion(getMBeanStringAttribute(serverPeer,
- Constants.JmsAttributes.PROVIDER_VERSION));
- jms.setSecurityDomain(getMBeanStringAttribute(serverPeer,
- Constants.JmsAttributes.SECURITY_DOMAIN));
- jms.setServerPeerID(getMBeanIntAttribute(serverPeer,
- Constants.JmsAttributes.SERVER_PEER_ID));
- jms.setDefaultMaxDeliveryAttempts(getMBeanIntAttribute(serverPeer,
- Constants.JmsAttributes.DEFAULT_MAX_DELIVERY_ATTEMPTS));
- jms.setDefaultRedeliveryDelay(getMBeanLongAttribute(serverPeer,
- Constants.JmsAttributes.DEFAULT_REDELIVERY_DELAY));
- jms.setQueueStatsSamplePeriod(getMBeanLongAttribute(serverPeer,
- Constants.JmsAttributes.QUEUE_STATS_SAMPLE_PERIOD));
- jms.setFailoverStartTimeout(getMBeanLongAttribute(serverPeer,
- Constants.JmsAttributes.FAILOVER_START_TIMEOUT));
- jms.setFailoverCompleteTimeout(getMBeanLongAttribute(serverPeer,
- Constants.JmsAttributes.FAILOVER_COMPLETE_TIMEOUT));
- jms.setDefaultMessageCounterHistoryDayLimit(getMBeanIntAttribute(serverPeer,
- Constants.JmsAttributes.DEFAULT_MESSAGE_COUNTER_HISTORY_DAY_LIMIT));
-
- try {
- persistenceManager = getMBeanObjectNameAttribute(
- serverPeer, Constants.JmsAttributes.PERSISTENCE_MANAGER);
- if (persistenceManager != null && !persistenceManager.equals("")) {
- jms.setPersistenceManagerName(persistenceManager.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get PersistenceManager ObjectName, cause:");
- logger.error(e);
- }
- }
-
- try {
- userManager = getMBeanObjectNameAttribute(
- serverPeer, Constants.JmsAttributes.JMS_USER_MANAGER);
- if (userManager != null && !userManager.equals("")) {
- jms.setUserManagerName(userManager.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get UserManager ObjectName, cause:");
- logger.error(e);
- }
- }
-
- try {
- postOffice = getMBeanObjectNameAttribute(
- serverPeer, Constants.JmsAttributes.POST_OFFICE);
- if (postOffice != null && !postOffice.equals("")) {
- jms.setPostOfficeMBeanName(postOffice.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get PostOffice ObjectName, cause:");
- logger.error(e);
- }
- }
-
- try {
- defaultDLQ = getMBeanObjectNameAttribute(
- serverPeer, Constants.JmsAttributes.DEFAULT_DLQ);
- if (postOffice != null && !postOffice.equals("")) {
- jms.setDefaultDLQName(defaultDLQ.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get DefaultDLQ ObjectName, cause:");
- logger.error(e);
- }
- }
-
- try {
- defaultExpiryQueue = getMBeanObjectNameAttribute(
- serverPeer, Constants.JmsAttributes.DEFAULT_EXPIRY_QUEUE);
- if (postOffice != null && !postOffice.equals("")) {
- jms.setDefaultExpiryQueueName(defaultExpiryQueue.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Failed to get DefaultExpiryQueue ObjectName, cause:");
- logger.error(e);
- }
- }
- }
+ /*
+ * Get the ObjectName of the ConectionFactory:
+ */
- /*
- * Get attributes from the PersistenceManager MBean:
- */
- if (persistenceManager != null) {
- jms.setCreateMsgTablesOnStartup(getMBeanBooleanAttribute(persistenceManager,
- Constants.JmsAttributes.CREATE_TABLES_ON_STARTUP));
- jms.setMsgDataSource(getMBeanStringAttribute(persistenceManager,
- Constants.JmsAttributes.DATA_SOURCE));
- // Get rid of the jndi prefix:
- String dataSourceName = jms.getMsgDataSource();
- int inx = dataSourceName.indexOf("/");
- dataSourceName = dataSourceName.substring(inx+1);
- jms.setMsgDataSourceName(dataSourceName);
-
- jms.setMaxParams(getMBeanIntAttribute(persistenceManager,
- Constants.JmsAttributes.MAX_PARAMS));
-// TODO: jms.setMsgSqlProperties(getMBeanStringAttribute(persistenceManager,
-// Constants.JmsAttributes.SQL_PROPERTIES));
- try {
- ObjectName transactionManager = getMBeanObjectNameAttribute(
- persistenceManager,
- Constants.JmsAttributes.TRANSACTION_MANAGER);
- if (transactionManager != null && !transactionManager.equals("")) {
- jms.setTransactionManagerName(transactionManager.getCanonicalName());
- }
- } catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger
- .debug("Failed to get TransactionManager ObjectName, cause:");
- logger.error(e);
- }
- }
- jms.setUsingBatchUpdates(getMBeanBooleanAttribute(persistenceManager,
- Constants.JmsAttributes.USING_BATCH_UPDATES));
- jms.setUsingBinaryStream(getMBeanBooleanAttribute(persistenceManager,
- Constants.JmsAttributes.USING_BINARY_STREAM));
- jms.setUsingTrailingByte(getMBeanBooleanAttribute(persistenceManager,
- Constants.JmsAttributes.USING_TRAILING_BYTE));
- }
+ try {
+ connectionFactory = new ObjectName(
+ Constants.JmsAttributes.CONNECTION_FACTORY_MBEAN);
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger
+ .debug("Failed to get ConnectionFactory ObjectName, cause:");
+ logger.error(e);
+ }
+ }
- /*
- * Get attributes from the JMSUserManager MBean:
- */
- if (userManager != null) {
- jms.setCreateUserTablesOnStartup(getMBeanBooleanAttribute(userManager,
- Constants.JmsAttributes.CREATE_TABLES_ON_STARTUP));
- jms.setUserDataSource(getMBeanStringAttribute(userManager,
- Constants.JmsAttributes.DATA_SOURCE));
- // Get rid of the jndi prefix:
- String dataSourceName = jms.getUserDataSource();
- int inx = dataSourceName.indexOf("/");
- dataSourceName = dataSourceName.substring(inx+1);
- jms.setUserDataSourceName(dataSourceName);
-
- jms.setUserSqlProperties(getMBeanStringAttribute(userManager,
- Constants.JmsAttributes.SQL_PROPERTIES));
- }
-
- /*
- * Get attributes from the PostOffice MBean:
- */
- if (postOffice != null) {
- jms.setCreatePostOfficeTablesOnStartup(getMBeanBooleanAttribute(postOffice,
- Constants.JmsAttributes.CREATE_TABLES_ON_STARTUP));
- jms.setPostOfficeDataSource(getMBeanStringAttribute(postOffice,
- Constants.JmsAttributes.DATA_SOURCE));
- // Get rid of the jndi prefix:
- String dataSourceName = jms.getPostOfficeDataSource();
- int inx = dataSourceName.indexOf("/");
- dataSourceName = dataSourceName.substring(inx+1);
- jms.setPostOfficeDataSourceName(dataSourceName);
-
-// TODO: jms.setPostOfficeSqlProperties(getMBeanStringAttribute(postOffice,
-// Constants.JmsAttributes.SQL_PROPERTIES));
- jms.setPostOfficeName(getMBeanStringAttribute(postOffice,
- Constants.JmsAttributes.POST_OFFICE_NAME));
- }
+ /*
+ * Get attributes from the ConnectionFactory MBean:
+ */
+ if (connectionFactory != null) {
+ try {
+ ObjectName connector = getMBeanObjectNameAttribute(
+ connectionFactory, Constants.JmsAttributes.CONNECTOR);
+ if (connector != null && !connector.equals("")) {
+ jms.setConnectorName(connector.getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Failed to get Connector ObjectName, cause:");
+ logger.error(e);
+ }
+ }
+ jms.setClustered(getMBeanBooleanAttribute(connectionFactory,
+ Constants.JmsAttributes.CLUSTERED));
+ jms
+ .setDefaultTempQueueDownCacheSize(getMBeanIntAttribute(
+ connectionFactory,
+ Constants.JmsAttributes.DEFAULT_TEMP_QUEUE_DOWN_CACHE_SIZE));
+ jms.setDefaultTempQueueFullSize(getMBeanIntAttribute(
+ connectionFactory,
+ Constants.JmsAttributes.DEFAULT_TEMP_QUEUE_FULL_SIZE));
+ jms.setDefaultTempQueuePageSize(getMBeanIntAttribute(
+ connectionFactory,
+ Constants.JmsAttributes.DEFAULT_TEMP_QUEUE_PAGE_SIZE));
+ jms.setDupsOKBatchSize(getMBeanIntAttribute(connectionFactory,
+ Constants.JmsAttributes.DUPS_OK_BATCH_SIZE));
+ Element elem = (Element) getMBeanAttribute(connectionFactory,
+ Constants.JmsAttributes.JNDI_BINDINGS);
+ jms.setJndiBindingsText(convertJndiBindingsToText(elem));
+ jms.setLoadBalancingFactory(getMBeanStringAttribute(
+ connectionFactory,
+ Constants.JmsAttributes.LOAD_BALANCING_FACTORY));
+ jms.setPrefetchSize(getMBeanIntAttribute(connectionFactory,
+ Constants.JmsAttributes.PREFETCH_SIZE));
+ try {
+ serverPeer = getMBeanObjectNameAttribute(connectionFactory,
+ Constants.JmsAttributes.SERVER_PEER);
+ if (serverPeer != null && !serverPeer.equals("")) {
+ jms.setServerPeerName(serverPeer.getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Failed to get ServerPeer ObjectName, cause:");
+ logger.error(e);
+ }
+ }
+ }
- /*
- * Setup the dataSources map:
- */
- jms.setDataSources(buildDataSourceMap());
- }
+ /*
+ * Get attributes from the ServerPeer MBean:
+ */
+ if (serverPeer != null) {
+ jms.setDefaultQueueJNDIContext(getMBeanStringAttribute(serverPeer,
+ Constants.JmsAttributes.DEFAULT_QUEUE_JNDI_CONTEXT));
- /**
- * Build a map of dataSources where the key of the map entry is the
- * dataSource name, and the value is its driver class.
- *
- * @return The dataSource map.
- */
- protected Map buildDataSourceMap() {
- Map dsMap = new HashMap();
- List dataSources = null;
- DataSource ds = null;
- String dsName = "";
- String dsClass = "";
- DataSourceService dsService = getDataSource();
+ Element elem = (Element) getMBeanAttribute(serverPeer,
+ Constants.JmsAttributes.DEFAULT_SECURITY_CONFIG);
+ jms.setDefaultSecurityConfig(elem);
+ jms.setDefaultSecurityRoles(convertSecurityConfigToText(elem));
- dataSources = dsService.getNoTxDataSources();
- Iterator i = dataSources.iterator();
- while (i.hasNext()) {
- ds = (DataSource) i.next();
- ds = dsService.getDataSource(ds.getIdentifier());
- dsName = ds.getJNDIname();
- dsClass = ((NoTxDataSource) ds).getDriverClassName();
- dsMap.put(dsName.trim(), dsClass.trim());
- }
+ jms.setDefaultTopicJNDIContext(getMBeanStringAttribute(serverPeer,
+ Constants.JmsAttributes.DEFAULT_TOPIC_JNDI_CONTEXT));
+ jms.setJmsProviderName(getMBeanStringAttribute(serverPeer,
+ Constants.JmsAttributes.JMS_PROVIDER_NAME));
+ jms.setJmsVersion(getMBeanStringAttribute(serverPeer,
+ Constants.JmsAttributes.JMS_VERSION));
+ jms.setProviderVersion(getMBeanStringAttribute(serverPeer,
+ Constants.JmsAttributes.PROVIDER_VERSION));
+ jms.setSecurityDomain(getMBeanStringAttribute(serverPeer,
+ Constants.JmsAttributes.SECURITY_DOMAIN));
+ jms.setServerPeerID(getMBeanIntAttribute(serverPeer,
+ Constants.JmsAttributes.SERVER_PEER_ID));
+ jms.setDefaultMaxDeliveryAttempts(getMBeanIntAttribute(serverPeer,
+ Constants.JmsAttributes.DEFAULT_MAX_DELIVERY_ATTEMPTS));
+ jms.setDefaultRedeliveryDelay(getMBeanLongAttribute(serverPeer,
+ Constants.JmsAttributes.DEFAULT_REDELIVERY_DELAY));
+ jms.setQueueStatsSamplePeriod(getMBeanLongAttribute(serverPeer,
+ Constants.JmsAttributes.QUEUE_STATS_SAMPLE_PERIOD));
+ jms.setFailoverStartTimeout(getMBeanLongAttribute(serverPeer,
+ Constants.JmsAttributes.FAILOVER_START_TIMEOUT));
+ jms.setFailoverCompleteTimeout(getMBeanLongAttribute(serverPeer,
+ Constants.JmsAttributes.FAILOVER_COMPLETE_TIMEOUT));
+ jms
+ .setDefaultMessageCounterHistoryDayLimit(getMBeanIntAttribute(
+ serverPeer,
+ Constants.JmsAttributes.DEFAULT_MESSAGE_COUNTER_HISTORY_DAY_LIMIT));
- dataSources = dsService.getLocalTxDataSources();
- i = dataSources.iterator();
- while (i.hasNext()) {
- ds = (DataSource) i.next();
- ds = dsService.getDataSource(ds.getIdentifier());
- dsName = ds.getJNDIname();
- dsClass = ((LocalTxDataSource) ds).getDriverClassName();
- dsMap.put(dsName.trim(), dsClass.trim());
- }
+ try {
+ persistenceManager = getMBeanObjectNameAttribute(serverPeer,
+ Constants.JmsAttributes.PERSISTENCE_MANAGER);
+ if (persistenceManager != null
+ && !persistenceManager.equals("")) {
+ jms.setPersistenceManagerName(persistenceManager
+ .getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger
+ .debug("Failed to get PersistenceManager ObjectName, cause:");
+ logger.error(e);
+ }
+ }
- dataSources = dsService.getXATxDataSources();
- i = dataSources.iterator();
- while (i.hasNext()) {
- ds = (DataSource) i.next();
- ds = dsService.getDataSource(ds.getIdentifier());
- dsName = ds.getJNDIname();
- dsClass = ((XATxDataSource) ds).getDataSourceClassName();
- dsMap.put(dsName.trim(), dsClass.trim());
- }
-
- return dsMap;
- }
+ try {
+ userManager = getMBeanObjectNameAttribute(serverPeer,
+ Constants.JmsAttributes.JMS_USER_MANAGER);
+ if (userManager != null && !userManager.equals("")) {
+ jms.setUserManagerName(userManager.getCanonicalName());
+ }
+ } catch (Exception e) {
+ try { // To get around JBoss bug
+ userManager = new ObjectName(
+ Constants.JmsAttributes.JMS_USER_MANAGER_MBEAN);
+ } catch (Exception e2) {
+ if (logger.isDebugEnabled()) {
+ logger
+ .debug("Failed to get JmsUserManager ObjectName, cause:");
+ logger.error(e2);
+ }
+ }
+ }
- private DataSourceService getDataSource() {
- if (dataSource == null) {
- dataSource = new DataSourceServiceImpl();
- }
- return dataSource;
- }
+ try {
+ postOffice = getMBeanObjectNameAttribute(serverPeer,
+ Constants.JmsAttributes.POST_OFFICE);
+ if (postOffice != null && !postOffice.equals("")) {
+ jms.setPostOfficeMBeanName(postOffice.getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Failed to get PostOffice ObjectName, cause:");
+ logger.error(e);
+ }
+ }
- protected void setDataSource(DataSourceService dataSource) {
- this.dataSource = dataSource;
- }
+ try {
+ defaultDLQ = getMBeanObjectNameAttribute(serverPeer,
+ Constants.JmsAttributes.DEFAULT_DLQ);
+ if (postOffice != null && !postOffice.equals("")) {
+ jms.setDefaultDLQName(defaultDLQ.getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Failed to get DefaultDLQ ObjectName, cause:");
+ logger.error(e);
+ }
+ }
+
+ try {
+ defaultExpiryQueue = getMBeanObjectNameAttribute(serverPeer,
+ Constants.JmsAttributes.DEFAULT_EXPIRY_QUEUE);
+ if (postOffice != null && !postOffice.equals("")) {
+ jms.setDefaultExpiryQueueName(defaultExpiryQueue
+ .getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger
+ .debug("Failed to get DefaultExpiryQueue ObjectName, cause:");
+ logger.error(e);
+ }
+ }
+ }
+
+ /*
+ * Get attributes from the PersistenceManager MBean:
+ */
+ if (persistenceManager != null) {
+ jms.setCreateMsgTablesOnStartup(getMBeanBooleanAttribute(
+ persistenceManager,
+ Constants.JmsAttributes.CREATE_TABLES_ON_STARTUP));
+ jms.setMsgDataSource(getMBeanStringAttribute(persistenceManager,
+ Constants.JmsAttributes.DATA_SOURCE));
+ // Get rid of the jndi prefix:
+ String dataSourceName = jms.getMsgDataSource();
+ int inx = dataSourceName.indexOf("/");
+ dataSourceName = dataSourceName.substring(inx + 1);
+ jms.setMsgDataSourceName(dataSourceName);
+
+ jms.setMaxParams(getMBeanIntAttribute(persistenceManager,
+ Constants.JmsAttributes.MAX_PARAMS));
+ jms.setMsgSqlProperties(getMBeanStringAttribute(persistenceManager,
+ Constants.JmsAttributes.SQL_PROPERTIES));
+ try {
+ ObjectName transactionManager = getMBeanObjectNameAttribute(
+ persistenceManager,
+ Constants.JmsAttributes.TRANSACTION_MANAGER);
+ if (transactionManager != null
+ && !transactionManager.equals("")) {
+ jms.setTransactionManagerName(transactionManager
+ .getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger
+ .debug("Failed to get TransactionManager ObjectName, cause:");
+ logger.error(e);
+ }
+ }
+ jms.setUsingBatchUpdates(getMBeanBooleanAttribute(
+ persistenceManager,
+ Constants.JmsAttributes.USING_BATCH_UPDATES));
+ jms.setUsingBinaryStream(getMBeanBooleanAttribute(
+ persistenceManager,
+ Constants.JmsAttributes.USING_BINARY_STREAM));
+ jms.setUsingTrailingByte(getMBeanBooleanAttribute(
+ persistenceManager,
+ Constants.JmsAttributes.USING_TRAILING_BYTE));
+ }
+
+ /*
+ * Get attributes from the JMSUserManager MBean:
+ */
+ if (userManager != null) {
+ jms.setCreateUserTablesOnStartup(getMBeanBooleanAttribute(
+ userManager,
+ Constants.JmsAttributes.CREATE_TABLES_ON_STARTUP));
+ jms.setUserDataSource(getMBeanStringAttribute(userManager,
+ Constants.JmsAttributes.DATA_SOURCE));
+ // Get rid of the jndi prefix:
+ String dataSourceName = jms.getUserDataSource();
+ int inx = dataSourceName.indexOf("/");
+ dataSourceName = dataSourceName.substring(inx + 1);
+ jms.setUserDataSourceName(dataSourceName);
+
+ jms.setUserSqlProperties(getMBeanStringAttribute(userManager,
+ Constants.JmsAttributes.SQL_PROPERTIES));
+ }
+
+ /*
+ * Get attributes from the PostOffice MBean:
+ */
+ if (postOffice != null) {
+ jms.setCreatePostOfficeTablesOnStartup(getMBeanBooleanAttribute(
+ postOffice,
+ Constants.JmsAttributes.CREATE_TABLES_ON_STARTUP));
+ jms.setPostOfficeDataSource(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.DATA_SOURCE));
+ // Get rid of the jndi prefix:
+ String dataSourceName = jms.getPostOfficeDataSource();
+ int inx = dataSourceName.indexOf("/");
+ dataSourceName = dataSourceName.substring(inx + 1);
+ jms.setPostOfficeDataSourceName(dataSourceName);
+
+ jms.setPostOfficeSqlProperties(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.SQL_PROPERTIES));
+ jms.setPostOfficeName(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.POST_OFFICE_NAME));
+
+ // Get clustered attributes if this is a clustered post office:
+ try {
+ jms.setGroupName(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.GROUP_NAME));
+ jms.setClusteredPostOffice(true);
+ } catch (Exception e) {
+ jms.setClusteredPostOffice(false);
+ }
+
+ if (jms.isClusteredPostOffice()) {
+ jms.setStateTimeout(getMBeanLongAttribute(postOffice,
+ Constants.JmsAttributes.STATE_TIMEOUT));
+ jms.setCastTimeout(getMBeanLongAttribute(postOffice,
+ Constants.JmsAttributes.CAST_TIMEOUT));
+ jms.setStatsSendPeriod(getMBeanLongAttribute(postOffice,
+ Constants.JmsAttributes.STATS_SEND_PERIOD));
+ jms.setMessagePullPolicy(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.MESSAGE_PULL_POLICY));
+ jms.setClusterRouterFactory(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.CLUSTER_ROUTER_FACTORY));
+ try {
+ ObjectName channelFactory = getMBeanObjectNameAttribute(
+ postOffice,
+ Constants.JmsAttributes.CHANNEL_FACTORY_NAME);
+ if (channelFactory != null && !channelFactory.equals("")) {
+ jms.setChannelFactoryName(channelFactory
+ .getCanonicalName());
+ }
+ } catch (Exception e) {
+ if (logger.isDebugEnabled()) {
+ logger
+ .debug("Failed to get ChannelFactory ObjectName, cause:");
+ logger.error(e);
+ }
+ }
+ jms.setSyncChannelName(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.SYNC_CHANNEL_NAME));
+ jms.setAsyncChannelName(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.ASYNC_CHANNEL_NAME));
+ jms.setChannelPartitionName(getMBeanStringAttribute(postOffice,
+ Constants.JmsAttributes.CHANNEL_PARTITION_NAME));
+ jms.setThreadPoolSize(getMBeanIntAttribute(postOffice,
+ Constants.JmsAttributes.THREAD_POOL_SIZE));
+ Element elem = (Element) getMBeanAttribute(postOffice,
+ Constants.JmsAttributes.SYNC_CHANNEL_CONFIG);
+ jms.setSyncChannelConfig(buildChannelConfigMap(elem));
+ Element elem2 = (Element) getMBeanAttribute(postOffice,
+ Constants.JmsAttributes.ASYNC_CHANNEL_CONFIG);
+ jms.setAsyncChannelConfig(buildChannelConfigMap(elem2));
+ }
+ }
+
+ /*
+ * Setup the dataSources map:
+ */
+ jms.setDataSources(buildDataSourceMap());
+ }
+
+ /**
+ * Converts the jndi bindings from an org.w3c.dom.Element to a text string
+ * for displaying.
+ *
+ * @param elem
+ * The jndi bindings element
+ * @return The text representation of the jndi bindings
+ */
+ private String convertJndiBindingsToText(Element bindingsElem) {
+ String SEPARATOR = AdminConstants.LINE_SEPARATOR;
+ String BINDING_ELEMENT_NAME = "binding";
+ StringBuffer bindingsList = new StringBuffer();
+ String bindingStr = null;
+ int size = 0;
+ Element elem = null;
+
+ if (bindingsElem != null) {
+ NodeList bindingNodes = bindingsElem
+ .getElementsByTagName(BINDING_ELEMENT_NAME);
+ size = bindingNodes.getLength();
+
+ /*
+ * For each binding element, get its value and build a string:
+ */
+ for (int i = 0; i < size; i++) {
+ elem = (Element) bindingNodes.item(i);
+ bindingStr = elem.getTextContent();
+ bindingsList.append(bindingStr);
+ bindingsList.append(SEPARATOR);
+ }
+ }
+ return bindingsList.toString();
+ }
+
+ /**
+ * Build a map of channel configurations where the key of the map entry is
+ * the tag name, and the value is a list of attribute/value pairs associated
+ * with that tag.
+ *
+ * @param configElem
+ * The channelConfig element.
+ * @return The channelConfig map.
+ */
+ private Map buildChannelConfigMap(Element configElem) {
+ Map configMap = new HashMap();
+ int nodeSize = 0;
+ int attSize = 0;
+ Node currNode = null;
+ Node attNode = null;
+ String configName = null;
+ String attStr = null;
+
+ if (configElem != null) {
+ NodeList allChildNodes = configElem.getChildNodes();
+ nodeSize = allChildNodes.getLength();
+
+ /*
+ * For each config element, get its name and build an attributes
+ * string:
+ */
+ for (int i = 0; i < nodeSize; i++) {
+ StringBuffer attBuf = new StringBuffer();
+ currNode = (Node) allChildNodes.item(i);
+ if (currNode.getNodeType() == Node.ELEMENT_NODE) {
+ configName = currNode.getNodeName();
+ NamedNodeMap attMap = currNode.getAttributes();
+ attSize = attMap.getLength();
+ for (int j = 0; j < attSize; j++) {
+ attNode = attMap.item(j);
+ attStr = attNode.getNodeName() + "="
+ + attNode.getNodeValue()+ " " ;
+ attBuf.append(attStr);
+ }
+ String attBufStr = attBuf.toString();
+ configMap.put(configName, attBuf.toString());
+ }
+ }
+ }
+
+ return configMap;
+ }
+
+ /**
+ * Build a map of dataSources where the key of the map entry is the
+ * dataSource name, and the value is its driver class.
+ *
+ * @return The dataSource map.
+ */
+ private Map buildDataSourceMap() {
+ Map dsMap = new HashMap();
+ List dataSources = null;
+ DataSource ds = null;
+ String dsName = "";
+ String dsClass = "";
+ DataSourceService dsService = getDataSource();
+
+ dataSources = dsService.getNoTxDataSources();
+ Iterator i = dataSources.iterator();
+ while (i.hasNext()) {
+ ds = (DataSource) i.next();
+ ds = dsService.getDataSource(ds.getIdentifier());
+ dsName = ds.getJNDIname();
+ dsClass = ((NoTxDataSource) ds).getDriverClassName();
+ dsMap.put(dsName.trim(), dsClass.trim());
+ }
+
+ dataSources = dsService.getLocalTxDataSources();
+ i = dataSources.iterator();
+ while (i.hasNext()) {
+ ds = (DataSource) i.next();
+ ds = dsService.getDataSource(ds.getIdentifier());
+ dsName = ds.getJNDIname();
+ dsClass = ((LocalTxDataSource) ds).getDriverClassName();
+ dsMap.put(dsName.trim(), dsClass.trim());
+ }
+
+ dataSources = dsService.getXATxDataSources();
+ i = dataSources.iterator();
+ while (i.hasNext()) {
+ ds = (DataSource) i.next();
+ ds = dsService.getDataSource(ds.getIdentifier());
+ dsName = ds.getJNDIname();
+ dsClass = ((XATxDataSource) ds).getDataSourceClassName();
+ dsMap.put(dsName.trim(), dsClass.trim());
+ }
+
+ return dsMap;
+ }
+
+ private DataSourceService getDataSource() {
+ if (dataSource == null) {
+ dataSource = new DataSourceServiceImpl();
+ }
+ return dataSource;
+ }
+
+ protected void setDataSource(DataSourceService dataSource) {
+ this.dataSource = dataSource;
+ }
}
\ No newline at end of file
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/classes/messages/jmsmessages.properties
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/classes/messages/jmsmessages.properties 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/classes/messages/jmsmessages.properties 2007-06-08 17:26:46 UTC (rev 63430)
@@ -23,29 +23,31 @@
jms.section.heading.more.page=More...
jms.section.heading.msgSql.page=Msg SQL
jms.section.heading.userSql.page=User SQL
-jms.section.heading.postOfficeSql.page=PO SQL
-jms.section.heading.cfSettings.page=CF Settings
+jms.section.heading.postOfficeSql.page=PostOffice SQL
+jms.section.heading.connFactory.page=ConnectionFactory Settings
+jms.section.heading.clustered.page=Clustered Settings
jms.section.heading.configurable=JMS Configurable Attributes
jms.section.heading.readonly=JMS Read-Only Attributes
jms.section.heading.msgSql=SQL Properties for Message Persistence
jms.section.heading.userSql=SQL Properties for User Persistence
jms.section.heading.postOfficeSql=SQL Properties for PostOffice Persistence
-jms.section.heading.cfSettings=Connection Factory Attributes
+jms.section.heading.connFactory=Connection Factory Attributes
+jms.section.heading.clustered=Clustered Post Office Attributes
#page1 (JMS Settings page)
jms.view.defaultDLQName=Default DLQ:
+jms.view.defaultExpiryQueueName=Default Expiry Queue:
jms.view.defaultMaxDeliveryAttempts=Default Max Delivery Attempts:
-jms.view.defaultExpiryQueueName=Default Expiry Queue:
+jms.view.defaultMessageCounterHistoryDayLimit=Default Message Counter History Day Limit:
jms.view.defaultRedeliveryDelay=Default Redelivery Delay:
-jms.view.queueStatsSamplePeriod=Queue Stats Sample Period:
jms.view.failoverStartTimeout=Failover Start Timeout:
jms.view.failoverCompleteTimeout=Failover Complete Timeout:
-jms.view.defaultMessageCounterHistoryDayLimit=Default Message Counter History Day Limit:
+jms.view.queueStatsSamplePeriod=Queue Stats Sample Period:
jms.view.securityDomain=Security Domain:
jms.view.defaultSecurityRoles=Default Security Roles:
jms.view.createMsgTablesOnStartup=Create Message Tables On Startup:
jms.view.maxParams=Max Params:
-jms.view.msgDataSource=Message Data ource:
+jms.view.msgDataSource=Message Data Source:
jms.view.usingBatchUpdates=Using Batch Updates:
jms.view.usingBinaryStream=Using Binary Stream:
jms.view.usingTrailingByte=Using Trailing Byte:
@@ -69,9 +71,24 @@
jms.view.defaultTempQueueFullSize=Default Temp Queue Full Size:
jms.view.defaultTempQueuePageSize=Default Temp Queue Page Size:
jms.view.dupsOKBatchSize=Dups OK Batch Size:
-jms.view.loadBalancingFactory=Load Balancing Factory:
+jms.view.jndiBindings=JNDI Bindings:
jms.view.prefetchSize=Prefetch Size:
+#Clustered Post Office Settings page
+jms.view.groupName=Group Name:
+jms.view.stateTimeout=State Timeout:
+jms.view.castTimeout=Cast Timeout:
+jms.view.statsSendPeriod=Stats Send Period:
+jms.view.threadPoolSize=Thread Pool Size:
+jms.view.messagePullPolicy=Message Pull Policy:
+jms.view.clusterRouterFactory=Cluster Router Factory:
+jms.view.channelFactoryName=Channel Factory Name:
+jms.view.channelPartitionName=Channel Partition Name:
+jms.view.syncChannelName=Sync Channel Name:
+jms.view.asyncChannelName=Async Channel Name:
+jms.view.syncChannelConfig=Sync Channel Config:
+jms.view.asyncChannelConfig=Async Channel Config:
+
jms.update.success=JMS attributes have been updated successfully
jms.update.failure=Failed to update the JMS attributes
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/persistenceSql.properties
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/persistenceSql.properties 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/persistenceSql.properties 2007-06-08 17:26:46 UTC (rev 63430)
@@ -38,105 +38,129 @@
##########################################################
org.hsqldb.jdbcDriver = hsqldb
org.postgresql.Driver = postgresql
-org.gjt.mm.mysql.Driver = mysql
+com.mysql.jdbc.Driver = mysql
+# org.gjt.mm.mysql.Driver = mysql
##########################################################
# MySQL SQL properties for message persistence
##########################################################
-mysql.msg.CREATE_MESSAGE_REFERENCE=CREATE TABLE JMS_MESSAGE_REFERENCE (CHANNELID BIGINT, MESSAGEID BIGINT, TRANSACTIONID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERYCOUNT INTEGER, RELIABLE CHAR(1), LOADED CHAR(1), PRIMARY KEY(CHANNELID, MESSAGEID))
-mysql.msg.CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JMS_MESSAGE_REF_TX ON JMS_MESSAGE_REFERENCE (TRANSACTIONID)
-mysql.msg.CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JMS_MESSAGE_REF_ORD ON JMS_MESSAGE_REFERENCE (ORD)
-mysql.msg.CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JMS_MESSAGE_REF_LOADED ON JMS_MESSAGE_REFERENCE (PAGE_ORD)
-mysql.msg.CREATE_IDX_MESSAGE_REF_MESSAGEID=CREATE INDEX JMS_MESSAGE_REF_MESSAGEID ON JMS_MESSAGE_REFERENCE (MESSAGEID)
-mysql.msg.CREATE_IDX_MESSAGE_REF_RELIABLE=CREATE INDEX JMS_MESSAGE_REF_RELIABLE ON JMS_MESSAGE_REFERENCE (RELIABLE)
-mysql.msg.CREATE_MESSAGE=CREATE TABLE JMS_MESSAGE (MESSAGEID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, COREHEADERS MEDIUMBLOB, PAYLOAD LONGBLOB, CHANNELCOUNT INTEGER, TYPE TINYINT, JMSTYPE VARCHAR(255), CORRELATIONID VARCHAR(255), CORRELATIONID_BYTES VARBINARY(254), DESTINATION VARCHAR(255), REPLYTO VARCHAR(255), JMSPROPERTIES MEDIUMBLOB, PRIMARY KEY (MESSAGEID))
-mysql.msg.CREATE_TRANSACTION=CREATE TABLE JMS_TRANSACTION (TRANSACTIONID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTIONID))
-mysql.msg.CREATE_COUNTER=CREATE TABLE JMS_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
-mysql.msg.INSERT_MESSAGE_REF=INSERT INTO JMS_MESSAGE_REFERENCE (CHANNELID, MESSAGEID, TRANSACTIONID, STATE, ORD, PAGE_ORD, DELIVERYCOUNT, RELIABLE) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-mysql.msg.DELETE_MESSAGE_REF=DELETE FROM JMS_MESSAGE_REFERENCE WHERE MESSAGEID=? AND CHANNELID=? AND STATE='C'
-mysql.msg.UPDATE_MESSAGE_REF=UPDATE JMS_MESSAGE_REFERENCE SET TRANSACTIONID=?, STATE='-' WHERE MESSAGEID=? AND CHANNELID=? AND STATE='C'
-mysql.msg.UPDATE_PAGE_ORDER=UPDATE JMS_MESSAGE_REFERENCE SET PAGE_ORD = ? WHERE MESSAGEID=? AND CHANNELID=?
-mysql.msg.COMMIT_MESSAGE_REF1=UPDATE JMS_MESSAGE_REFERENCE SET STATE='C', TRANSACTIONID = NULL WHERE TRANSACTIONID=? AND STATE='+'
-mysql.msg.COMMIT_MESSAGE_REF2=DELETE FROM JMS_MESSAGE_REFERENCE WHERE TRANSACTIONID=? AND STATE='-'
-mysql.msg.ROLLBACK_MESSAGE_REF1=DELETE FROM JMS_MESSAGE_REFERENCE WHERE TRANSACTIONID=? AND STATE='+'
-mysql.msg.ROLLBACK_MESSAGE_REF2=UPDATE JMS_MESSAGE_REFERENCE SET STATE='C', TRANSACTIONID = NULL WHERE TRANSACTIONID=? AND STATE='-'
-mysql.msg.LOAD_PAGED_REFS=SELECT MESSAGEID, DELIVERYCOUNT, PAGE_ORD, RELIABLE FROM JMS_MESSAGE_REFERENCE WHERE CHANNELID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
-mysql.msg.LOAD_UNPAGED_REFS=SELECT MESSAGEID, DELIVERYCOUNT, RELIABLE FROM JMS_MESSAGE_REFERENCE WHERE PAGE_ORD IS NULL and CHANNELID = ? ORDER BY ORD
-mysql.msg.UPDATE_RELIABLE_REFS_NOT_PAGED=UPDATE JMS_MESSAGE_REFERENCE SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNELID=?
-mysql.msg.SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JMS_MESSAGE_REFERENCE WHERE CHANNELID = ?
-mysql.msg.SELECT_EXISTS_REF=SELECT MESSAGEID FROM JMS_MESSAGE_REFERENCE WHERE CHANNELID = ? AND MESSAGEID = ?
-mysql.msg.UPDATE_DELIVERYCOUNT=UPDATE JMS_MESSAGE_REFERENCE SET DELIVERYCOUNT = ? WHERE CHANNELID = ? AND MESSAGEID = ?
-mysql.msg.LOAD_MESSAGES=SELECT MESSAGEID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, COREHEADERS, PAYLOAD, CHANNELCOUNT, TYPE, JMSTYPE, CORRELATIONID, CORRELATIONID_BYTES, DESTINATION, REPLYTO, JMSPROPERTIES FROM JMS_MESSAGE
-mysql.msg.INSERT_MESSAGE=INSERT INTO JMS_MESSAGE (MESSAGEID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, COREHEADERS, PAYLOAD, CHANNELCOUNT, TYPE, JMSTYPE, CORRELATIONID, CORRELATIONID_BYTES, DESTINATION, REPLYTO, JMSPROPERTIES) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
-mysql.msg.INC_CHANNELCOUNT=UPDATE JMS_MESSAGE SET CHANNELCOUNT = CHANNELCOUNT + 1 WHERE MESSAGEID=?
-mysql.msg.DEC_CHANNELCOUNT=UPDATE JMS_MESSAGE SET CHANNELCOUNT = CHANNELCOUNT - 1 WHERE MESSAGEID=?
-mysql.msg.DELETE_MESSAGE=DELETE FROM JMS_MESSAGE WHERE MESSAGEID=? AND CHANNELCOUNT=0
-mysql.msg.MESSAGEID_COLUMN=MESSAGEID
-mysql.msg.MESSAGE_EXISTS=SELECT MESSAGEID FROM JMS_MESSAGE WHERE MESSAGEID = ? FOR UPDATE
-mysql.msg.INSERT_TRANSACTION=INSERT INTO JMS_TRANSACTION (TRANSACTIONID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?)
-mysql.msg.DELETE_TRANSACTION=DELETE FROM JMS_TRANSACTION WHERE TRANSACTIONID = ?
-mysql.msg.SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTIONID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JMS_TRANSACTION
-mysql.msg.UPDATE_COUNTER=UPDATE JMS_COUNTER SET NEXT_ID = ? WHERE NAME=?
-mysql.msg.SELECT_COUNTER=SELECT NEXT_ID FROM JMS_COUNTER WHERE NAME=? FOR UPDATE
-mysql.msg.INSERT_COUNTER=INSERT INTO JMS_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
-mysql.msg.SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNELID) FROM JMS_MESSAGE_REFERENCE
+mysql.msg.CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
+mysql.msg.CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
+mysql.msg.CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
+mysql.msg.CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
+mysql.msg.CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
+mysql.msg.CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
+mysql.msg.CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, HEADERS MEDIUMBLOB, PAYLOAD LONGBLOB, CHANNEL_COUNT INTEGER, TYPE TINYINT, PRIMARY KEY (MESSAGE_ID))
+mysql.msg.CREATE_TRANSACTION=CREATE TABLE JBM_TX (TRANSACTION_ID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTION_ID))
+mysql.msg.CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
+mysql.msg.INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+mysql.msg.DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+mysql.msg.UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+mysql.msg.UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
+mysql.msg.COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
+mysql.msg.COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
+mysql.msg.ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
+mysql.msg.ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
+mysql.msg.LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
+mysql.msg.LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
+mysql.msg.LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
+mysql.msg.UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
+mysql.msg.SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
+mysql.msg.SELECT_EXISTS_REF=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
+mysql.msg.SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
+mysql.msg.UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
+mysql.msg.UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
+mysql.msg.LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
+mysql.msg.INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, CHANNEL_COUNT, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
+mysql.msg.INC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT + 1 WHERE MESSAGE_ID=?
+mysql.msg.DEC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT - 1 WHERE MESSAGE_ID=?
+mysql.msg.DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID=? AND CHANNEL_COUNT=0
+mysql.msg.MESSAGE_ID_COLUMN=MESSAGE_ID
+mysql.msg.MESSAGE_EXISTS=SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ? FOR UPDATE
+mysql.msg.INSERT_TRANSACTION=INSERT INTO JBM_TX (TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?)
+mysql.msg.DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE TRANSACTION_ID = ?
+mysql.msg.SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX
+mysql.msg.SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
+mysql.msg.SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
+mysql.msg.UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
+mysql.msg.SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
+mysql.msg.INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
+mysql.msg.SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
##########################################################
+# MySQL SQL properties for post office persistence
+##########################################################
+mysql.po.CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(1023), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1))
+mysql.po.INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED) VALUES (?, ?, ?, ?, ?, ?, ?)
+mysql.po.DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
+mysql.po.LOAD_BINDINGS=SELECT NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME = ?
+
+##########################################################
# MySQL SQL properties for user persistence
##########################################################
-mysql.user.CREATE_USER_TABLE=CREATE TABLE JMS_USER (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USERID))
-mysql.user.CREATE_ROLE_TABLE=CREATE TABLE JMS_ROLE (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, PRIMARY KEY(USERID, ROLEID))
-mysql.user.SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JMS_USER WHERE USERID=?
+mysql.user.CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID))
+mysql.user.CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
+mysql.user.SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
+mysql.user.POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
##########################################################
-# MySQL SQL properties for post office persistence
+# Postgre SQL properties for message persistence
##########################################################
+postgresql.msg.CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
+postgresql.msg.CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
+postgresql.msg.CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
+postgresql.msg.CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
+postgresql.msg.CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
+postgresql.msg.CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
+postgresql.msg.CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY SMALLINT, HEADERS BYTEA, PAYLOAD BYTEA, CHANNEL_COUNT INTEGER, TYPE SMALLINT, PRIMARY KEY (MESSAGE_ID))
+postgresql.msg.CREATE_TRANSACTION=CREATE TABLE JBM_TX (TRANSACTION_ID BIGINT, BRANCH_QUAL BYTEA, FORMAT_ID INTEGER, GLOBAL_TXID BYTEA, PRIMARY KEY (TRANSACTION_ID))
+postgresql.msg.CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
+postgresql.msg.INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+postgresql.msg.DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+postgresql.msg.UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+postgresql.msg.UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
+postgresql.msg.COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
+postgresql.msg.COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
+postgresql.msg.ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
+postgresql.msg.ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
+postgresql.msg.LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
+postgresql.msg.LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
+postgresql.msg.LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
+postgresql.msg.UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
+postgresql.msg.SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
+postgresql.msg.SELECT_EXISTS_REF=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
+postgresql.msg.SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
+postgresql.msg.UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
+postgresql.msg.UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
+postgresql.msg.LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
+postgresql.msg.INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, CHANNEL_COUNT, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
+postgresql.msg.INC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT + 1 WHERE MESSAGE_ID=?
+postgresql.msg.DEC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT - 1 WHERE MESSAGE_ID=?
+postgresql.msg.DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID=? AND CHANNEL_COUNT=0
+postgresql.msg.MESSAGE_ID_COLUMN=MESSAGE_ID
+postgresql.msg.MESSAGE_EXISTS=SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ? FOR UPDATE
+postgresql.msg.INSERT_TRANSACTION=INSERT INTO JBM_TX (TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?)
+postgresql.msg.DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE TRANSACTION_ID = ?
+postgresql.msg.SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX
+postgresql.msg.SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
+postgresql.msg.SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
+postgresql.msg.UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
+postgresql.msg.SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
+postgresql.msg.INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
+postgresql.msg.SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
-mysql.po.CREATE_POSTOFFICE_TABLE=CREATE TABLE JMS_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(1023), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, IS_FAILED_OVER CHAR(1))
-mysql.po.INSERT_BINDING=INSERT INTO JMS_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, IS_FAILED_OVER) VALUES (?, ?, ?, ?, ?, ?, ?)
-mysql.po.DELETE_BINDING=DELETE FROM JMS_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-mysql.po.LOAD_BINDINGS=SELECT NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID FROM JMS_POSTOFFICE WHERE POSTOFFICE_NAME = ?
+##########################################################
+# Postgre SQL properties for post office persistence
+##########################################################
+postgresql.po.CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(1023), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1))
+postgresql.po.INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED) VALUES (?, ?, ?, ?, ?, ?, ?)
+postgresql.po.DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
+postgresql.po.LOAD_BINDINGS=SELECT NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME = ?
##########################################################
-# Postgre SQL properties for message persistence
+# Postgre SQL properties for user persistence
##########################################################
-postgresql.msg.CREATE_MESSAGE_REF=CREATE TABLE JMS_MESSAGE_REFERENCE (CHANNELID BIGINT, MESSAGEID BIGINT, TRANSACTIONID BIGINT, STATE CHAR(1), ORD BIGINT, DELIVERYCOUNT INTEGER, RELIABLE CHAR(1), LOADED CHAR(1), PRIMARY KEY(CHANNELID, MESSAGEID))
-postgresql.msg.CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JMS_MESSAGE_REF_TX ON JMS_MESSAGE_REFERENCE (TRANSACTIONID)
-postgresql.msg.CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JMS_MESSAGE_REF_ORD ON JMS_MESSAGE_REFERENCE (ORD)
-postgresql.msg.CREATE_IDX_MESSAGE_REF_MESSAGEID=CREATE INDEX JMS_MESSAGE_REF_MESSAGEID ON JMS_MESSAGE_REFERENCE (MESSAGEID)
-postgresql.msg.CREATE_IDX_MESSAGE_REF_LOADED=CREATE INDEX JMS_MESSAGE_REF_LOADED ON JMS_MESSAGE_REFERENCE (LOADED)
-postgresql.msg.CREATE_IDX_MESSAGE_REF_RELIABLE=CREATE INDEX JMS_MESSAGE_REF_RELIABLE ON JMS_MESSAGE_REFERENCE (RELIABLE)
-postgresql.msg.INSERT_MESSAGE_REF=INSERT INTO JMS_MESSAGE_REFERENCE (CHANNELID, MESSAGEID, TRANSACTIONID, STATE, ORD, DELIVERYCOUNT, RELIABLE, LOADED) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-postgresql.msg.DELETE_MESSAGE_REF=DELETE FROM JMS_MESSAGE_REFERENCE WHERE MESSAGEID=? AND CHANNELID=? AND STATE='C'
-postgresql.msg.UPDATE_MESSAGE_REF=UPDATE JMS_MESSAGE_REFERENCE SET TRANSACTIONID=?, STATE='-' WHERE MESSAGEID=? AND CHANNELID=? AND STATE='C'
-postgresql.msg.UPDATE_MESSAGE_REF_NOT_LOADED=UPDATE JMS_MESSAGE_REFERENCE SET LOADED='N' WHERE MESSAGEID=? AND CHANNELID=?
-postgresql.msg.COMMIT_MESSAGE_REF1=UPDATE JMS_MESSAGE_REFERENCE SET STATE='C', TRANSACTIONID = NULL WHERE TRANSACTIONID=? AND STATE='+'
-postgresql.msg.COMMIT_MESSAGE_REF2=DELETE FROM JMS_MESSAGE_REFERENCE WHERE TRANSACTIONID=? AND STATE='-'
-postgresql.msg.ROLLBACK_MESSAGE_REF1=DELETE FROM JMS_MESSAGE_REFERENCE WHERE TRANSACTIONID=? AND STATE='+'
-postgresql.msg.ROLLBACK_MESSAGE_REF2=UPDATE JMS_MESSAGE_REFERENCE SET STATE='C', TRANSACTIONID = NULL WHERE TRANSACTIONID=? AND STATE='-'
-postgresql.msg.LOAD_REF_INFO=SELECT MESSAGEID, ORD, DELIVERYCOUNT, RELIABLE FROM JMS_MESSAGE_REFERENCE WHERE CHANNELID=? AND STATE <> '+' AND LOADED = 'N' AND ORD BETWEEN ? AND ? ORDER BY ORD
-postgresql.msg.SELECT_COUNT_REFS=SELECT COUNT(MESSAGEID) FROM JMS_MESSAGE_REFERENCE WHERE CHANNELID=? AND STATE <> '+' AND LOADED='N'
-postgresql.msg.UPDATE_RELIABLE_REFS=UPDATE JMS_MESSAGE_REFERENCE SET LOADED='Y' WHERE ORD BETWEEN ? AND ? AND CHANNELID=? AND RELIABLE='Y' AND STATE <> '+'
-postgresql.msg.UPDATE_RELIABLE_REFS_NOT_LOADED=UPDATE JMS_MESSAGE_REFERENCE SET LOADED='N' WHERE CHANNELID=?
-postgresql.msg.SELECT_MIN_ORDERING=SELECT MIN(ORD) FROM JMS_MESSAGE_REFERENCE WHERE CHANNELID=? AND STATE <> '+' AND LOADED = 'N'
-postgresql.msg.DELETE_UNRELIABLE_REFS=DELETE FROM JMS_MESSAGE_REFERENCE WHERE RELIABLE = 'N'
-postgresql.msg.CREATE_MESSAGE=CREATE TABLE JMS_MESSAGE (MESSAGEID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY int2, COREHEADERS BYTEA, PAYLOAD BYTEA, CHANNELCOUNT INTEGER, TYPE int2, JMSTYPE VARCHAR(255), CORRELATIONID VARCHAR(255), CORRELATIONID_BYTES BYTEA, DESTINATION_ID BIGINT, REPLYTO_ID BIGINT, JMSPROPERTIES BYTEA, PRIMARY KEY (MESSAGEID))
-postgresql.msg.LOAD_MESSAGES=SELECT MESSAGEID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, COREHEADERS, PAYLOAD, CHANNELCOUNT, TYPE, JMSTYPE, CORRELATIONID, CORRELATIONID_BYTES, DESTINATION_ID, REPLYTO_ID, JMSPROPERTIES FROM JMS_MESSAGE
-postgresql.msg.INSERT_MESSAGE=INSERT INTO JMS_MESSAGE (MESSAGEID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, COREHEADERS, PAYLOAD, CHANNELCOUNT, TYPE, JMSTYPE, CORRELATIONID, CORRELATIONID_BYTES, DESTINATION_ID, REPLYTO_ID, JMSPROPERTIES) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
-postgresql.msg.UPDATE_MESSAGE_CHANNELCOUNT=UPDATE JMS_MESSAGE SET CHANNELCOUNT=? WHERE MESSAGEID=?
-postgresql.msg.DELETE_MESSAGE=DELETE FROM JMS_MESSAGE WHERE MESSAGEID=?
-postgresql.msg.MESSAGEID_COLUMN=MESSAGEID
-postgresql.msg.UPDATE_UNRELIABLE_CHANNELCOUNT=UPDATE JMS_MESSAGE SET CHANNELCOUNT = CHANNELCOUNT - 1 WHERE MESSAGEID IN (SELECT MR.MESSAGEID FROM JMS_MESSAGE_REFERENCE MR WHERE MR.RELIABLE = 'N' AND MR.CHANNELID = ?)
-postgresql.msg.DELETE_UNREFFED_MESSAGES=DELETE FROM JMS_MESSAGE WHERE CHANNELCOUNT = 0
-postgresql.msg.CREATE_TRANSACTION=CREATE TABLE JMS_TRANSACTION (TRANSACTIONID BIGINT, BRANCH_QUAL BYTEA, FORMAT_ID INTEGER, GLOBAL_TXID BYTEA, PRIMARY KEY (TRANSACTIONID))
-postgresql.msg.INSERT_TRANSACTION=INSERT INTO JMS_TRANSACTION (TRANSACTIONID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?)
-postgresql.msg.DELETE_TRANSACTION=DELETE FROM JMS_TRANSACTION WHERE TRANSACTIONID = ?
-postgresql.msg.SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTIONID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JMS_TRANSACTION
-postgresql.msg.DELETE_ALL_TRANSACTIONS=DELETE FROM JMS_TRANSACTION
-postgresql.msg.CREATE_COUNTER=CREATE TABLE JMS_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
-postgresql.msg.UPDATE_COUNTER=UPDATE JMS_COUNTER SET NEXT_ID = ? WHERE NAME=?
-postgresql.msg.SELECT_COUNTER=SELECT NEXT_ID FROM JMS_COUNTER WHERE NAME=?
-postgresql.msg.INSERT_COUNTER=INSERT INTO JMS_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
-postgresql.msg.DELETE_ALL_COUNTERS=DELETE FROM JMS_COUNTER
-postgresql.msg.SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNELID) FROM JMS_MESSAGE_REFERENCE
-
+postgresql.user.CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID))
+postgresql.user.CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
+postgresql.user.SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
+postgresql.user.POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/struts-config.xml
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/struts-config.xml 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/struts-config.xml 2007-06-08 17:26:46 UTC (rev 63430)
@@ -59,9 +59,12 @@
<forward name="page5"
path="jms.detail5.tile"
redirect="false"/>
- <forward name="pageCF"
- path="jms.detailCF.tile"
+ <forward name="pageConnFactory"
+ path="jms.detailConnFactory.tile"
redirect="false"/>
+ <forward name="pageClustered"
+ path="jms.detailClustered.tile"
+ redirect="false"/>
</action>
<!--
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/tiles-defs.xml
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/tiles-defs.xml 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/tiles-defs.xml 2007-06-08 17:26:46 UTC (rev 63430)
@@ -51,11 +51,17 @@
value="/WEB-INF/jsp/jms/detailJms5.jsp"/>
</definition>
- <definition name="jms.detailCF.tile"
+ <definition name="jms.detailConnFactory.tile"
extends="jms.portal.layout">
<put name="body"
value="/WEB-INF/jsp/jms/detailConnFactory.jsp"/>
</definition>
+
+ <definition name="jms.detailClustered.tile"
+ extends="jms.portal.layout">
+ <put name="body"
+ value="/WEB-INF/jsp/jms/detailClustered.jsp"/>
+ </definition>
<!--
JBoss Messaging destination related pages.
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/validation.xml
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/validation.xml 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/conf/jms/validation.xml 2007-06-08 17:26:46 UTC (rev 63430)
@@ -36,6 +36,22 @@
<arg0 key="jms.view.maxParams"/>
</field>
+ <field property="stateTimeout" depends="long">
+ <arg0 key="jms.view.stateTimeout"/>
+ </field>
+
+ <field property="castTimeout" depends="long">
+ <arg0 key="jms.view.castTimeout"/>
+ </field>
+
+ <field property="statsSendPeriod" depends="long">
+ <arg0 key="jms.view.statsSendPeriod"/>
+ </field>
+
+ <field property="threadPoolSize" depends="integer">
+ <arg0 key="jms.view.threadPoolSize"/>
+ </field>
+
<field property="defaultTempQueueDownCacheSize" depends="integer">
<arg0 key="jms.view.defaultTempQueueDownCacheSize"/>
</field>
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailConnFactory.jsp
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailConnFactory.jsp 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailConnFactory.jsp 2007-06-08 17:26:46 UTC (rev 63430)
@@ -63,15 +63,22 @@
</li>
<li>
<a class="active">
- <fmt:message key="jms.section.heading.cfSettings.page" bundle="${jmsmsg}" />
+ <fmt:message key="jms.section.heading.connFactory.page" bundle="${jmsmsg}" />
</a>
</li>
+ <li>
+ <logic:equal name="jms" property="clusteredPostOffice" value="true">
+ <a href="javascript:void(setPageAndSubmit('pageClustered'))">
+ <fmt:message key="jms.section.heading.clustered.page" bundle="${jmsmsg}" />
+ </a>
+ </logic:equal>
+ </li>
</ul>
<p class="sectionHeading">
<span class="sectionHeadingText">
<fmt:message key="jms.section.heading.manage" bundle="${jmsmsg}" />
- <fmt:message key="jms.section.heading.cfSettings" bundle="${jmsmsg}" />
+ <fmt:message key="jms.section.heading.connFactory" bundle="${jmsmsg}" />
</span>
</p>
@@ -118,6 +125,10 @@
<span class="caseDetailFieldHeader"><fmt:message key="jms.view.prefetchSize" bundle="${jmsmsg}" /></span>
<html:text property="prefetchSize" />
</li>
+ <li>
+ <span class="caseDetailFieldHeader"><fmt:message key="jms.view.jndiBindings" bundle="${jmsmsg}" /></span>
+ <html:textarea cols="30" rows="4" property="jndiBindingsText" />
+ </li>
</ul>
<% // include hidden values for checked checkboxes specified on other pages %>
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms.jsp
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms.jsp 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms.jsp 2007-06-08 17:26:46 UTC (rev 63430)
@@ -62,10 +62,17 @@
</a>
</li>
<li>
- <a href="javascript:void(setPageAndSubmit('pageCF'))">
- <fmt:message key="jms.section.heading.cfSettings.page" bundle="${jmsmsg}" />
+ <a href="javascript:void(setPageAndSubmit('pageConnFactory'))">
+ <fmt:message key="jms.section.heading.connFactory.page" bundle="${jmsmsg}" />
</a>
</li>
+ <li>
+ <logic:equal name="jms" property="clusteredPostOffice" value="true">
+ <a href="javascript:void(setPageAndSubmit('pageClustered'))">
+ <fmt:message key="jms.section.heading.clustered.page" bundle="${jmsmsg}" />
+ </a>
+ </logic:equal>
+ </li>
</ul>
<p class="sectionHeading">
@@ -146,6 +153,10 @@
</html:select>
</li>
<li>
+ <span class="caseDetailFieldHeader"><fmt:message key="jms.view.maxParams" bundle="${jmsmsg}" /></span>
+ <html:text property="maxParams" />
+ </li>
+ <li>
<span class="caseDetailFieldHeader"><fmt:message key="jms.view.usingBatchUpdates" bundle="${jmsmsg}" /></span>
<html:checkbox property="usingBatchUpdates" />
</li>
@@ -157,10 +168,6 @@
<span class="caseDetailFieldHeader"><fmt:message key="jms.view.usingTrailingByte" bundle="${jmsmsg}" /></span>
<html:checkbox property="usingTrailingByte" />
</li>
- <li>
- <span class="caseDetailFieldHeader"><fmt:message key="jms.view.maxParams" bundle="${jmsmsg}" /></span>
- <html:text property="maxParams" />
- </li>
<br/> <br/>
<li>
<span class="caseDetailFieldHeader"><fmt:message key="jms.view.createUserTablesOnStartup" bundle="${jmsmsg}" /></span>
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms2.jsp
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms2.jsp 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms2.jsp 2007-06-08 17:26:46 UTC (rev 63430)
@@ -62,10 +62,17 @@
</a>
</li>
<li>
- <a href="javascript:void(setPageAndSubmit('pageCF'))">
- <fmt:message key="jms.section.heading.cfSettings.page" bundle="${jmsmsg}" />
+ <a href="javascript:void(setPageAndSubmit('pageConnFactory'))">
+ <fmt:message key="jms.section.heading.connFactory.page" bundle="${jmsmsg}" />
</a>
</li>
+ <li>
+ <logic:equal name="jms" property="clusteredPostOffice" value="true">
+ <a href="javascript:void(setPageAndSubmit('pageClustered'))">
+ <fmt:message key="jms.section.heading.clustered.page" bundle="${jmsmsg}" />
+ </a>
+ </logic:equal>
+ </li>
</ul>
<p class="sectionHeading">
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms3.jsp
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms3.jsp 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms3.jsp 2007-06-08 17:26:46 UTC (rev 63430)
@@ -63,10 +63,17 @@
</a>
</li>
<li>
- <a href="javascript:void(setPageAndSubmit('pageCF'))">
- <fmt:message key="jms.section.heading.cfSettings.page" bundle="${jmsmsg}" />
+ <a href="javascript:void(setPageAndSubmit('pageConnFactory'))">
+ <fmt:message key="jms.section.heading.connFactory.page" bundle="${jmsmsg}" />
</a>
</li>
+ <li>
+ <logic:equal name="jms" property="clusteredPostOffice" value="true">
+ <a href="javascript:void(setPageAndSubmit('pageClustered'))">
+ <fmt:message key="jms.section.heading.clustered.page" bundle="${jmsmsg}" />
+ </a>
+ </logic:equal>
+ </li>
</ul>
<p class="sectionHeading">
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms4.jsp
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms4.jsp 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms4.jsp 2007-06-08 17:26:46 UTC (rev 63430)
@@ -62,10 +62,17 @@
</a>
</li>
<li>
- <a href="javascript:void(setPageAndSubmit('pageCF'))">
- <fmt:message key="jms.section.heading.cfSettings.page" bundle="${jmsmsg}" />
+ <a href="javascript:void(setPageAndSubmit('pageConnFactory'))">
+ <fmt:message key="jms.section.heading.connFactory.page" bundle="${jmsmsg}" />
</a>
</li>
+ <li>
+ <logic:equal name="jms" property="clusteredPostOffice" value="true">
+ <a href="javascript:void(setPageAndSubmit('pageClustered'))">
+ <fmt:message key="jms.section.heading.clustered.page" bundle="${jmsmsg}" />
+ </a>
+ </logic:equal>
+ </li>
</ul>
<p class="sectionHeading">
@@ -96,7 +103,7 @@
<ul>
<logic:iterate id="element" name="jms" property="userSqlMap">
<bean:define id="sqlKey" name="element" property="key" />
- <% String name = "iserSqlMap(" + sqlKey + ")"; %>
+ <% String name = "userSqlMap(" + sqlKey + ")"; %>
<li>
<span class="caseDetailFieldHeader">
<bean:write name="sqlKey"/>=
Modified: projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms5.jsp
===================================================================
--- projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms5.jsp 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/resources/admin-console.war/WEB-INF/jsp/jms/detailJms5.jsp 2007-06-08 17:26:46 UTC (rev 63430)
@@ -62,10 +62,17 @@
</a>
</li>
<li>
- <a href="javascript:void(setPageAndSubmit('pageCF'))">
- <fmt:message key="jms.section.heading.cfSettings.page" bundle="${jmsmsg}" />
+ <a href="javascript:void(setPageAndSubmit('pageConnFactory'))">
+ <fmt:message key="jms.section.heading.connFactory.page" bundle="${jmsmsg}" />
</a>
</li>
+ <li>
+ <logic:equal name="jms" property="clusteredPostOffice" value="true">
+ <a href="javascript:void(setPageAndSubmit('pageClustered'))">
+ <fmt:message key="jms.section.heading.clustered.page" bundle="${jmsmsg}" />
+ </a>
+ </logic:equal>
+ </li>
</ul>
<p class="sectionHeading">
@@ -96,7 +103,7 @@
<ul>
<logic:iterate id="element" name="jms" property="postOfficeSqlMap">
<bean:define id="sqlKey" name="element" property="key" />
- <% String name = "iserSqlMap(" + sqlKey + ")"; %>
+ <% String name = "postOfficeSqlMap(" + sqlKey + ")"; %>
<li>
<span class="caseDetailFieldHeader">
<bean:write name="sqlKey"/>=
Modified: projects/admin-console/trunk/src/test/org/jboss/admin/console/web/struts/jms/SaveJmsActionTest.java
===================================================================
--- projects/admin-console/trunk/src/test/org/jboss/admin/console/web/struts/jms/SaveJmsActionTest.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/test/org/jboss/admin/console/web/struts/jms/SaveJmsActionTest.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -37,160 +37,166 @@
* @version $Revision: 56034 $
*/
public class SaveJmsActionTest extends MockStrutsJmsTestCase {
- /**
- * Logger for this class
- */
- private static final Log logger = LogFactory
- .getLog(SaveJmsActionTest.class);
+ /**
+ * Logger for this class
+ */
+ private static final Log logger = LogFactory
+ .getLog(SaveJmsActionTest.class);
- /*
- * @see MockStrutsTestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
+ /*
+ * @see MockStrutsTestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
- }
+ }
- /*
- * @see MockStrutsTestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
+ /*
+ * @see MockStrutsTestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
- /**
- * Verify the results from a good jms attributes update.
- */
- public void checkGoodResponse() {
- verifyInputTilesForward("jms.detail.tile");
- verifyTilesForward("page1", "jms.detail.tile");
- JmsForm jmsForm = (JmsForm) getRequest().getSession().getAttribute(
- "jms");
- assertNotNull(jmsForm);
- verifyNoActionErrors();
- verifyActionMessages(new String[] { "jms.update.success" });
- }
+ /**
+ * Verify the results from a good jms attributes update.
+ */
+ public void checkGoodResponse() {
+ verifyInputTilesForward("jms.detail.tile");
+ verifyTilesForward("page1", "jms.detail.tile");
+ JmsForm jmsForm = (JmsForm) getRequest().getSession().getAttribute(
+ "jms");
+ assertNotNull(jmsForm);
+ verifyNoActionErrors();
+ verifyActionMessages(new String[] { "jms.update.success" });
+ }
- /**
- * Verify the tiles and forward are set as required,
- *
- * Verify all calls were made to the service.
- */
- public final void testSaveJmsAttributes() throws Exception {
- /*
- * Setup the request:
- */
- setRequestPathInfo(MODULE_JMS, "/jms/save");
+ /**
+ * Verify the tiles and forward are set as required,
+ *
+ * Verify all calls were made to the service.
+ */
+ public final void testSaveJmsAttributes() throws Exception {
+ /*
+ * Setup the request:
+ */
+ setRequestPathInfo(MODULE_JMS, "/jms/save");
- /*
- * Tell the mockJms what methods to expect to be called and put the mock
- * somewhere the Actions will be able to retrieve it from:
- */
- mockJms.saveJmsAttributes(new Jms());
- startAndStoreMockControl();
+ /*
+ * Tell the mockJms what methods to expect to be called and put the mock
+ * somewhere the Actions will be able to retrieve it from:
+ */
+ mockJms.saveJmsAttributes(new Jms());
+ startAndStoreMockControl();
- /*
- * Perform the action and check the results:
- */
- actionPerform();
- checkGoodResponse();
- }
+ /*
+ * Perform the action and check the results:
+ */
+ actionPerform();
+ checkGoodResponse();
+ }
- /**
- * Change DataSource and verify the new SQL properties are loaded after a
- * tab switching.
- *
- * Verify the tiles and forward are set as required.
- */
- public final void testLoadNewSqlPropertiesAfterTabSwitching()
- throws Exception {
- /*
- * Setup test data:
- */
- JmsForm jmsForm = new JmsForm();
- Map dataSources = new HashMap();
- dataSources.put("TestDS1", "org.hsqldb.jdbcDriver");
- dataSources.put("TestDS2", "org.postgresql.Driver");
- jmsForm.setDataSources(dataSources);
+ /**
+ * Change DataSource and verify the new SQL properties are loaded after a
+ * tab switching.
+ *
+ * Verify the tiles and forward are set as required.
+ */
+ public final void testLoadNewSqlPropertiesAfterTabSwitching()
+ throws Exception {
+ /*
+ * Setup test data:
+ */
+ JmsForm jmsForm = new JmsForm();
+ Map dataSources = new HashMap();
+ dataSources.put("TestDS1", "org.hsqldb.jdbcDriver");
+ dataSources.put("TestDS2", "org.postgresql.Driver");
+ jmsForm.setDataSources(dataSources);
- // Changing persistence database from hsqldb to postgresql:
- jmsForm.setMsgDataSourceName("TestDS2");
- jmsForm.setSavedMsgDataSourceName("TestDS1");
-
- // Keep user database the same:
- jmsForm.setUserDataSourceName("TestDS1");
- jmsForm.setSavedUserDataSourceName("TestDS1");
+ // Changing persistence database from hsqldb to postgresql:
+ jmsForm.setMsgDataSourceName("TestDS2");
+ jmsForm.setSavedMsgDataSourceName("TestDS1");
- // Load the new sql properties from the test directory:
- System.setProperty("jboss.server.data.dir",
- "./src/etc/test/server/default/data");
+ // Keep user database the same:
+ jmsForm.setUserDataSourceName("TestDS1");
+ jmsForm.setSavedUserDataSourceName("TestDS1");
+
+ // Keep post office database the same:
+ jmsForm.setPostOfficeDataSourceName("TestDS1");
+ jmsForm.setSavedPostOfficeDataSourceName("TestDS1");
- setRequestPathInfo(MODULE_JMS, "/jms/save");
- addRequestParameter("dispatch", "navigation");
- addRequestParameter("destination", "page3");
- setActionForm(jmsForm);
-
- /*
- * Perform the action:
- */
- actionPerform();
-
- /*
- * Check the results:
- */
- verifyInputTilesForward("jms.detail.tile");
- verifyTilesForward("page3", "jms.detail3.tile");
- JmsForm outForm = (JmsForm) getRequest().getSession().getAttribute(
- "jms");
- assertNotNull(outForm);
- verifyNoActionErrors();
- String value = (String) outForm.getMsgSqlEntry("MESSAGEID_COLUMN");
- assertEquals("MESSAGEID", value);
- }
+ // Load the new sql properties from the test directory:
+ System.setProperty("jboss.server.data.dir",
+ "./src/etc/test/server/default/data");
- /**
- * Set prefetchSize to an integer and verify that it passes the validation.
- */
- public final void testSetPrefetchSizeToInteger() throws Exception {
- /*
- * Setup test data:
- */
- JmsForm jmsForm = new JmsForm();
- jmsForm.setPrefetchSize("20");
- setRequestPathInfo(MODULE_JMS, "/jms/save");
- setActionForm(jmsForm);
+ setRequestPathInfo(MODULE_JMS, "/jms/save");
+ addRequestParameter("dispatch", "navigation");
+ addRequestParameter("destination", "page3");
+ setActionForm(jmsForm);
- /*
- * Tell mock what calls to expect, store the mock:
- */
- mockJms.saveJmsAttributes(new Jms());
- startAndStoreMockControl();
+ /*
+ * Perform the action:
+ */
+ actionPerform();
- /*
- * Perform the action and check the results:
- */
- actionPerform();
- checkGoodResponse();
- }
+ /*
+ * Check the results:
+ */
+ verifyInputTilesForward("jms.detail.tile");
+ verifyTilesForward("page3", "jms.detail3.tile");
+ JmsForm outForm = (JmsForm) getRequest().getSession().getAttribute(
+ "jms");
+ assertNotNull(outForm);
+ verifyNoActionErrors();
+ String value = (String) outForm.getMsgSqlEntry("CREATE_MESSAGE");
+ String expValue = "CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY SMALLINT, HEADERS BYTEA, PAYLOAD BYTEA, CHANNEL_COUNT INTEGER, TYPE SMALLINT, PRIMARY KEY (MESSAGE_ID))";
+ assertEquals(expValue, value);
+ }
- /**
- * Set prefetchSize to a non-integer and verify that it fails the validation.
- */
- public final void testSetPrefetchSizeToNonInteger() throws Exception {
- /*
- * Setup test data:
- */
- JmsForm jmsForm = new JmsForm();
- jmsForm.setPrefetchSize("abc");
- setRequestPathInfo(MODULE_JMS, "/jms/save");
- setActionForm(jmsForm);
-
- /*
- * Perform the action and check the result:
- */
- startAndStoreMockControl();
- actionPerform();
- verifyActionErrors(new String[] { "errors.integer" });
- }
+ /**
+ * Set prefetchSize to an integer and verify that it passes the validation.
+ */
+ public final void testSetPrefetchSizeToInteger() throws Exception {
+ /*
+ * Setup test data:
+ */
+ JmsForm jmsForm = new JmsForm();
+ jmsForm.setPrefetchSize("20");
+ setRequestPathInfo(MODULE_JMS, "/jms/save");
+ setActionForm(jmsForm);
+ /*
+ * Tell mock what calls to expect, store the mock:
+ */
+ mockJms.saveJmsAttributes(new Jms());
+ startAndStoreMockControl();
+
+ /*
+ * Perform the action and check the results:
+ */
+ actionPerform();
+ checkGoodResponse();
+ }
+
+ /**
+ * Set prefetchSize to a non-integer and verify that it fails the
+ * validation.
+ */
+ public final void testSetPrefetchSizeToNonInteger() throws Exception {
+ /*
+ * Setup test data:
+ */
+ JmsForm jmsForm = new JmsForm();
+ jmsForm.setPrefetchSize("abc");
+ setRequestPathInfo(MODULE_JMS, "/jms/save");
+ setActionForm(jmsForm);
+
+ /*
+ * Perform the action and check the result:
+ */
+ startAndStoreMockControl();
+ actionPerform();
+ verifyActionErrors(new String[] { "errors.integer" });
+ }
+
}
\ No newline at end of file
Modified: projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceDestinationHelperTest.java
===================================================================
--- projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceDestinationHelperTest.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceDestinationHelperTest.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -37,6 +37,7 @@
import org.easymock.classextension.MockClassControl;
import org.jboss.admin.model.jms.Destination;
import org.jboss.admin.model.jms.DestinationIdentifier;
+import org.jboss.admin.model.jms.Jms;
import org.jboss.admin.model.jms.Queue;
import org.jboss.admin.service.MBeanServerHelper;
import org.jboss.admin.service.ServiceTestHelper;
@@ -108,6 +109,8 @@
/*
* Setup test data:
*/
+ Jms jms = new Jms();
+ jms.setDefaultQueueJNDIContext("/queue");
Queue queue = new Queue();
queue.setName("testQueue");
String moduleName = "testQueue";
@@ -135,6 +138,7 @@
/*
* Run the method under test:
*/
+ service.setJms(jms);
service.createDestination(queue);
/*
@@ -236,8 +240,8 @@
.get(Constants.CommonAttributes.MESSAGE_COUNTER_HISTORY_DAY_LIMIT)).intValue());
assertEquals(3000, ((Integer) map
.get(Constants.CommonAttributes.PAGE_SIZE)).intValue());
- assertEquals(10, ((Integer) map
- .get(Constants.CommonAttributes.REDELIVERY_DELAY)).intValue());
+ assertEquals(10, ((Long) map
+ .get(Constants.CommonAttributes.REDELIVERY_DELAY)).longValue());
String[] securityRole = (String[]) map
.get(Constants.CommonAttributes.SECURITY_ROLES);
assertEquals(1, securityRole.length);
Modified: projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceJmsHelperTest.java
===================================================================
--- projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceJmsHelperTest.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/DeploymentServiceJmsHelperTest.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -199,8 +199,7 @@
Properties depends3 = new Properties();
String dataSourceBinding = Constants.JmsAttributes.DATA_SOURCE_BINDING_PREFIX
+ jms.getMsgDataSourceName();
- depends3.put(Constants.JmsAttributes.DATA_SOURCE_BINDING,
- dataSourceBinding);
+ depends3.put("", dataSourceBinding);
depends3.put(Constants.JmsAttributes.TRANSACTION_MANAGER, jms
.getTransactionManagerName());
@@ -225,8 +224,7 @@
Properties depends4 = new Properties();
dataSourceBinding = Constants.JmsAttributes.DATA_SOURCE_BINDING_PREFIX
+ jms.getUserDataSourceName();
- depends4.put(Constants.JmsAttributes.DATA_SOURCE_BINDING,
- dataSourceBinding);
+ depends4.put("", dataSourceBinding);
depends4.put(Constants.JmsAttributes.TRANSACTION_MANAGER, jms
.getTransactionManagerName());
@@ -252,8 +250,7 @@
Properties depends5 = new Properties();
dataSourceBinding = Constants.JmsAttributes.DATA_SOURCE_BINDING_PREFIX
+ jms.getPostOfficeDataSourceName();
- depends5.put(Constants.JmsAttributes.DATA_SOURCE_BINDING,
- dataSourceBinding);
+ depends5.put("", dataSourceBinding);
depends5.put(Constants.JmsAttributes.TRANSACTION_MANAGER, jms
.getTransactionManagerName());
depends5.put(Constants.JmsAttributes.SERVER_PEER, jms
Modified: projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/MBeanServerJmsHelperTest.java
===================================================================
--- projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/MBeanServerJmsHelperTest.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/test/org/jboss/admin/service/jms/MBeanServerJmsHelperTest.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -132,6 +132,8 @@
String defDLQName = "jboss.messaging.destination:service=Queue,name=DLQ";
String defExpiryQueueName = "jboss.messaging.destination:service=Queue,name=ExpiryQueue";
String transactionManagerName = "jboss:service=TransactionManager";
+ String loadBalancingFactoryName = "org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory";
+ String channelFactoryName = "jgroups.mux:name=Multiplexer";
String sqlProperties = "prop1=value1" + NL + "prop2=value 2";
ObjectName connectionFactory = new ObjectName(connectionFactoryName);
@@ -143,6 +145,7 @@
ObjectName defaultDLQ = new ObjectName(defDLQName);
ObjectName defaultExpiryQueue = new ObjectName(defExpiryQueueName);
ObjectName transactionManager = new ObjectName(transactionManagerName);
+ ObjectName channelFactory = new ObjectName(channelFactoryName);
/*
@@ -179,6 +182,12 @@
Constants.JmsAttributes.DUPS_OK_BATCH_SIZE);
control.setReturnValue(Integer.valueOf("1000"));
mockMBeanServer.getAttribute(connectionFactory,
+ Constants.JmsAttributes.JNDI_BINDINGS);
+ control.setReturnValue(elem);
+ mockMBeanServer.getAttribute(connectionFactory,
+ Constants.JmsAttributes.LOAD_BALANCING_FACTORY);
+ control.setReturnValue(loadBalancingFactoryName);
+ mockMBeanServer.getAttribute(connectionFactory,
Constants.JmsAttributes.PREFETCH_SIZE);
control.setReturnValue(Integer.valueOf("150"));
mockMBeanServer.getAttribute(connectionFactory,
@@ -306,6 +315,46 @@
mockMBeanServer.getAttribute(postOffice,
Constants.JmsAttributes.POST_OFFICE_NAME);
control.setReturnValue("JMS");
+ // Clustered PostOffice attributes:
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.GROUP_NAME);
+ control.setReturnValue("DefaultPostOffice");
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.STATE_TIMEOUT);
+ control.setReturnValue(Long.valueOf("5000"));
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.CAST_TIMEOUT);
+ control.setReturnValue(Long.valueOf("5000"));
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.STATS_SEND_PERIOD);
+ control.setReturnValue(Long.valueOf("10000"));
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.MESSAGE_PULL_POLICY);
+ control.setReturnValue("org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy");
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.CLUSTER_ROUTER_FACTORY);
+ control.setReturnValue("org.jboss.messaging.core.plugin.postoffice.cluster.DefaultRouterFactory");
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.CHANNEL_FACTORY_NAME);
+ control.setReturnValue(channelFactory);
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.SYNC_CHANNEL_NAME);
+ control.setReturnValue("udp-sync");
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.ASYNC_CHANNEL_NAME);
+ control.setReturnValue("udp");
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.CHANNEL_PARTITION_NAME);
+ control.setReturnValue("DefaultPartition-JMS");
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.THREAD_POOL_SIZE);
+ control.setReturnValue(Integer.valueOf("50"));
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.SYNC_CHANNEL_CONFIG);
+ control.setReturnValue(elem);
+ mockMBeanServer.getAttribute(postOffice,
+ Constants.JmsAttributes.ASYNC_CHANNEL_CONFIG);
+ control.setReturnValue(elem);
/*
* Build dataSource map:
@@ -369,6 +418,7 @@
assertEquals(75000, jms.getDefaultTempQueueFullSize());
assertEquals(2000, jms.getDefaultTempQueuePageSize());
assertEquals(1000, jms.getDupsOKBatchSize());
+ assertEquals(loadBalancingFactoryName, jms.getLoadBalancingFactory());
assertEquals(150, jms.getPrefetchSize());
assertEquals(serverPeerName, jms.getServerPeerName());
@@ -385,7 +435,7 @@
assertEquals(persistenceManagerName, jms.getPersistenceManagerName());
assertEquals("1.2.0.GA", jms.getProviderVersion());
assertEquals("java:/jaas/messaging", jms.getSecurityDomain());
- assertEquals("server.0", jms.getServerPeerID());
+ assertEquals(0, jms.getServerPeerID());
/*
* Check attributes from the PersistenceManager:
@@ -404,8 +454,8 @@
* Check attributes from the JMSUserManager:
*/
assertFalse(jms.isCreateUserTablesOnStartup());
- assertEquals("java:/DefaultDS", jms.getUserDataSource());
- assertEquals("DefaultDS", jms.getUserDataSourceName());
+ assertEquals("java:/TestDS", jms.getUserDataSource());
+ assertEquals("TestDS", jms.getUserDataSourceName());
assertEquals(sqlProperties, jms.getUserSqlProperties());
/*
@@ -416,6 +466,18 @@
assertEquals("TestDS", jms.getPostOfficeDataSourceName());
assertEquals(sqlProperties, jms.getPostOfficeSqlProperties());
assertEquals("JMS", jms.getPostOfficeName());
+ // Attributes from clustered PostOffice:
+ assertEquals("DefaultPostOffice", jms.getGroupName());
+ assertTrue(jms.isClusteredPostOffice());
+ assertEquals(5000, jms.getStateTimeout());
+ assertEquals(5000, jms.getCastTimeout());
+ assertEquals(10000, jms.getStatsSendPeriod());
+ assertEquals("org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy", jms.getMessagePullPolicy());
+ assertEquals("org.jboss.messaging.core.plugin.postoffice.cluster.DefaultRouterFactory", jms.getClusterRouterFactory());
+ assertEquals(channelFactoryName, jms.getChannelFactoryName());
+ assertEquals("udp-sync", jms.getSyncChannelName());
+ assertEquals("udp", jms.getAsyncChannelName());
+ assertEquals("DefaultPartition-JMS", jms.getChannelPartitionName());
/*
* Check dataSources map:
Modified: projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsPageTest.java
===================================================================
--- projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsPageTest.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsPageTest.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -32,6 +32,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlHiddenInput;
@@ -45,7 +46,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
/**
- * Integration tests for managing JBossMQ general settings.
+ * Integration tests for managing JBoss Messaging general settings.
*
* @author <a href="chi.lin at unisys.com">Chi Lin </a>
* @version $Revision: 59929 $
@@ -67,8 +68,18 @@
private final static String HREF_USER_SQL_PAGE = "javascript:void(setPageAndSubmit('page4'))";
+ private final static String HREF_POSTOFFICE_SQL_PAGE = "javascript:void(setPageAndSubmit('page5'))";
+
+ private final static String HREF_CONN_FACTORY_PAGE = "javascript:void(setPageAndSubmit('pageConnFactory'))";
+
+ private final static String HREF_CLUSTERED_PAGE = "javascript:void(setPageAndSubmit('pageClustered'))";
+
private final static String HREF_DATASOURCE_LOCALTX = "/admin/datasource/datasource/list.html?type=localtxdatasources";
+ private final static String MUST_BE_INTEGER = " must be an integer";
+
+ private final static String MUST_BE_LONG = " must be a long";
+
private final URL jmsUrl;
protected final Properties msgProps;
@@ -80,7 +91,7 @@
/*
* Load the message properties:
*/
- msgProps = loadProperties(jbossmqMsgFile);
+ msgProps = loadProperties(jmsMsgFile);
}
/**
@@ -110,16 +121,22 @@
* Get the jms form and verify the existence of the input fields:
*/
final HtmlForm form = jmsPage.getFormByName("jms");
- final HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueDownCacheSize");
- final HtmlTextInput defaultTempQueueFullSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueFullSize");
- final HtmlTextInput defaultTempQueuePageSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueuePageSize");
- final HtmlTextInput prefetchSize = (HtmlTextInput) form
- .getInputByName("prefetchSize");
- final HtmlTextInput queuedExecutorPoolSize = (HtmlTextInput) form
- .getInputByName("queuedExecutorPoolSize");
+ final HtmlTextInput defaultDLQName = (HtmlTextInput) form
+ .getInputByName("defaultDLQName");
+ final HtmlTextInput defaultExpiryQueueName = (HtmlTextInput) form
+ .getInputByName("defaultExpiryQueueName");
+ final HtmlTextInput defaultMaxDeliveryAttempts = (HtmlTextInput) form
+ .getInputByName("defaultMaxDeliveryAttempts");
+ final HtmlTextInput defaultMessageCounterHistoryDayLimit = (HtmlTextInput) form
+ .getInputByName("defaultMessageCounterHistoryDayLimit");
+ final HtmlTextInput defaultRedeliveryDelay = (HtmlTextInput) form
+ .getInputByName("defaultRedeliveryDelay");
+ final HtmlTextInput failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ final HtmlTextInput failoverCompleteTimeout = (HtmlTextInput) form
+ .getInputByName("failoverCompleteTimeout");
+ final HtmlTextInput queueStatsSamplePeriod = (HtmlTextInput) form
+ .getInputByName("queueStatsSamplePeriod");
final HtmlTextInput securityDomain = (HtmlTextInput) form
.getInputByName("securityDomain");
final List textAreas = form.getTextAreasByName("defaultSecurityRoles");
@@ -129,13 +146,29 @@
final HtmlSelect msgDataSourceName = (HtmlSelect) form
.getSelectByName("msgDataSourceName");
final List msgDataSourceOptions = msgDataSourceName.getOptions();
+ final HtmlTextInput maxParams = (HtmlTextInput) form
+ .getInputByName("maxParams");
final HtmlCheckBoxInput usingBatchUpdates = (HtmlCheckBoxInput) form
.getInputByName("usingBatchUpdates");
+ final HtmlCheckBoxInput usingBinaryStream = (HtmlCheckBoxInput) form
+ .getInputByName("usingBinaryStream");
+ final HtmlCheckBoxInput usingTrailingByte = (HtmlCheckBoxInput) form
+ .getInputByName("usingTrailingByte");
+
final HtmlCheckBoxInput createUserTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createUserTablesOnStartup");
final HtmlSelect userDataSourceName = (HtmlSelect) form
.getSelectByName("userDataSourceName");
final List userDataSourceOptions = userDataSourceName.getOptions();
+
+ final HtmlCheckBoxInput createPostOfficeTablesOnStartup = (HtmlCheckBoxInput) form
+ .getInputByName("createPostOfficeTablesOnStartup");
+ final HtmlSelect postOfficeDataSourceName = (HtmlSelect) form
+ .getSelectByName("postOfficeDataSourceName");
+ final List postOfficeDataSourceOptions = postOfficeDataSourceName
+ .getOptions();
+ final HtmlTextInput postOfficeName = (HtmlTextInput) form
+ .getInputByName("postOfficeName");
}
/**
@@ -188,103 +221,275 @@
}
/**
- * Verify the provided page contains the expected input fields of the jms
- * "Message SQL" page. Note that the value of the input fields are not
- * checked.
+ * Verify the provided page is a jms "Message SQL" page, and if the page is
+ * not empty, it contains the expected input fields for such a page. Note
+ * that the value of the input fields are not checked.
*
- * @param jmsPage
+ * @param msgSqlPage
* The HtmlPage to be verified.
* @throws Exception
*/
private void verifyMessageSqlPage(HtmlPage msgSqlPage) throws Exception {
/*
- * Verify the SQL properties for message persistence are present:
+ * Verify the page heading:
*/
- final HtmlForm form = msgSqlPage.getFormByName("jms");
- final HtmlTextInput blobType = (HtmlTextInput) form
- .getInputByName("msgSqlMap(BLOB_TYPE)");
- final HtmlTextInput insertTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(INSERT_TX)");
- final HtmlTextInput insertMessage = (HtmlTextInput) form
- .getInputByName("msgSqlMap(INSERT_MESSAGE)");
- final HtmlTextInput selectAllUncommitedTxs = (HtmlTextInput) form
- .getInputByName("msgSqlMap(SELECT_ALL_UNCOMMITED_TXS)");
- final HtmlTextInput selectMaxTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(SELECT_MAX_TX)");
- final HtmlTextInput deleteAllTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(DELETE_ALL_TX)");
- final HtmlTextInput selectMessagesInDest = (HtmlTextInput) form
- .getInputByName("msgSqlMap(SELECT_MESSAGES_IN_DEST)");
- final HtmlTextInput selectMessage = (HtmlTextInput) form
- .getInputByName("msgSqlMap(SELECT_MESSAGE)");
- final HtmlTextInput markMessage = (HtmlTextInput) form
- .getInputByName("msgSqlMap(MARK_MESSAGE)");
- final HtmlTextInput updateMessage = (HtmlTextInput) form
- .getInputByName("msgSqlMap(UPDATE_MESSAGE)");
- final HtmlTextInput updateMarkedMessages = (HtmlTextInput) form
- .getInputByName("msgSqlMap(UPDATE_MARKED_MESSAGES)");
- final HtmlTextInput updateMarkedMessagesWithTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(UPDATE_MARKED_MESSAGES_WITH_TX)");
- final HtmlTextInput deleteMarkedMessagesWithTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(DELETE_MARKED_MESSAGES_WITH_TX)");
- final HtmlTextInput deleteTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(DELETE_TX)");
- final HtmlTextInput deleteMarkedMessages = (HtmlTextInput) form
- .getInputByName("msgSqlMap(DELETE_MARKED_MESSAGES)");
- final HtmlTextInput deleteTemporaryMessages = (HtmlTextInput) form
- .getInputByName("msgSqlMap(DELETE_TEMPORARY_MESSAGES)");
- final HtmlTextInput deleteMessage = (HtmlTextInput) form
- .getInputByName("msgSqlMap(DELETE_MESSAGE)");
- final HtmlTextInput createMessageTable = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_MESSAGE_TABLE)");
- final HtmlTextInput createIdxMessageTxopTxid = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_IDX_MESSAGE_TXOP_TXID)");
- final HtmlTextInput createIdxMessageDestination = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_IDX_MESSAGE_DESTINATION)");
- final HtmlTextInput createTxTable = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_TX_TABLE)");
- final HtmlTextInput createTablesOnStartup = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_TABLES_ON_STARTUP)");
+ String expectedMsg = msgProps.getProperty("jms.section.heading.msgSql");
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(msgSqlPage, expectedMsg));
+
+ /*
+ * Verify the SQL properties for message persistence, if present:
+ */
+ boolean propPresent = false;
+ HtmlForm form = msgSqlPage.getFormByName("jms");
+ HtmlTextInput textInput = null;
+
+ try {
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_MESSAGE_REFERENCE)");
+ propPresent = true;
+ } catch (ElementNotFoundException e) {
+ propPresent = false;
+ }
+
+ if (propPresent) {
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_IDX_MESSAGE_REF_TX)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_IDX_MESSAGE_REF_ORD)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_IDX_MESSAGE_REF_PAGE_ORD)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_IDX_MESSAGE_REF_MESSAGE_ID)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_MESSAGE)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_TRANSACTION)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_COUNTER)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(INSERT_MESSAGE_REF)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(DELETE_MESSAGE_REF)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(UPDATE_MESSAGE_REF)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(UPDATE_PAGE_ORDER)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(COMMIT_MESSAGE_REF1)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(COMMIT_MESSAGE_REF2)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(ROLLBACK_MESSAGE_REF1)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(ROLLBACK_MESSAGE_REF2)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(LOAD_PAGED_REFS)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(LOAD_UNPAGED_REFS)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(LOAD_REFS)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(UPDATE_REFS_NOT_PAGED)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_MIN_MAX_PAGE_ORD)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_EXISTS_REF)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_EXISTS_REF_MESSAGE_ID)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(UPDATE_DELIVERY_COUNT)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(UPDATE_CHANNEL_ID)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(LOAD_MESSAGES)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(INSERT_MESSAGE)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(INC_CHANNEL_COUNT)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(DEC_CHANNEL_COUNT)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(DELETE_MESSAGE)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(MESSAGE_ID_COLUMN)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(MESSAGE_EXISTS)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(INSERT_TRANSACTION)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(DELETE_TRANSACTION)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_PREPARED_TRANSACTIONS)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_MESSAGE_ID_FOR_REF)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_MESSAGE_ID_FOR_ACK)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(UPDATE_COUNTER)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_COUNTER)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(INSERT_COUNTER)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(SELECT_ALL_CHANNELS)");
+ }
}
/**
- * Verify the provided page contains the expected input fields of the jms
- * "State SQL" page. Note that the value of the input fields are not
+ * Verify the provided page is a jms "User SQL" page, and if the page is not
+ * empty, it contains the expected input fields for such a page. Note that
+ * the value of the input fields are not checked.
+ *
+ * @param userSqlPage
+ * The HtmlPage to be verified.
+ * @throws Exception
+ */
+ private void verifyUserSqlPage(HtmlPage userSqlPage) throws Exception {
+ /*
+ * Verify the page heading:
+ */
+ String expectedMsg = msgProps
+ .getProperty("jms.section.heading.userSql");
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(userSqlPage, expectedMsg));
+
+ /*
+ * Verify the SQL properties for user information persistence, if
+ * present:
+ */
+ boolean propPresent = false;
+ HtmlForm form = userSqlPage.getFormByName("jms");
+ HtmlTextInput textInput = null;
+
+ try {
+ textInput = (HtmlTextInput) form
+ .getInputByName("userSqlMap(CREATE_USER_TABLE)");
+ propPresent = true;
+ } catch (ElementNotFoundException e) {
+ propPresent = false;
+ }
+
+ if (propPresent) {
+ textInput = (HtmlTextInput) form
+ .getInputByName("userSqlMap(CREATE_ROLE_TABLE)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("userSqlMap(SELECT_PRECONF_CLIENTID)");
+ }
+ }
+
+ /**
+ * Verify the provided page is a jms "PostOffice SQL" page, and if the page
+ * is not empty, it contains the expected input fields for such a page. Note
+ * that the value of the input fields are not checked.
+ *
+ * @param postOfficeSqlPage
+ * The HtmlPage to be verified.
+ * @throws Exception
+ */
+ private void verifyPostOfficeSqlPage(HtmlPage postOfficeSqlPage)
+ throws Exception {
+ /*
+ * Verify the page heading:
+ */
+ String expectedMsg = msgProps
+ .getProperty("jms.section.heading.postOfficeSql");
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(postOfficeSqlPage,
+ expectedMsg));
+
+ /*
+ * Verify the SQL properties for post office information persistence, if
+ * present:
+ */
+ boolean propPresent = false;
+ HtmlForm form = postOfficeSqlPage.getFormByName("jms");
+ HtmlTextInput textInput = null;
+
+ try {
+ textInput = (HtmlTextInput) form
+ .getInputByName("postOfficeSqlMap(CREATE_POSTOFFICE_TABLE)");
+ propPresent = true;
+ } catch (ElementNotFoundException e) {
+ propPresent = false;
+ }
+
+ if (propPresent) {
+ textInput = (HtmlTextInput) form
+ .getInputByName("postOfficeSqlMap(INSERT_BINDING)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("postOfficeSqlMap(DELETE_BINDING)");
+ textInput = (HtmlTextInput) form
+ .getInputByName("postOfficeSqlMap(LOAD_BINDINGS)");
+ }
+ }
+
+ /**
+ * Verify the provided page contains the expected input fields of the
+ * connectionFactory's settings page. Note that the value of the input
+ * fields are not checked.
+ *
+ * @param connFactoryPage
+ * The HtmlPage to be verified.
+ * @throws Exception
+ */
+ private void verifyConnFactoryPage(HtmlPage connFactoryPage)
+ throws Exception {
+ /*
+ * Get the jms form and verify the existence of the input fields:
+ */
+ final HtmlForm form = connFactoryPage.getFormByName("jms");
+ final HtmlCheckBoxInput clusered = (HtmlCheckBoxInput) form
+ .getInputByName("clustered");
+ final HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueDownCacheSize");
+ final HtmlTextInput defaultTempQueueFullSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueFullSize");
+ final HtmlTextInput defaultTempQueuePageSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueuePageSize");
+ final HtmlTextInput dupsOKBatchSize = (HtmlTextInput) form
+ .getInputByName("dupsOKBatchSize");
+ final HtmlTextInput prefetchSize = (HtmlTextInput) form
+ .getInputByName("prefetchSize");
+ final List textAreas = form.getTextAreasByName("jndiBindingsText");
+ assertEquals(1, textAreas.size());
+ }
+
+ /**
+ * Verify the provided page contains the expected input fields of the
+ * clustered settings page. Note that the value of the input fields are not
* checked.
*
- * @param jmsPage
+ * @param clusteredPage
* The HtmlPage to be verified.
* @throws Exception
*/
- private void verifyUserSqlPage(HtmlPage stateSqlPage) throws Exception {
+ private void verifyClusteredPage(HtmlPage clusteredPage) throws Exception {
/*
- * Verify the SQL properties for state persistence are present:
+ * Get the jms form and verify the existence of the input fields:
*/
- final HtmlForm form = stateSqlPage.getFormByName("jms");
- final HtmlTextInput createTablesOnStartup = (HtmlTextInput) form
- .getInputByName("stateSqlMap(CREATE_TABLES_ON_STARTUP)");
- final HtmlTextInput createUserTalbe = (HtmlTextInput) form
- .getInputByName("stateSqlMap(CREATE_USER_TABLE)");
- final HtmlTextInput createRoleTable = (HtmlTextInput) form
- .getInputByName("stateSqlMap(CREATE_ROLE_TABLE)");
- final HtmlTextInput createSubscriptionTable = (HtmlTextInput) form
- .getInputByName("stateSqlMap(CREATE_SUBSCRIPTION_TABLE)");
- final HtmlTextInput getSubscription = (HtmlTextInput) form
- .getInputByName("stateSqlMap(GET_SUBSCRIPTION)");
- final HtmlTextInput lockSubscription = (HtmlTextInput) form
- .getInputByName("stateSqlMap(LOCK_SUBSCRIPTION)");
- final HtmlTextInput getSubscriptionsForTopic = (HtmlTextInput) form
- .getInputByName("stateSqlMap(GET_SUBSCRIPTIONS_FOR_TOPIC)");
- final HtmlTextInput insertSubscription = (HtmlTextInput) form
- .getInputByName("stateSqlMap(INSERT_SUBSCRIPTION)");
- final HtmlTextInput updateSubscription = (HtmlTextInput) form
- .getInputByName("stateSqlMap(UPDATE_SUBSCRIPTION)");
- final HtmlTextInput removeSubscription = (HtmlTextInput) form
- .getInputByName("stateSqlMap(REMOVE_SUBSCRIPTION)");
- final HtmlTextInput getUserByClientid = (HtmlTextInput) form
- .getInputByName("stateSqlMap(GET_USER_BY_CLIENTID)");
- final HtmlTextInput getUser = (HtmlTextInput) form
- .getInputByName("stateSqlMap(GET_USER)");
+ final HtmlForm form = clusteredPage.getFormByName("jms");
+ final HtmlTextInput groupName = (HtmlTextInput) form
+ .getInputByName("groupName");
+ final HtmlTextInput stateTimeout = (HtmlTextInput) form
+ .getInputByName("stateTimeout");
+ final HtmlTextInput castTimeout = (HtmlTextInput) form
+ .getInputByName("castTimeout");
+ final HtmlTextInput statsSendPeriod = (HtmlTextInput) form
+ .getInputByName("statsSendPeriod");
+ final HtmlTextInput threadPoolSize = (HtmlTextInput) form
+ .getInputByName("threadPoolSize");
+ final HtmlTextInput messagePullPolicy = (HtmlTextInput) form
+ .getInputByName("messagePullPolicy");
+ final HtmlTextInput clusterRouterFactory = (HtmlTextInput) form
+ .getInputByName("clusterRouterFactory");
+ final HtmlTextInput channelFactoryName = (HtmlTextInput) form
+ .getInputByName("channelFactoryName");
+ final HtmlTextInput channelPartitionName = (HtmlTextInput) form
+ .getInputByName("channelPartitionName");
+ final HtmlTextInput syncChannelName = (HtmlTextInput) form
+ .getInputByName("syncChannelName");
+ final HtmlTextInput asyncChannelName = (HtmlTextInput) form
+ .getInputByName("asyncChannelName");
}
/**
@@ -307,31 +512,47 @@
/*
* Restore the values from the saved form:
*/
- HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueDownCacheSize");
- defaultTempQueueDownCacheSize.setValueAttribute(savedForm
- .getInputByName("defaultTempQueueDownCacheSize").asText());
+ HtmlTextInput defaultDLQName = (HtmlTextInput) form
+ .getInputByName("defaultDLQName");
+ defaultDLQName.setValueAttribute(savedForm.getInputByName(
+ "defaultDLQName").asText());
- HtmlTextInput defaultTempQueueFullSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueFullSize");
- defaultTempQueueFullSize.setValueAttribute(savedForm.getInputByName(
- "defaultTempQueueFullSize").asText());
+ HtmlTextInput defaultExpiryQueueName = (HtmlTextInput) form
+ .getInputByName("defaultExpiryQueueName");
+ defaultExpiryQueueName.setValueAttribute(savedForm.getInputByName(
+ "defaultExpiryQueueName").asText());
- HtmlTextInput defaultTempQueuePageSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueuePageSize");
- defaultTempQueuePageSize.setValueAttribute(savedForm.getInputByName(
- "defaultTempQueuePageSize").asText());
+ HtmlTextInput defaultMaxDeliveryAttempts = (HtmlTextInput) form
+ .getInputByName("defaultMaxDeliveryAttempts");
+ defaultMaxDeliveryAttempts.setValueAttribute(savedForm.getInputByName(
+ "defaultMaxDeliveryAttempts").asText());
- HtmlTextInput prefetchSize = (HtmlTextInput) form
- .getInputByName("prefetchSize");
- prefetchSize.setValueAttribute(savedForm.getInputByName("prefetchSize")
+ HtmlTextInput defaultMessageCounterHistoryDayLimit = (HtmlTextInput) form
+ .getInputByName("defaultMessageCounterHistoryDayLimit");
+ defaultMessageCounterHistoryDayLimit.setValueAttribute(savedForm
+ .getInputByName("defaultMessageCounterHistoryDayLimit")
.asText());
- HtmlTextInput queuedExecutorPoolSize = (HtmlTextInput) form
- .getInputByName("queuedExecutorPoolSize");
- queuedExecutorPoolSize.setValueAttribute(savedForm.getInputByName(
- "queuedExecutorPoolSize").asText());
+ HtmlTextInput defaultRedeliveryDelay = (HtmlTextInput) form
+ .getInputByName("defaultRedeliveryDelay");
+ defaultRedeliveryDelay.setValueAttribute(savedForm.getInputByName(
+ "defaultRedeliveryDelay").asText());
+ HtmlTextInput failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ failoverStartTimeout.setValueAttribute(savedForm.getInputByName(
+ "failoverStartTimeout").asText());
+
+ HtmlTextInput failoverCompleteTimeout = (HtmlTextInput) form
+ .getInputByName("failoverCompleteTimeout");
+ failoverCompleteTimeout.setValueAttribute(savedForm.getInputByName(
+ "failoverCompleteTimeout").asText());
+
+ HtmlTextInput queueStatsSamplePeriod = (HtmlTextInput) form
+ .getInputByName("queueStatsSamplePeriod");
+ queueStatsSamplePeriod.setValueAttribute(savedForm.getInputByName(
+ "queueStatsSamplePeriod").asText());
+
HtmlTextInput securityDomain = (HtmlTextInput) form
.getInputByName("securityDomain");
securityDomain.setValueAttribute(savedForm.getInputByName(
@@ -350,16 +571,41 @@
createMsgTablesOnStartup.setChecked(savedForm.getInputByName(
"createMsgTablesOnStartup").isChecked());
+ HtmlTextInput maxParams = (HtmlTextInput) form
+ .getInputByName("maxParams");
+ maxParams.setValueAttribute(savedForm.getInputByName("maxParams")
+ .asText());
+
HtmlCheckBoxInput usingBatchUpdates = (HtmlCheckBoxInput) form
.getInputByName("usingBatchUpdates");
usingBatchUpdates.setChecked(savedForm.getInputByName(
"usingBatchUpdates").isChecked());
+ HtmlCheckBoxInput usingBinaryStream = (HtmlCheckBoxInput) form
+ .getInputByName("usingBinaryStream");
+ usingBinaryStream.setChecked(savedForm.getInputByName(
+ "usingBinaryStream").isChecked());
+
+ HtmlCheckBoxInput usingTrailingByte = (HtmlCheckBoxInput) form
+ .getInputByName("usingTrailingByte");
+ usingTrailingByte.setChecked(savedForm.getInputByName(
+ "usingTrailingByte").isChecked());
+
HtmlCheckBoxInput createUserTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createUserTablesOnStartup");
createUserTablesOnStartup.setChecked(savedForm.getInputByName(
"createUserTablesOnStartup").isChecked());
+ HtmlCheckBoxInput createPostOfficeTablesOnStartup = (HtmlCheckBoxInput) form
+ .getInputByName("createPostOfficeTablesOnStartup");
+ createPostOfficeTablesOnStartup.setChecked(savedForm.getInputByName(
+ "createPostOfficeTablesOnStartup").isChecked());
+
+ HtmlTextInput postOfficeName = (HtmlTextInput) form
+ .getInputByName("postOfficeName");
+ postOfficeName.setValueAttribute(savedForm.getInputByName(
+ "postOfficeName").asText());
+
/*
* Click the "Save" button to submit the form:
*/
@@ -367,6 +613,144 @@
}
/**
+ * Restore the connectionFactory settings back to the saved values.
+ *
+ * @param connFactoryPage
+ * The current connectionFactory page
+ * @param savedConnFactoryPage
+ * The connectionFactory page the values are to be restored from
+ * @throws Exception
+ */
+ private void restoreConnFactorySettings(HtmlPage connFactoryPage,
+ HtmlPage savedConnFactoryPage) throws Exception {
+ /*
+ * Get the current and saved jms forms:
+ */
+ HtmlForm form = connFactoryPage.getFormByName("jms");
+ HtmlForm savedForm = savedConnFactoryPage.getFormByName("jms");
+
+ /*
+ * Restore the values from the saved form:
+ */
+ HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueDownCacheSize");
+ defaultTempQueueDownCacheSize.setValueAttribute(savedForm
+ .getInputByName("defaultTempQueueDownCacheSize").asText());
+
+ HtmlTextInput defaultTempQueueFullSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueFullSize");
+ defaultTempQueueFullSize.setValueAttribute(savedForm.getInputByName(
+ "defaultTempQueueFullSize").asText());
+
+ HtmlTextInput defaultTempQueuePageSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueuePageSize");
+ defaultTempQueuePageSize.setValueAttribute(savedForm.getInputByName(
+ "defaultTempQueuePageSize").asText());
+
+ HtmlTextInput dupsOKBatchSize = (HtmlTextInput) form
+ .getInputByName("dupsOKBatchSize");
+ dupsOKBatchSize.setValueAttribute(savedForm.getInputByName(
+ "dupsOKBatchSize").asText());
+
+ HtmlTextInput prefetchSize = (HtmlTextInput) form
+ .getInputByName("prefetchSize");
+ prefetchSize.setValueAttribute(savedForm.getInputByName("prefetchSize")
+ .asText());
+
+ List textAreas = form.getTextAreasByName("jndiBindingsText");
+ List savedTextAreas = savedForm.getTextAreasByName("jndiBindingsText");
+ HtmlTextArea jndiBindings = (HtmlTextArea) textAreas.get(0);
+ HtmlTextArea savedJndiBindings = (HtmlTextArea) savedTextAreas.get(0);
+ jndiBindings.setText(savedJndiBindings.getText());
+
+ /*
+ * Click the "Save" button to submit the form:
+ */
+ clickButton(form, SAVE_BUTTON);
+ }
+
+ /**
+ * Restore the clustered settings back to the saved values.
+ *
+ * @param clusteredPage
+ * The current clustered page
+ * @param savedClusteredPage
+ * The clustered page the values are to be restored from
+ * @throws Exception
+ */
+ private void restoreClusteredSettings(HtmlPage clusteredPage,
+ HtmlPage savedClusteredPage) throws Exception {
+ /*
+ * Get the current and saved jms forms:
+ */
+ HtmlForm form = clusteredPage.getFormByName("jms");
+ HtmlForm savedForm = savedClusteredPage.getFormByName("jms");
+
+ /*
+ * Restore the values from the saved form:
+ */
+ HtmlTextInput groupName = (HtmlTextInput) form
+ .getInputByName("groupName");
+ groupName.setValueAttribute(savedForm.getInputByName("groupName")
+ .asText());
+
+ HtmlTextInput stateTimeout = (HtmlTextInput) form
+ .getInputByName("stateTimeout");
+ stateTimeout.setValueAttribute(savedForm
+ .getInputByName("dstateTimeout").asText());
+
+ HtmlTextInput castTimeout = (HtmlTextInput) form
+ .getInputByName("castTimeout");
+ castTimeout.setValueAttribute(savedForm.getInputByName("castTimeout")
+ .asText());
+
+ HtmlTextInput statsSendPeriod = (HtmlTextInput) form
+ .getInputByName("statsSendPeriod");
+ statsSendPeriod.setValueAttribute(savedForm.getInputByName(
+ "statsSendPeriod").asText());
+
+ HtmlTextInput threadPoolSize = (HtmlTextInput) form
+ .getInputByName("threadPoolSize");
+ threadPoolSize.setValueAttribute(savedForm.getInputByName(
+ "threadPoolSize").asText());
+
+ HtmlTextInput messagePullPolicy = (HtmlTextInput) form
+ .getInputByName("messagePullPolicy");
+ messagePullPolicy.setValueAttribute(savedForm.getInputByName(
+ "messagePullPolicy").asText());
+
+ HtmlTextInput clusterRouterFactory = (HtmlTextInput) form
+ .getInputByName("clusterRouterFactory");
+ clusterRouterFactory.setValueAttribute(savedForm.getInputByName(
+ "clusterRouterFactory").asText());
+
+ HtmlTextInput channelFactoryName = (HtmlTextInput) form
+ .getInputByName("channelFactoryName");
+ channelFactoryName.setValueAttribute(savedForm.getInputByName(
+ "channelFactoryName").asText());
+
+ HtmlTextInput channelPartitionName = (HtmlTextInput) form
+ .getInputByName("channelPartitionName");
+ channelPartitionName.setValueAttribute(savedForm.getInputByName(
+ "channelPartitionName").asText());
+
+ HtmlTextInput syncChannelName = (HtmlTextInput) form
+ .getInputByName("syncChannelName");
+ syncChannelName.setValueAttribute(savedForm.getInputByName(
+ "syncChannelName").asText());
+
+ HtmlTextInput asyncChannelName = (HtmlTextInput) form
+ .getInputByName("asyncChannelName");
+ asyncChannelName.setValueAttribute(savedForm.getInputByName(
+ "asyncChannelName").asText());
+
+ /*
+ * Click the "Save" button to submit the form:
+ */
+ clickButton(form, SAVE_BUTTON);
+ }
+
+ /**
* Create a local transactions data source with the specified name,
* connection url, and driver class.
*
@@ -485,7 +869,7 @@
HtmlPage homePage = (HtmlPage) webClient.getPage(adminUrl);
/*
- * Click the "Manage JBossMQ" link and verify the page content:
+ * Click the "Manage JBoss Messaging" link and verify the page content:
*/
HtmlPage jmsPage = clickLink(homePage, HREF_MANAGE_JBOSS_MESSAGING);
verifyJmsSettingsPage(jmsPage);
@@ -519,6 +903,32 @@
*/
HtmlPage userSqlPage = clickLink(jmsPage, HREF_USER_SQL_PAGE);
verifyUserSqlPage(userSqlPage);
+
+ /*
+ * Click the "PostOffice SQL" tab and verify the corrct page was
+ * obtained:
+ */
+ HtmlPage postOfficeSqlPage = clickLink(jmsPage,
+ HREF_POSTOFFICE_SQL_PAGE);
+ verifyPostOfficeSqlPage(postOfficeSqlPage);
+
+ /*
+ * Click the "ConnectionFactory Settings" tab and verify the corrct page
+ * was obtained:
+ */
+ HtmlPage connFactoryPage = clickLink(jmsPage, HREF_CONN_FACTORY_PAGE);
+ verifyConnFactoryPage(connFactoryPage);
+
+ /*
+ * If this is a clustered configuration, click the "Clustered Settings"
+ * tab and verify the corrct page was obtained:
+ */
+ try {
+ HtmlPage clusteredPage = clickLink(jmsPage, HREF_CLUSTERED_PAGE);
+ verifyClusteredPage(clusteredPage);
+ } catch (Exception e) {
+ // "Clustered Settings" tab is not available, just exit.
+ }
}
/**
@@ -550,6 +960,32 @@
*/
HtmlPage userSqlPage = clickLink(morePage, HREF_USER_SQL_PAGE);
verifyUserSqlPage(userSqlPage);
+
+ /*
+ * Click the "PostOffice SQL" tab and verify the corrct page was
+ * obtained:
+ */
+ HtmlPage postOfficeSqlPage = clickLink(morePage,
+ HREF_POSTOFFICE_SQL_PAGE);
+ verifyPostOfficeSqlPage(postOfficeSqlPage);
+
+ /*
+ * Click the "ConnectionFactory Settings" tab and verify the corrct page
+ * was obtained:
+ */
+ HtmlPage connFactoryPage = clickLink(morePage, HREF_CONN_FACTORY_PAGE);
+ verifyConnFactoryPage(connFactoryPage);
+
+ /*
+ * If this is a clustered configuration, click the "Clustered Settings"
+ * tab and verify the corrct page was obtained:
+ */
+ try {
+ HtmlPage clusteredPage = clickLink(morePage, HREF_CLUSTERED_PAGE);
+ verifyClusteredPage(clusteredPage);
+ } catch (Exception e) {
+ // "Clustered Settings" tab is not available, just exit.
+ }
}
/**
@@ -581,6 +1017,32 @@
*/
HtmlPage userSqlPage = clickLink(msgSqlPage, HREF_USER_SQL_PAGE);
verifyUserSqlPage(userSqlPage);
+
+ /*
+ * Click the "PostOffice SQL" tab and verify the corrct page was
+ * obtained:
+ */
+ HtmlPage postOfficeSqlPage = clickLink(msgSqlPage,
+ HREF_POSTOFFICE_SQL_PAGE);
+ verifyPostOfficeSqlPage(postOfficeSqlPage);
+
+ /*
+ * Click the "ConnectionFactory Settings" tab and verify the corrct page
+ * was obtained:
+ */
+ HtmlPage connFactoryPage = clickLink(msgSqlPage, HREF_CONN_FACTORY_PAGE);
+ verifyConnFactoryPage(connFactoryPage);
+
+ /*
+ * If this is a clustered configuration, click the "Clustered Settings"
+ * tab and verify the corrct page was obtained:
+ */
+ try {
+ HtmlPage clusteredPage = clickLink(msgSqlPage, HREF_CLUSTERED_PAGE);
+ verifyClusteredPage(clusteredPage);
+ } catch (Exception e) {
+ // "Clustered Settings" tab is not available, just exit.
+ }
}
/**
@@ -590,7 +1052,7 @@
*/
public void testClickTabsFromUserSqlPage() throws Exception {
/*
- * Get the "State SQL" page:
+ * Get the "User SQL" page:
*/
HtmlPage jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
HtmlPage userSqlPage = clickLink(jmsPage, HREF_USER_SQL_PAGE);
@@ -612,9 +1074,210 @@
*/
HtmlPage msgSqlPage = clickLink(userSqlPage, HREF_MSG_SQL_PAGE);
verifyMessageSqlPage(msgSqlPage);
+
+ /*
+ * Click the "PostOffice SQL" tab and verify the corrct page was
+ * obtained:
+ */
+ HtmlPage postOfficeSqlPage = clickLink(userSqlPage,
+ HREF_POSTOFFICE_SQL_PAGE);
+ verifyPostOfficeSqlPage(postOfficeSqlPage);
+
+ /*
+ * Click the "ConnectionFactory Settings" tab and verify the corrct page
+ * was obtained:
+ */
+ HtmlPage connFactoryPage = clickLink(userSqlPage,
+ HREF_CONN_FACTORY_PAGE);
+ verifyConnFactoryPage(connFactoryPage);
+
+ /*
+ * If this is a clustered configuration, click the "Clustered Settings"
+ * tab and verify the corrct page was obtained:
+ */
+ try {
+ HtmlPage clusteredPage = clickLink(userSqlPage, HREF_CLUSTERED_PAGE);
+ verifyClusteredPage(clusteredPage);
+ } catch (Exception e) {
+ // "Clustered Settings" tab is not available, just exit.
+ }
}
/**
+ * Test the action to click various tabs from the jms "PostOffice SQL" page.
+ *
+ * @throws Exception
+ */
+ public void testClickTabsFromPostOfficeSqlPage() throws Exception {
+ /*
+ * Get the "PostOffice SQL" page:
+ */
+ HtmlPage jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
+ HtmlPage postOfficeSqlPage = clickLink(jmsPage,
+ HREF_POSTOFFICE_SQL_PAGE);
+
+ /*
+ * Click the "Settings" tab and verify the page:
+ */
+ HtmlPage settingsPage = clickLink(postOfficeSqlPage, HREF_SETTINGS_PAGE);
+ verifyJmsSettingsPage(settingsPage);
+
+ /*
+ * Click the "More" tab and verify the page:
+ */
+ HtmlPage morePage = clickLink(postOfficeSqlPage, HREF_MORE_PAGE);
+ verifyMorePage(morePage);
+
+ /*
+ * Click the "Message SQL" tab and verify the page:
+ */
+ HtmlPage msgSqlPage = clickLink(postOfficeSqlPage, HREF_MSG_SQL_PAGE);
+ verifyMessageSqlPage(msgSqlPage);
+
+ /*
+ * Click the "User SQL" tab and verify the corrct page was obtained:
+ */
+ HtmlPage userSqlPage = clickLink(postOfficeSqlPage, HREF_USER_SQL_PAGE);
+ verifyUserSqlPage(userSqlPage);
+
+ /*
+ * Click the "ConnectionFactory Settings" tab and verify the corrct page
+ * was obtained:
+ */
+ HtmlPage connFactoryPage = clickLink(postOfficeSqlPage,
+ HREF_CONN_FACTORY_PAGE);
+ verifyConnFactoryPage(connFactoryPage);
+
+ /*
+ * If this is a clustered configuration, click the "Clustered Settings"
+ * tab and verify the corrct page was obtained:
+ */
+ try {
+ HtmlPage clusteredPage = clickLink(postOfficeSqlPage,
+ HREF_CLUSTERED_PAGE);
+ verifyClusteredPage(clusteredPage);
+ } catch (Exception e) {
+ // "Clustered Settings" tab is not available, just exit.
+ }
+ }
+
+ /**
+ * Test the action to click various tabs from the jms "ConnectionFactory
+ * Settings" page.
+ *
+ * @throws Exception
+ */
+ public void testClickTabsFromConnFactoryPage() throws Exception {
+ /*
+ * Get the "ConnectionFactory Settings" page:
+ */
+ HtmlPage jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
+ HtmlPage connFactoryPage = clickLink(jmsPage, HREF_CONN_FACTORY_PAGE);
+
+ /*
+ * Click the "Settings" tab and verify the page:
+ */
+ HtmlPage settingsPage = clickLink(connFactoryPage, HREF_SETTINGS_PAGE);
+ verifyJmsSettingsPage(settingsPage);
+
+ /*
+ * Click the "More" tab and verify the page:
+ */
+ HtmlPage morePage = clickLink(connFactoryPage, HREF_MORE_PAGE);
+ verifyMorePage(morePage);
+
+ /*
+ * Click the "Message SQL" tab and verify the page:
+ */
+ HtmlPage msgSqlPage = clickLink(connFactoryPage, HREF_MSG_SQL_PAGE);
+ verifyMessageSqlPage(msgSqlPage);
+
+ /*
+ * Click the "User SQL" tab and verify the corrct page was obtained:
+ */
+ HtmlPage userSqlPage = clickLink(connFactoryPage, HREF_USER_SQL_PAGE);
+ verifyUserSqlPage(userSqlPage);
+
+ /*
+ * Click the "PostOffice SQL" tab and verify the corrct page was
+ * obtained:
+ */
+ HtmlPage postOfficeSqlPage = clickLink(connFactoryPage,
+ HREF_POSTOFFICE_SQL_PAGE);
+ verifyPostOfficeSqlPage(postOfficeSqlPage);
+
+ /*
+ * If this is a clustered configuration, click the "Clustered Settings"
+ * tab and verify the corrct page was obtained:
+ */
+ try {
+ HtmlPage clusteredPage = clickLink(connFactoryPage,
+ HREF_CLUSTERED_PAGE);
+ verifyClusteredPage(clusteredPage);
+ } catch (Exception e) {
+ // "Clustered Settings" tab is not available, just exit.
+ }
+ }
+
+ /**
+ * Test the action to click various tabs from the jms "Clustered Settings"
+ * page.
+ *
+ * @throws Exception
+ */
+ public void testClickTabsFromClusteredPage() throws Exception {
+ try {
+ /*
+ * Get the "Clustered Settings" page, if available:
+ */
+ HtmlPage jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
+ HtmlPage clusteredPage = clickLink(jmsPage, HREF_CLUSTERED_PAGE);
+
+ /*
+ * Click the "Settings" tab and verify the page:
+ */
+ HtmlPage settingsPage = clickLink(clusteredPage, HREF_SETTINGS_PAGE);
+ verifyJmsSettingsPage(settingsPage);
+
+ /*
+ * Click the "More" tab and verify the page:
+ */
+ HtmlPage morePage = clickLink(clusteredPage, HREF_MORE_PAGE);
+ verifyMorePage(morePage);
+
+ /*
+ * Click the "Message SQL" tab and verify the page:
+ */
+ HtmlPage msgSqlPage = clickLink(clusteredPage, HREF_MSG_SQL_PAGE);
+ verifyMessageSqlPage(msgSqlPage);
+
+ /*
+ * Click the "User SQL" tab and verify the page:
+ */
+ HtmlPage userSqlPage = clickLink(clusteredPage, HREF_USER_SQL_PAGE);
+ verifyUserSqlPage(userSqlPage);
+
+ /*
+ * Click the "PostOffice SQL" tab and verify the corrct page was
+ * obtained:
+ */
+ HtmlPage postOfficeSqlPage = clickLink(clusteredPage,
+ HREF_POSTOFFICE_SQL_PAGE);
+ verifyPostOfficeSqlPage(postOfficeSqlPage);
+
+ /*
+ * Click the "ConnectionFactory Settings" tab and verify the corrct
+ * page was obtained:
+ */
+ HtmlPage connFactoryPage = clickLink(jmsPage,
+ HREF_CONN_FACTORY_PAGE);
+ verifyConnFactoryPage(connFactoryPage);
+ } catch (Exception e) {
+ // "Clustered Settings" page is not available, just exit.
+ }
+ }
+
+ /**
* Test the action to update the jms attributes with invalid type of data.
*
* @throws Exception
@@ -630,6 +1293,50 @@
* Assign invalid type of data to the attributes:
*/
String badData = "badData";
+ HtmlTextInput defaultMaxDeliveryAttempts = (HtmlTextInput) form
+ .getInputByName("defaultMaxDeliveryAttempts");
+ defaultMaxDeliveryAttempts.setValueAttribute(badData);
+
+ HtmlTextInput defaultRedeliveryDelay = (HtmlTextInput) form
+ .getInputByName("defaultRedeliveryDelay");
+ defaultRedeliveryDelay.setValueAttribute(badData);
+
+ HtmlTextInput queueStatsSamplePeriod = (HtmlTextInput) form
+ .getInputByName("queueStatsSamplePeriod");
+ queueStatsSamplePeriod.setValueAttribute(badData);
+
+ HtmlTextInput failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ failoverStartTimeout.setValueAttribute(badData);
+
+ HtmlTextInput failoverCompleteTimeout = (HtmlTextInput) form
+ .getInputByName("failoverCompleteTimeout");
+ failoverCompleteTimeout.setValueAttribute(badData);
+
+ HtmlTextInput defaultMessageCounterHistoryDayLimit = (HtmlTextInput) form
+ .getInputByName("defaultMessageCounterHistoryDayLimit");
+ defaultMessageCounterHistoryDayLimit.setValueAttribute(badData);
+
+ HtmlTextInput maxParams = (HtmlTextInput) form
+ .getInputByName("maxParams");
+ maxParams.setValueAttribute(badData);
+
+ HtmlTextInput stateTimeout = (HtmlTextInput) form
+ .getInputByName("stateTimeout");
+ stateTimeout.setValueAttribute(badData);
+
+ HtmlTextInput castTimeout = (HtmlTextInput) form
+ .getInputByName("castTimeout");
+ castTimeout.setValueAttribute(badData);
+
+ HtmlTextInput statsSendPeriod = (HtmlTextInput) form
+ .getInputByName("statsSendPeriod");
+ statsSendPeriod.setValueAttribute(badData);
+
+ HtmlTextInput threadPoolSize = (HtmlTextInput) form
+ .getInputByName("threadPoolSize");
+ threadPoolSize.setValueAttribute(badData);
+
HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
.getInputByName("defaultTempQueueDownCacheSize");
defaultTempQueueDownCacheSize.setValueAttribute(badData);
@@ -642,14 +1349,14 @@
.getInputByName("defaultTempQueuePageSize");
defaultTempQueuePageSize.setValueAttribute(badData);
+ HtmlTextInput dupsOKBatchSize = (HtmlTextInput) form
+ .getInputByName("dupsOKBatchSize");
+ dupsOKBatchSize.setValueAttribute(badData);
+
HtmlTextInput prefetchSize = (HtmlTextInput) form
.getInputByName("prefetchSize");
prefetchSize.setValueAttribute(badData);
- HtmlTextInput queuedExecutorPoolSize = (HtmlTextInput) form
- .getInputByName("queuedExecutorPoolSize");
- queuedExecutorPoolSize.setValueAttribute(badData);
-
/*
* Click the "Save" button and verify the error messages were returned
* correctly:
@@ -658,24 +1365,74 @@
String jmsPageText = jmsPage.asText();
String expectedMsg = msgProps
+ .getProperty("jms.view.defaultMaxDeliveryAttempts")
+ + MUST_BE_INTEGER;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.defaultRedeliveryDelay")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.queueStatsSamplePeriod")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.failoverStartTimeout")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.failoverCompleteTimeout")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps
+ .getProperty("jms.view.defaultMessageCounterHistoryDayLimit")
+ + MUST_BE_INTEGER;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.maxParams")
+ + MUST_BE_INTEGER;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.stateTimeout")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.stateTimeout")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.castTimeout")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.statsSendPeriod")
+ + MUST_BE_LONG;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps.getProperty("jms.view.threadPoolSize")
+ + MUST_BE_INTEGER;
+ assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
+
+ expectedMsg = msgProps
.getProperty("jms.view.defaultTempQueueDownCacheSize")
- + " must be an integer";
+ + MUST_BE_INTEGER;
assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
expectedMsg = msgProps.getProperty("jms.view.defaultTempQueueFullSize")
- + " must be an integer";
+ + MUST_BE_INTEGER;
assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
expectedMsg = msgProps.getProperty("jms.view.defaultTempQueuePageSize")
- + " must be an integer";
+ + MUST_BE_INTEGER;
assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
- expectedMsg = msgProps.getProperty("jms.view.prefetchSize")
- + " must be an integer";
+ expectedMsg = msgProps.getProperty("jms.view.dupsOKBatchSize")
+ + MUST_BE_INTEGER;
assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
- expectedMsg = msgProps.getProperty("jms.view.queuedExecutorPoolSize")
- + " must be an integer";
+ expectedMsg = msgProps.getProperty("jms.view.prefetchSize")
+ + MUST_BE_INTEGER;
assertTrue(EXP_MSG_NOT_FOUND, findMessage(jmsPageText, expectedMsg));
}
@@ -694,22 +1451,21 @@
/*
* Change the values of some attributes:
*/
- HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueDownCacheSize");
- String savedDefaultTempQueueDownCacheSize = defaultTempQueueDownCacheSize
+ HtmlTextInput defaultMessageCounterHistoryDayLimit = (HtmlTextInput) form
+ .getInputByName("defaultMessageCounterHistoryDayLimit");
+ String savedDefaultMessageCounterHistoryDayLimit = defaultMessageCounterHistoryDayLimit
.asText();
- defaultTempQueueDownCacheSize.setValueAttribute("1000");
+ defaultMessageCounterHistoryDayLimit.setValueAttribute("10");
- HtmlTextInput defaultTempQueueFullSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueFullSize");
- String savedDefaultTempQueueFullSize = defaultTempQueueFullSize
- .asText();
- defaultTempQueueFullSize.setValueAttribute("50000");
+ HtmlTextInput failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ String savedFailoverStartTimeout = failoverStartTimeout.asText();
+ failoverStartTimeout.setValueAttribute("50000");
- HtmlTextInput prefetchSize = (HtmlTextInput) form
- .getInputByName("prefetchSize");
- String savedPrefetchSize = prefetchSize.asText();
- prefetchSize.setValueAttribute("100");
+ HtmlTextInput queueStatsSamplePeriod = (HtmlTextInput) form
+ .getInputByName("queueStatsSamplePeriod");
+ String savedQueueStatsSamplePeriod = queueStatsSamplePeriod.asText();
+ queueStatsSamplePeriod.setValueAttribute("8000");
/*
* Click the "Cancel" button and make sure the previous settings were
@@ -718,18 +1474,19 @@
jmsPage = clickButton(form, CANCEL_BUTTON);
form = jmsPage.getFormByName("jms");
- defaultTempQueueDownCacheSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueDownCacheSize");
- assertEquals(savedDefaultTempQueueDownCacheSize,
- defaultTempQueueDownCacheSize.asText());
+ defaultMessageCounterHistoryDayLimit = (HtmlTextInput) form
+ .getInputByName("defaultMessageCounterHistoryDayLimit");
+ assertEquals(savedDefaultMessageCounterHistoryDayLimit,
+ defaultMessageCounterHistoryDayLimit.asText());
- defaultTempQueueFullSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueFullSize");
- assertEquals(savedDefaultTempQueueFullSize, defaultTempQueueFullSize
+ failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ assertEquals(savedFailoverStartTimeout, failoverStartTimeout.asText());
+
+ queueStatsSamplePeriod = (HtmlTextInput) form
+ .getInputByName("queueStatsSamplePeriod");
+ assertEquals(savedQueueStatsSamplePeriod, queueStatsSamplePeriod
.asText());
-
- prefetchSize = (HtmlTextInput) form.getInputByName("prefetchSize");
- assertEquals(savedPrefetchSize, prefetchSize.asText());
}
/**
@@ -739,7 +1496,7 @@
*
* @throws Exception
*/
- public void testUpdateJmsAttributesOnSettingsPage() throws Exception {
+ public void testUpdateAttributesOnSettingsPage() throws Exception {
/*
* Get the jms page & form and save a copy of the settings:
*/
@@ -750,26 +1507,38 @@
/*
* Assign new values to the attributes:
*/
- HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueDownCacheSize");
- defaultTempQueueDownCacheSize.setValueAttribute("1000");
+ HtmlTextInput defaultDLQName = (HtmlTextInput) form
+ .getInputByName("defaultDLQName");
+ defaultDLQName.setValueAttribute("newDLQName");
- HtmlTextInput defaultTempQueueFullSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueFullSize");
- defaultTempQueueFullSize.setValueAttribute("50000");
+ HtmlTextInput defaultExpiryQueueName = (HtmlTextInput) form
+ .getInputByName("defaultExpiryQueueName");
+ defaultExpiryQueueName.setValueAttribute("newExpiryQueueName");
- HtmlTextInput defaultTempQueuePageSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueuePageSize");
- defaultTempQueuePageSize.setValueAttribute("1000");
+ HtmlTextInput defaultMaxDeliveryAttempts = (HtmlTextInput) form
+ .getInputByName("defaultMaxDeliveryAttempts");
+ defaultMaxDeliveryAttempts.setValueAttribute("15");
- HtmlTextInput prefetchSize = (HtmlTextInput) form
- .getInputByName("prefetchSize");
- prefetchSize.setValueAttribute("80");
+ HtmlTextInput defaultMessageCounterHistoryDayLimit = (HtmlTextInput) form
+ .getInputByName("defaultMessageCounterHistoryDayLimit");
+ defaultMessageCounterHistoryDayLimit.setValueAttribute("10");
- HtmlTextInput queuedExecutorPoolSize = (HtmlTextInput) form
- .getInputByName("queuedExecutorPoolSize");
- queuedExecutorPoolSize.setValueAttribute("100");
+ HtmlTextInput defaultRedeliveryDelay = (HtmlTextInput) form
+ .getInputByName("defaultRedeliveryDelay");
+ defaultRedeliveryDelay.setValueAttribute("5000");
+ HtmlTextInput failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ failoverStartTimeout.setValueAttribute("50000");
+
+ HtmlTextInput failoverCompleteTimeout = (HtmlTextInput) form
+ .getInputByName("failoverCompleteTimeout");
+ failoverCompleteTimeout.setValueAttribute("500000");
+
+ HtmlTextInput queueStatsSamplePeriod = (HtmlTextInput) form
+ .getInputByName("queueStatsSamplePeriod");
+ queueStatsSamplePeriod.setValueAttribute("8000");
+
HtmlTextInput securityDomain = (HtmlTextInput) form
.getInputByName("securityDomain");
securityDomain.setValueAttribute("java:/jaas/rmi-ssl");
@@ -784,14 +1553,34 @@
.getInputByName("createMsgTablesOnStartup");
createMsgTablesOnStartup.setChecked(false);
+ HtmlTextInput maxParams = (HtmlTextInput) form
+ .getInputByName("maxParams");
+ maxParams.setValueAttribute("200");
+
HtmlCheckBoxInput usingBatchUpdates = (HtmlCheckBoxInput) form
.getInputByName("usingBatchUpdates");
- usingBatchUpdates.setChecked(true);
+ usingBatchUpdates.setChecked(false);
+ HtmlCheckBoxInput usingBinaryStream = (HtmlCheckBoxInput) form
+ .getInputByName("usingBinaryStream");
+ usingBinaryStream.setChecked(false);
+
+ HtmlCheckBoxInput usingTrailingByte = (HtmlCheckBoxInput) form
+ .getInputByName("usingTrailingByte");
+ usingTrailingByte.setChecked(true);
+
HtmlCheckBoxInput createUserTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createUserTablesOnStartup");
createUserTablesOnStartup.setChecked(true);
+ HtmlCheckBoxInput createPostOfficeTablesOnStartup = (HtmlCheckBoxInput) form
+ .getInputByName("createPostOfficeTablesOnStartup");
+ createPostOfficeTablesOnStartup.setChecked(false);
+
+ HtmlTextInput postOfficeName = (HtmlTextInput) form
+ .getInputByName("postOfficeName");
+ postOfficeName.setValueAttribute("New PostOffice Name");
+
/*
* Click the "Save" button to submit the changes:
*/
@@ -804,25 +1593,38 @@
Thread.sleep(hotDeployWaitTime * 2);
jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
form = jmsPage.getFormByName("jms");
- defaultTempQueueDownCacheSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueDownCacheSize");
- assertEquals("1000", defaultTempQueueDownCacheSize.asText());
- defaultTempQueueFullSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueueFullSize");
- assertEquals("50000", defaultTempQueueFullSize.asText());
+ defaultDLQName = (HtmlTextInput) form.getInputByName("defaultDLQName");
+ assertEquals("newDLQName", defaultDLQName.asText());
- defaultTempQueuePageSize = (HtmlTextInput) form
- .getInputByName("defaultTempQueuePageSize");
- assertEquals("1000", defaultTempQueuePageSize.asText());
+ defaultExpiryQueueName = (HtmlTextInput) form
+ .getInputByName("defaultExpiryQueueName");
+ assertEquals("newExpiryQueueName", defaultExpiryQueueName.asText());
- prefetchSize = (HtmlTextInput) form.getInputByName("prefetchSize");
- assertEquals("80", prefetchSize.asText());
+ defaultMaxDeliveryAttempts = (HtmlTextInput) form
+ .getInputByName("defaultMaxDeliveryAttempts");
+ assertEquals("15", defaultMaxDeliveryAttempts.asText());
- queuedExecutorPoolSize = (HtmlTextInput) form
- .getInputByName("queuedExecutorPoolSize");
- assertEquals("100", queuedExecutorPoolSize.asText());
+ defaultMessageCounterHistoryDayLimit = (HtmlTextInput) form
+ .getInputByName("defaultMessageCounterHistoryDayLimit");
+ assertEquals("10", defaultMessageCounterHistoryDayLimit.asText());
+ defaultRedeliveryDelay = (HtmlTextInput) form
+ .getInputByName("defaultRedeliveryDelay");
+ assertEquals("5000", defaultRedeliveryDelay.asText());
+
+ failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ assertEquals("50000", failoverStartTimeout.asText());
+
+ failoverCompleteTimeout = (HtmlTextInput) form
+ .getInputByName("failoverCompleteTimeout");
+ assertEquals("500000", failoverCompleteTimeout.asText());
+
+ queueStatsSamplePeriod = (HtmlTextInput) form
+ .getInputByName("queueStatsSamplePeriod");
+ assertEquals("8000", queueStatsSamplePeriod.asText());
+
securityDomain = (HtmlTextInput) form.getInputByName("securityDomain");
assertEquals("java:/jaas/rmi-ssl", securityDomain.asText());
@@ -836,16 +1638,34 @@
createMsgTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createMsgTablesOnStartup");
- assertFalse(ITEM_NOT_CHECKED, createMsgTablesOnStartup.isChecked());
+ assertFalse(ITEM_CHECKED, createMsgTablesOnStartup.isChecked());
+ maxParams = (HtmlTextInput) form.getInputByName("maxParams");
+ assertEquals("200", maxParams.asText());
+
usingBatchUpdates = (HtmlCheckBoxInput) form
.getInputByName("usingBatchUpdates");
- assertTrue(ITEM_CHECKED, usingBatchUpdates.isChecked());
+ assertFalse(ITEM_CHECKED, usingBatchUpdates.isChecked());
+ usingBinaryStream = (HtmlCheckBoxInput) form
+ .getInputByName("usingBinaryStream");
+ assertFalse(ITEM_CHECKED, usingBinaryStream.isChecked());
+
+ usingTrailingByte = (HtmlCheckBoxInput) form
+ .getInputByName("usingTrailingByte");
+ assertTrue(ITEM_NOT_CHECKED, usingTrailingByte.isChecked());
+
createUserTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createUserTablesOnStartup");
assertTrue(ITEM_NOT_CHECKED, createUserTablesOnStartup.isChecked());
+ createPostOfficeTablesOnStartup = (HtmlCheckBoxInput) form
+ .getInputByName("createPostOfficeTablesOnStartup");
+ assertFalse(ITEM_CHECKED, createPostOfficeTablesOnStartup.isChecked());
+
+ postOfficeName = (HtmlTextInput) form.getInputByName("postOfficeName");
+ assertEquals("New PostOffice Name", postOfficeName.asText());
+
/*
* Restore the previous settings:
*/
@@ -859,13 +1679,262 @@
}
/**
+ * Test the action to update the jms attributes on the "ConnectionFactory"
+ * page. All attributes on the page are modified and verified.
+ *
+ * @throws Exception
+ */
+ public void testUpdateAttributesOnConnFactoryPage() throws Exception {
+ /*
+ * Get to the "ConnectionFactory" page and save a copy of the settings:
+ */
+ HtmlPage jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
+ HtmlPage connFactoryPage = clickLink(jmsPage, HREF_CONN_FACTORY_PAGE);
+ HtmlPage savedConnFactoryPage = clickLink(jmsPage,
+ HREF_CONN_FACTORY_PAGE);
+ HtmlForm form = connFactoryPage.getFormByName("jms");
+
+ /*
+ * Assign new values to the attributes:
+ */
+ HtmlCheckBoxInput clustered = (HtmlCheckBoxInput) form
+ .getInputByName("clustered");
+ clustered.setChecked(false);
+
+ HtmlTextInput defaultTempQueueDownCacheSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueDownCacheSize");
+ defaultTempQueueDownCacheSize.setValueAttribute("1000");
+
+ HtmlTextInput defaultTempQueueFullSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueFullSize");
+ defaultTempQueueFullSize.setValueAttribute("50000");
+
+ HtmlTextInput defaultTempQueuePageSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueuePageSize");
+ defaultTempQueuePageSize.setValueAttribute("1000");
+
+ HtmlTextInput dupsOKBatchSize = (HtmlTextInput) form
+ .getInputByName("dupsOKBatchSize");
+ dupsOKBatchSize.setValueAttribute("2000");
+
+ HtmlTextInput prefetchSize = (HtmlTextInput) form
+ .getInputByName("prefetchSize");
+ prefetchSize.setValueAttribute("80");
+
+ List textAreas = form.getTextAreasByName("jndiBindingsText");
+ HtmlTextArea jndiBindings = (HtmlTextArea) textAreas.get(0);
+ String binding1 = "/NewConnectionFactory";
+ String binding2 = "java:/NewConnectionFactory";
+ jndiBindings.setText(binding1 + NL + binding2);
+
+ /*
+ * Return to the "Settings" tab and save the changes:
+ */
+ jmsPage = clickLink(connFactoryPage, HREF_SETTINGS_PAGE);
+ form = jmsPage.getFormByName("jms");
+ clickButton(form, SAVE_BUTTON);
+
+ /*
+ * Sleep for a few seconds then get the ConnectionFactory page again and
+ * verify the changes:
+ */
+ Thread.sleep(hotDeployWaitTime * 2);
+ jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
+ connFactoryPage = clickLink(jmsPage, HREF_CONN_FACTORY_PAGE);
+ form = connFactoryPage.getFormByName("jms");
+
+ defaultTempQueueDownCacheSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueDownCacheSize");
+ assertEquals("1000", defaultTempQueueDownCacheSize.asText());
+
+ defaultTempQueueFullSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueueFullSize");
+ assertEquals("50000", defaultTempQueueFullSize.asText());
+
+ defaultTempQueuePageSize = (HtmlTextInput) form
+ .getInputByName("defaultTempQueuePageSize");
+ assertEquals("1000", defaultTempQueuePageSize.asText());
+
+ dupsOKBatchSize = (HtmlTextInput) form
+ .getInputByName("dupsOKBatchSize");
+ assertEquals("2000", dupsOKBatchSize.asText());
+
+ prefetchSize = (HtmlTextInput) form.getInputByName("prefetchSize");
+ assertEquals("80", prefetchSize.asText());
+
+ textAreas = form.getTextAreasByName("jndiBindingsText");
+ jndiBindings = (HtmlTextArea) textAreas.get(0);
+ assertEquals("2", jndiBindings.getRowsAttribute());
+ // HtmlTextArea.getText() converts "\r\n" to "\n" so the expected
+ // string must be build accordingly.
+ assertEquals(binding1 + "\n" + binding2, jndiBindings.getText().trim());
+
+ /*
+ * Restore the previous settings:
+ */
+ restoreConnFactorySettings(connFactoryPage, savedConnFactoryPage);
+
+ /*
+ * Sleep for a few seconds for the changes to take effect before
+ * starting the next test:
+ */
+ Thread.sleep(hotDeployWaitTime * 2);
+ }
+
+ /**
+ * If the "Clustered" page is present, test the action to update the
+ * attributes on this page.
+ *
+ * @throws Exception
+ */
+ public void testUpdateAttributesOnClusteredPage() throws Exception {
+ boolean clusteredPagePresent = false;
+ HtmlPage clusteredPage = null;
+ HtmlPage savedClusteredPage = null;
+
+ /*
+ * Check if the "Clustered" page is present. If yes, Get the page and
+ * save a copy of the settings:
+ */
+ HtmlPage jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
+ try {
+ clusteredPage = clickLink(jmsPage, HREF_CLUSTERED_PAGE);
+ savedClusteredPage = clickLink(jmsPage, HREF_CLUSTERED_PAGE);
+ clusteredPagePresent = true;
+ } catch (Exception e) {
+ clusteredPagePresent = false;
+ }
+
+ if (clusteredPagePresent) {
+ /*
+ * Assign new values to the attributes:
+ */
+ HtmlForm form = clusteredPage.getFormByName("jms");
+
+ HtmlTextInput groupName = (HtmlTextInput) form
+ .getInputByName("groupName");
+ groupName.setValueAttribute("NewGroupName");
+
+ HtmlTextInput stateTimeout = (HtmlTextInput) form
+ .getInputByName("stateTimeout");
+ stateTimeout.setValueAttribute("2000");
+
+ HtmlTextInput castTimeout = (HtmlTextInput) form
+ .getInputByName("castTimeout");
+ castTimeout.setValueAttribute("2000");
+
+ HtmlTextInput statsSendPeriod = (HtmlTextInput) form
+ .getInputByName("statsSendPeriod");
+ statsSendPeriod.setValueAttribute("20000");
+
+ HtmlTextInput threadPoolSize = (HtmlTextInput) form
+ .getInputByName("threadPoolSize");
+ threadPoolSize.setValueAttribute("80");
+
+ HtmlTextInput messagePullPolicy = (HtmlTextInput) form
+ .getInputByName("messagePullPolicy");
+ messagePullPolicy.setValueAttribute("NewMessagePullPolicy");
+
+ HtmlTextInput clusterRouterFactory = (HtmlTextInput) form
+ .getInputByName("clusterRouterFactory");
+ clusterRouterFactory.setValueAttribute("NewClusteredRouterFactory");
+
+ HtmlTextInput channelFactoryName = (HtmlTextInput) form
+ .getInputByName("channelFactoryName");
+ channelFactoryName.setValueAttribute("NewChannelFactoryName");
+
+ HtmlTextInput channelPartitionName = (HtmlTextInput) form
+ .getInputByName("channelPartitionName");
+ channelPartitionName.setValueAttribute("NewChannelPartitionName");
+
+ HtmlTextInput syncChannelName = (HtmlTextInput) form
+ .getInputByName("syncChannelName");
+ syncChannelName.setValueAttribute("new-udp-sync");
+
+ HtmlTextInput asyncChannelName = (HtmlTextInput) form
+ .getInputByName("asyncChannelName");
+ asyncChannelName.setValueAttribute("new-udp");
+
+ /*
+ * Return to the "Settings" tab and save the changes:
+ */
+ jmsPage = clickLink(clusteredPage, HREF_SETTINGS_PAGE);
+ form = jmsPage.getFormByName("jms");
+ clickButton(form, SAVE_BUTTON);
+
+ /*
+ * Sleep for a few seconds then get the Clustered page again and
+ * verify the changes:
+ */
+ Thread.sleep(hotDeployWaitTime * 2);
+ jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
+ clusteredPage = clickLink(jmsPage, HREF_CLUSTERED_PAGE);
+ form = clusteredPage.getFormByName("jms");
+
+ groupName = (HtmlTextInput) form.getInputByName("groupName");
+ assertEquals("NewGroupName", groupName.asText());
+
+ stateTimeout = (HtmlTextInput) form.getInputByName("stateTimeout");
+ assertEquals("2000", stateTimeout.asText());
+
+ castTimeout = (HtmlTextInput) form.getInputByName("castTimeout");
+ assertEquals("2000", castTimeout.asText());
+
+ statsSendPeriod = (HtmlTextInput) form
+ .getInputByName("statsSendPeriod");
+ assertEquals("20000", statsSendPeriod.asText());
+
+ threadPoolSize = (HtmlTextInput) form
+ .getInputByName("threadPoolSize");
+ assertEquals("80", threadPoolSize.asText());
+
+ messagePullPolicy = (HtmlTextInput) form
+ .getInputByName("messagePullPolicy");
+ assertEquals("NewMessagePullPolicy", messagePullPolicy.asText());
+
+ clusterRouterFactory = (HtmlTextInput) form
+ .getInputByName("clusterRouterFactory");
+ assertEquals("NewClusterRouterFactory", clusterRouterFactory
+ .asText());
+
+ channelFactoryName = (HtmlTextInput) form
+ .getInputByName("channelFactoryName");
+ assertEquals("NewChannelFactoryName", channelFactoryName.asText());
+
+ channelPartitionName = (HtmlTextInput) form
+ .getInputByName("channelPartitionName");
+ assertEquals("NewChannelPartitionName", channelPartitionName
+ .asText());
+
+ syncChannelName = (HtmlTextInput) form
+ .getInputByName("syncChannelName");
+ assertEquals("new-udp-sync", syncChannelName.asText());
+
+ asyncChannelName = (HtmlTextInput) form
+ .getInputByName("asyncChannelName");
+ assertEquals("new-udp", asyncChannelName.asText());
+
+ /*
+ * Restore the previous settings:
+ */
+ restoreClusteredSettings(clusteredPage, savedClusteredPage);
+
+ /*
+ * Sleep for a few seconds for the changes to take effect before
+ * starting the next test:
+ */
+ Thread.sleep(hotDeployWaitTime * 2);
+ }
+ }
+
+ /**
* Test the action to update the jms attributes on "Settings", "Message
- * SQL", and "User SQL" pages. Only selected attributes on each page are
- * updated.
+ * SQL", "User SQL", and "PostOffice SQL" pages. Only selected attributes on
+ * each page are updated.
*
* @throws Exception
*/
- public void testUpdateJmsAttributesOnMultiplePages() throws Exception {
+ public void testUpdateAttributesOnMultiplePages() throws Exception {
/*
* Get the jms page & form:
*/
@@ -876,10 +1945,14 @@
* Change some attribute values on the "Settings" page, make sure all
* check boxes are checked:
*/
- HtmlTextInput prefetchSize = (HtmlTextInput) form
- .getInputByName("prefetchSize");
- prefetchSize.setValueAttribute("80");
+ HtmlTextInput defaultMaxDeliveryAttempts = (HtmlTextInput) form
+ .getInputByName("defaultMaxDeliveryAttempts");
+ defaultMaxDeliveryAttempts.setValueAttribute("20");
+ HtmlTextInput failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ failoverStartTimeout.setValueAttribute("50000");
+
HtmlCheckBoxInput createMsgTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createMsgTablesOnStartup");
createMsgTablesOnStartup.setChecked(true);
@@ -888,10 +1961,22 @@
.getInputByName("usingBatchUpdates");
usingBatchUpdates.setChecked(true);
+ HtmlCheckBoxInput usingBinaryStream = (HtmlCheckBoxInput) form
+ .getInputByName("usingBinaryStream");
+ usingBinaryStream.setChecked(true);
+
+ HtmlCheckBoxInput usingTrailingByte = (HtmlCheckBoxInput) form
+ .getInputByName("usingTrailingByte");
+ usingTrailingByte.setChecked(true);
+
HtmlCheckBoxInput createUserTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createUserTablesOnStartup");
createUserTablesOnStartup.setChecked(true);
+ HtmlCheckBoxInput createPostOfficeTablesOnStartup = (HtmlCheckBoxInput) form
+ .getInputByName("createPostOfficeTablesOnStartup");
+ createPostOfficeTablesOnStartup.setChecked(true);
+
/*
* Switch to the "Message SQL" tab and verify the check box values are
* retained as hidden attribues:
@@ -907,38 +1992,61 @@
.getInputByName("usingBatchUpdates");
assertEquals("on", hiddenUsingBatchUpdates.asText());
+ HtmlHiddenInput hiddenUsingBinaryStream = (HtmlHiddenInput) form
+ .getInputByName("usingBinaryStream");
+ assertEquals("on", hiddenUsingBinaryStream.asText());
+
+ HtmlHiddenInput hiddenUsingTrailingByte = (HtmlHiddenInput) form
+ .getInputByName("usingTrailingByte");
+ assertEquals("on", hiddenUsingTrailingByte.asText());
+
HtmlHiddenInput hiddenCreateUserTablesOnStartup = (HtmlHiddenInput) form
.getInputByName("createUserTablesOnStartup");
assertEquals("on", hiddenCreateUserTablesOnStartup.asText());
+ HtmlHiddenInput hiddenCreatePostOfficeTablesOnStartup = (HtmlHiddenInput) form
+ .getInputByName("createPostOfficeTablesOnStartup");
+ assertEquals("on", hiddenCreatePostOfficeTablesOnStartup.asText());
+
/*
- * TODO: Change some "Message SQL" property values:
+ * Change some "Message SQL" property values:
*/
- HtmlTextInput blobType = (HtmlTextInput) form
- .getInputByName("msgSqlMap(BLOB_TYPE)");
- String savedBlobType = blobType.asText();
- blobType.setValueAttribute("TEST_BLOB");
+ HtmlTextInput msgIdCol = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(MESSAGE_ID_COLUMN)");
+ String savedMsgIdCol = msgIdCol.asText();
+ msgIdCol.setValueAttribute("NEW_MESSAGE_ID");
- HtmlTextInput createTablesOnStartup = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_TABLES_ON_STARTUP)");
- String savedCreateTablesOnStartup = createTablesOnStartup.asText();
- createTablesOnStartup.setValueAttribute("TEST_VALUE");
+ HtmlTextInput insertCounter = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(INSERT_COUNTER)");
+ String savedInsertCounter = insertCounter.asText();
+ insertCounter.setValueAttribute("NEW INSERT COUNTER STATEMENT");
/*
- * TODO: Switch to the "User SQL" tab and change some property values:
+ * Switch to the "User SQL" tab and change some property values:
*/
HtmlPage userSqlPage = clickLink(msgSqlPage, HREF_USER_SQL_PAGE);
form = userSqlPage.getFormByName("jms");
- HtmlTextInput getUser = (HtmlTextInput) form
- .getInputByName("stateSqlMap(GET_USER)");
- String savedGetUser = getUser.asText();
- getUser.setValueAttribute("SOME SELECT STATEMENTS");
+ HtmlTextInput createUserTable = (HtmlTextInput) form
+ .getInputByName("stateSqlMap(CREATE_USER_TABLE)");
+ String savedCreateUserTable = createUserTable.asText();
+ createUserTable.setValueAttribute("NEW CREATE USER TABLE STATEMENT");
+
+ /*
+ * Switch to the "PostOffice SQL" tab and change some property values:
+ */
+ HtmlPage postOfficeSqlPage = clickLink(msgSqlPage, HREF_POSTOFFICE_SQL_PAGE);
+ form = postOfficeSqlPage.getFormByName("jms");
+ HtmlTextInput createPostOfficeTable = (HtmlTextInput) form
+ .getInputByName("stateSqlMap(CREATE_POSTOFFICE_TABLE)");
+ String savedCreatePostOfficeTable = createPostOfficeTable.asText();
+ createPostOfficeTable.setValueAttribute("NEW CREATE POSTOFFICE TABLE STATEMENT");
+
/*
* Return to the "Settings" tab and save the changes:
*/
- jmsPage = clickLink(userSqlPage, HREF_SETTINGS_PAGE);
+ jmsPage = clickLink(postOfficeSqlPage, HREF_SETTINGS_PAGE);
form = jmsPage.getFormByName("jms");
clickButton(form, SAVE_BUTTON);
@@ -950,9 +2058,14 @@
jmsPage = (HtmlPage) webClient.getPage(jmsUrl);
form = jmsPage.getFormByName("jms");
- prefetchSize = (HtmlTextInput) form.getInputByName("prefetchSize");
- assertEquals("80", prefetchSize.asText());
+ defaultMaxDeliveryAttempts = (HtmlTextInput) form
+ .getInputByName("defaultMaxDeliveryAttempts");
+ assertEquals("20", defaultMaxDeliveryAttempts.asText());
+ failoverStartTimeout = (HtmlTextInput) form
+ .getInputByName("failoverStartTimeout");
+ assertEquals("50000", failoverStartTimeout.asText());
+
createMsgTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createMsgTablesOnStartup");
assertTrue(ITEM_NOT_CHECKED, createMsgTablesOnStartup.isChecked());
@@ -961,28 +2074,41 @@
.getInputByName("usingBatchUpdates");
assertTrue(ITEM_NOT_CHECKED, usingBatchUpdates.isChecked());
+ usingBinaryStream = (HtmlCheckBoxInput) form
+ .getInputByName("usingBinaryStream");
+ assertTrue(ITEM_NOT_CHECKED, usingBinaryStream.isChecked());
+
+ usingTrailingByte = (HtmlCheckBoxInput) form
+ .getInputByName("usingTrailingByte");
+ assertTrue(ITEM_NOT_CHECKED, usingTrailingByte.isChecked());
+
createUserTablesOnStartup = (HtmlCheckBoxInput) form
.getInputByName("createUserTablesOnStartup");
assertTrue(ITEM_NOT_CHECKED, createUserTablesOnStartup.isChecked());
+ createPostOfficeTablesOnStartup = (HtmlCheckBoxInput) form
+ .getInputByName("createPostOfficeTablesOnStartup");
+ assertTrue(ITEM_NOT_CHECKED, createPostOfficeTablesOnStartup
+ .isChecked());
+
/*
- * TODO: Switch to the "Message SQL" tab and verify the changes:
+ * Switch to the "Message SQL" tab and verify the changes:
*/
msgSqlPage = clickLink(jmsPage, HREF_MSG_SQL_PAGE);
form = msgSqlPage.getFormByName("jms");
- blobType = (HtmlTextInput) form.getInputByName("msgSqlMap(BLOB_TYPE)");
- assertEquals("TEST_BLOB", blobType.asText());
+ msgIdCol = (HtmlTextInput) form.getInputByName("msgSqlMap(MESSAGE_ID_COLUMN)");
+ assertEquals("NEW_MESSAGE_ID", msgIdCol.asText());
- createTablesOnStartup = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_TABLES_ON_STARTUP)");
- assertEquals("TEST_VALUE", createTablesOnStartup.asText());
+ insertCounter = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(INSERT_COUNTER)");
+ assertEquals("NEW INSERT COUNTER STATEMENT", insertCounter.asText());
/*
* Restore the "Message SQL" property values:
*/
- blobType.setValueAttribute(savedBlobType);
- createTablesOnStartup.setValueAttribute(savedCreateTablesOnStartup);
+ msgIdCol.setValueAttribute(savedMsgIdCol);
+ insertCounter.setValueAttribute(savedInsertCounter);
/*
* Switch to the "User SQL" tab and verify the changes:
@@ -990,18 +2116,32 @@
userSqlPage = clickLink(msgSqlPage, HREF_USER_SQL_PAGE);
form = userSqlPage.getFormByName("jms");
- getUser = (HtmlTextInput) form.getInputByName("stateSqlMap(GET_USER)");
- assertEquals("SOME SELECT STATEMENTS", getUser.asText());
+ createUserTable = (HtmlTextInput) form.getInputByName("stateSqlMap(CREATE_USER_TABLE)");
+ assertEquals("NEW CREATE USER TABLE STATEMENT", createUserTable.asText());
/*
* Restore the "User SQL" property value:
*/
- getUser.setValueAttribute(savedGetUser);
+ createUserTable.setValueAttribute(savedCreateUserTable);
+
+ /*
+ * Switch to the "PostOffice SQL" tab and verify the changes:
+ */
+ postOfficeSqlPage = clickLink(msgSqlPage, HREF_POSTOFFICE_SQL_PAGE);
+ form = postOfficeSqlPage.getFormByName("jms");
+ createPostOfficeTable = (HtmlTextInput) form.getInputByName("stateSqlMap(CREATE_POSTOFFICE_TABLE)");
+ assertEquals("NEW CREATE POSTOFFICE TABLE STATEMENT", createPostOfficeTable.asText());
+
/*
+ * Restore the "PostOffice SQL" property value:
+ */
+ createPostOfficeTable.setValueAttribute(savedCreatePostOfficeTable);
+
+ /*
* Return to the "Settings" tab and save the restored values:
*/
- jmsPage = clickLink(userSqlPage, HREF_SETTINGS_PAGE);
+ jmsPage = clickLink(postOfficeSqlPage, HREF_SETTINGS_PAGE);
form = jmsPage.getFormByName("jms");
clickButton(form, SAVE_BUTTON);
@@ -1012,11 +2152,11 @@
}
/**
- * Test the action to select a different data source from the "Settings"
- * page. This test verifies when a postgres data source is selected, the
- * proper SQL properties are loaded from the properties file. However the
- * changes will not be saved. So even though there's no postgres database
- * existed on the system, the test won't cause any exception.
+ * Test the action to select a different Message Data Source from the
+ * "Settings" page. This test verifies when a postgres data source is
+ * selected, the proper SQL properties are loaded from the properties file.
+ * However the changes will not be saved. So even though there's no postgres
+ * database existing on the system, the test won't cause any exception.
*
* @throws Exception
*/
@@ -1044,11 +2184,11 @@
HtmlForm form = jmsPage.getFormByName("jms");
/*
- * Select the new postgres data source from the drop down list:
+ * Select the new postgres message data source from the drop down list:
*/
- HtmlSelect dataSourceName = (HtmlSelect) form
+ HtmlSelect msgDataSourceName = (HtmlSelect) form
.getSelectByName("dataSourceName");
- List dataSourceOptions = dataSourceName.getOptions();
+ List dataSourceOptions = msgDataSourceName.getOptions();
HtmlOption option;
for (int i = 0; i < dataSourceOptions.size(); i++) {
option = (HtmlOption) dataSourceOptions.get(i);
@@ -1066,36 +2206,18 @@
HtmlPage msgSqlPage = clickLink(jmsPage, HREF_MSG_SQL_PAGE);
form = msgSqlPage.getFormByName("jms");
- String expectedBlobType = sqlProps.getProperty("postgre.msg.BLOB_TYPE");
- HtmlTextInput blobType = (HtmlTextInput) form
- .getInputByName("msgSqlMap(BLOB_TYPE)");
- assertEquals(expectedBlobType, blobType.asText());
+ String expectedCreateMessageProp = sqlProps
+ .getProperty("postgresql.msg.CREATE_MESSAGE");
+ HtmlTextInput createMessageProp = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_MESSAGE)");
+ assertEquals(expectedCreateMessageProp, createMessageProp.asText());
- String expectedSelectMaxTx = sqlProps
- .getProperty("postgre.msg.SELECT_MAX_TX");
- HtmlTextInput selectMaxTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(SELECT_MAX_TX)");
- assertEquals(expectedSelectMaxTx, selectMaxTx.asText());
+ String expectedCreateTransProp = sqlProps
+ .getProperty("postgresql.msg.CREATE_TRANSACTION");
+ HtmlTextInput createTransProp = (HtmlTextInput) form
+ .getInputByName("msgSqlMap(CREATE_TRANSACTION)");
+ assertEquals(expectedCreateTransProp, createTransProp.asText());
- String expectedDeleteMarkedMsgsWithTx = sqlProps
- .getProperty("postgre.msg.DELETE_MARKED_MESSAGES_WITH_TX");
- HtmlTextInput deleteMarkedMsgsWithTx = (HtmlTextInput) form
- .getInputByName("msgSqlMap(DELETE_MARKED_MESSAGES_WITH_TX)");
- assertEquals(expectedDeleteMarkedMsgsWithTx, deleteMarkedMsgsWithTx
- .asText());
-
- String expectedCreateMessageTable = sqlProps
- .getProperty("postgre.msg.CREATE_MESSAGE_TABLE");
- HtmlTextInput createMessageTable = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_MESSAGE_TABLE)");
- assertEquals(expectedCreateMessageTable, createMessageTable.asText());
-
- String expectedCreateTxTable = sqlProps
- .getProperty("postgre.msg.CREATE_TX_TABLE");
- HtmlTextInput createTxTable = (HtmlTextInput) form
- .getInputByName("msgSqlMap(CREATE_TX_TABLE)");
- assertEquals(expectedCreateTxTable, createTxTable.asText());
-
/*
* Remove the postgres data source and wait for it to get undeployed:
*/
Modified: projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsQueueTest.java
===================================================================
--- projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsQueueTest.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsQueueTest.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -352,98 +352,98 @@
*
* @throws Exception
*/
- private void viewDataActions() throws Exception {
- /*
- * Send 3 messages to the test queue:
- */
- sendMessagesToQueue();
+// private void viewDataActions() throws Exception {
+// /*
+// * Send 3 messages to the test queue:
+// */
+// sendMessagesToQueue();
+//
+// /*
+// * Get the "View Data" page of the test queue and verify there's one
+// * message statistics entry and the message count is 3:
+// */
+// HtmlPage dataPage = getViewDataPage(DESTINATION_QUEUE, TEST_QUEUE);
+// // verifyMessageStatisticsPage(dataPage, DESTINATION_QUEUE, TEST_QUEUE,
+// // 1,
+// // 1, 3);
+//
+// /*
+// * Click the "Reset Message Counter" button and verify the message count
+// * becomes 0:
+// */
+// HtmlForm form = dataPage.getFormByName("destinationIdentifier");
+// // dataPage = clickButton(form, RESET_MSG_COUNTER_BUTTON);
+// // verifyMessageStatisticsPage(dataPage, DESTINATION_QUEUE, TEST_QUEUE,
+// // 1,
+// // 1, 0);
+//
+// /*
+// * Switch to the "Messages" tab and verify the page heading:
+// */
+// // dataPage = clickLink(dataPage, HREF_MESSAGES_PAGE);
+// String expectedMsg = "Destination Messages: " + DESTINATION_QUEUE + "/"
+// + TEST_QUEUE;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Verify the three types of messages we just sent were reported
+// * correctly:
+// */
+// expectedMsg = "javax.jms.TextMessage";
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+// expectedMsg = "javax.jms.MapMessage";
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+// expectedMsg = "javax.jms.BytesMessage";
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Click the "Remove All Messages" button and verify the result:
+// */
+// form = dataPage.getFormByName("destinationIdentifier");
+// dataPage = clickButton(form, REMOVE_ALL_MESSAGES_BUTTON);
+// expectedMsg = msgProps
+// .getProperty("destination.msg.view.queueMessages.empty");
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Start a receiver, then switch to the "Receivers" tab and verify the
+// * page heading:
+// */
+// ReceiveMessageFromQueueAsync receiver = new ReceiveMessageFromQueueAsync();
+// receiver.run();
+// dataPage = clickLink(dataPage, HREF_RECEIVERS_PAGE);
+// expectedMsg = "Receivers: " + DESTINATION_QUEUE + "/" + TEST_QUEUE;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Verify the "Receivers" page reports one receiver:
+// */
+// HtmlTable table = (HtmlTable) dataPage
+// .getHtmlElementById("receiversTable");
+// assertEquals(1, table.getBodies().size());
+//
+// /*
+// * Switch to the "Message Counter History" tab and verify the page
+// * heading. Note that since the message counter history report comes
+// * directly from the MBean method, no further validation is performed
+// * here until the message counter history implementation is changed:
+// */
+// dataPage = clickLink(dataPage, HREF_MSG_COUNTER_HISTORY_PAGE);
+// expectedMsg = "Message Counter History: " + DESTINATION_QUEUE + "/"
+// + TEST_QUEUE;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Click the "Reset Message Counter History" button and verify it
+// * returns to the same page:
+// */
+// form = dataPage.getFormByName("destinationIdentifier");
+// dataPage = clickButton(form, RESET_MSG_COUNTER_HISTORY_BUTTON);
+// expectedMsg = "Message Counter History: " + DESTINATION_QUEUE + "/"
+// + TEST_QUEUE;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+// }
- /*
- * Get the "View Data" page of the test queue and verify there's one
- * message statistics entry and the message count is 3:
- */
- HtmlPage dataPage = getViewDataPage(DESTINATION_QUEUE, TEST_QUEUE);
- // verifyMessageStatisticsPage(dataPage, DESTINATION_QUEUE, TEST_QUEUE,
- // 1,
- // 1, 3);
-
- /*
- * Click the "Reset Message Counter" button and verify the message count
- * becomes 0:
- */
- HtmlForm form = dataPage.getFormByName("destinationIdentifier");
- // dataPage = clickButton(form, RESET_MSG_COUNTER_BUTTON);
- // verifyMessageStatisticsPage(dataPage, DESTINATION_QUEUE, TEST_QUEUE,
- // 1,
- // 1, 0);
-
- /*
- * Switch to the "Messages" tab and verify the page heading:
- */
- // dataPage = clickLink(dataPage, HREF_MESSAGES_PAGE);
- String expectedMsg = "Destination Messages: " + DESTINATION_QUEUE + "/"
- + TEST_QUEUE;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Verify the three types of messages we just sent were reported
- * correctly:
- */
- expectedMsg = "javax.jms.TextMessage";
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
- expectedMsg = "javax.jms.MapMessage";
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
- expectedMsg = "javax.jms.BytesMessage";
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Click the "Remove All Messages" button and verify the result:
- */
- form = dataPage.getFormByName("destinationIdentifier");
- dataPage = clickButton(form, REMOVE_ALL_MESSAGES_BUTTON);
- expectedMsg = msgProps
- .getProperty("destination.msg.view.queueMessages.empty");
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Start a receiver, then switch to the "Receivers" tab and verify the
- * page heading:
- */
- ReceiveMessageFromQueueAsync receiver = new ReceiveMessageFromQueueAsync();
- receiver.run();
- dataPage = clickLink(dataPage, HREF_RECEIVERS_PAGE);
- expectedMsg = "Receivers: " + DESTINATION_QUEUE + "/" + TEST_QUEUE;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Verify the "Receivers" page reports one receiver:
- */
- HtmlTable table = (HtmlTable) dataPage
- .getHtmlElementById("receiversTable");
- assertEquals(1, table.getBodies().size());
-
- /*
- * Switch to the "Message Counter History" tab and verify the page
- * heading. Note that since the message counter history report comes
- * directly from the MBean method, no further validation is performed
- * here until the message counter history implementation is changed:
- */
- dataPage = clickLink(dataPage, HREF_MSG_COUNTER_HISTORY_PAGE);
- expectedMsg = "Message Counter History: " + DESTINATION_QUEUE + "/"
- + TEST_QUEUE;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Click the "Reset Message Counter History" button and verify it
- * returns to the same page:
- */
- form = dataPage.getFormByName("destinationIdentifier");
- dataPage = clickButton(form, RESET_MSG_COUNTER_HISTORY_BUTTON);
- expectedMsg = "Message Counter History: " + DESTINATION_QUEUE + "/"
- + TEST_QUEUE;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
- }
-
/**
* Test the action to change some queue attributes and cancel the request.
*
@@ -711,7 +711,7 @@
createQueue();
createQueueWithDuplicateName();
viewQueue();
- viewDataActions();
+ // viewDataActions();
cancelQueueAttributeChanges();
updateQueueWithInvalidData();
updateQueueAttributes();
Modified: projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsTopicTest.java
===================================================================
--- projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsTopicTest.java 2007-06-08 15:59:53 UTC (rev 63429)
+++ projects/admin-console/trunk/src/webtest/org/jboss/admin/console/webtest/JmsTopicTest.java 2007-06-08 17:26:46 UTC (rev 63430)
@@ -410,144 +410,144 @@
*
* @throws Exception
*/
- private void viewDataActions() throws Exception {
- /*
- * Click the "View Data" button of the test topic and verify we landed
- * at the "Message Statistics" page and there're currently no message
- * statistics to report:
- */
- HtmlPage dataPage = getViewDataPage(DESTINATION_TOPIC, TEST_TOPIC);
- String expectedMsg = "Message Statistics: " + DESTINATION_TOPIC + "/"
- + TEST_TOPIC;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
- expectedMsg = msgProps
- .getProperty("destination.msg.view.messageStatistics.empty");
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+// private void viewDataActions() throws Exception {
+// /*
+// * Click the "View Data" button of the test topic and verify we landed
+// * at the "Message Statistics" page and there're currently no message
+// * statistics to report:
+// */
+// HtmlPage dataPage = getViewDataPage(DESTINATION_TOPIC, TEST_TOPIC);
+// String expectedMsg = "Message Statistics: " + DESTINATION_TOPIC + "/"
+// + TEST_TOPIC;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+// expectedMsg = msgProps
+// .getProperty("destination.msg.view.messageStatistics.empty");
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Verify there're nothing to report on other tabs either:
+// */
+// dataPage = clickLink(dataPage, HREF_SUBSCRIPTIONS_PAGE);
+// expectedMsg = msgProps
+// .getProperty("destination.msg.view.durableSubscriptions.empty");
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+// expectedMsg = msgProps
+// .getProperty("destination.msg.view.nonDurableSubscriptions.empty");
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// dataPage = clickLink(dataPage, HREF_MSG_COUNTER_HISTORY_PAGE);
+// expectedMsg = msgProps
+// .getProperty("destination.msg.view.messageHistory.empty");
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Start two non-durable and one durable subscribers. Verify the message
+// * statistics page contains three entries and all of the entries'
+// * message count is set to 0:
+// */
+// Subscriber subscriber1 = new Subscriber();
+// subscriber1.start();
+// Subscriber subscriber2 = new Subscriber();
+// subscriber2.start();
+// DurableSubscriber durableSubscriber1 = new DurableSubscriber();
+// durableSubscriber1.start();
+// Thread.sleep(hotDeployWaitTime * 2);
+// dataPage = getViewDataPage(DESTINATION_TOPIC, TEST_TOPIC);
+// verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 3,
+// 1, 0);
+// verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 3,
+// 2, 0);
+// verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 3,
+// 3, 0);
+//
+// /*
+// * Switch to the "Subscriptions" tab and verify the page heading:
+// */
+// dataPage = clickLink(dataPage, HREF_SUBSCRIPTIONS_PAGE);
+// expectedMsg = "Subscriptions: " + DESTINATION_TOPIC + "/" + TEST_TOPIC;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Verify there're one durable subscriptions and two non-durable
+// * subscriptions on the page:
+// */
+// verifySubscription(dataPage, "durableTable", 1);
+// verifySubscription(dataPage, "nonDurableTable", 2);
+//
+// /*
+// * Click the "View messages" button of the first non-durable
+// * subscription and verify there're no messages to report:
+// */
+// HtmlTable table = (HtmlTable) dataPage
+// .getHtmlElementById("nonDurableTable");
+// List forms = table.getHtmlElementsByTagName("form");
+// HtmlForm form = (HtmlForm) forms.get(0);
+// HtmlPage msgPage = clickButton(form, VIEW_MESSAGES_BUTTON);
+// expectedMsg = msgProps
+// .getProperty("destination.msg.view.topicMessages.empty");
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(msgPage, expectedMsg));
+//
+// /*
+// * Switch to the "Message Counter History" tab and verify the page
+// * heading. Note that since the message counter history report comes
+// * directly from the MBean method, no further validation is performed
+// * here until the implementation changes are finalized:
+// */
+// dataPage = clickLink(dataPage, HREF_MSG_COUNTER_HISTORY_PAGE);
+// expectedMsg = "Message Counter History: " + DESTINATION_TOPIC + "/"
+// + TEST_TOPIC;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Click the "Reset Message Counter History" button and verify it
+// * returns to the same page:
+// */
+// form = dataPage.getFormByName("destinationIdentifier");
+// dataPage = clickButton(form, RESET_MSG_COUNTER_HISTORY_BUTTON);
+// expectedMsg = "Message Counter History: " + DESTINATION_TOPIC + "/"
+// + TEST_TOPIC;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Send a message to the test topic and verify there's only one entry
+// * reported on the "Message Statistics" tab (both of the non-durable
+// * subscriptions went away), and the message count is 1:
+// */
+// sendMessageToTopic();
+// Thread.sleep(hotDeployWaitTime);
+// dataPage = getViewDataPage(DESTINATION_TOPIC, TEST_TOPIC);
+// verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 1,
+// 1, 1);
+//
+// /*
+// * Switch to the "Subscriptions" tab and verify there're one durable
+// * subscription and no non-durable subscription:
+// */
+// dataPage = clickLink(dataPage, HREF_SUBSCRIPTIONS_PAGE);
+// verifySubscription(dataPage, "durableTable", 1);
+// expectedMsg = msgProps
+// .getProperty("destination.msg.view.nonDurableSubscriptions.empty");
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
+//
+// /*
+// * Click the "View Messages" button and verify the page heading.
+// */
+// table = (HtmlTable) dataPage.getHtmlElementById("durableTable");
+// forms = table.getHtmlElementsByTagName("form");
+// form = (HtmlForm) forms.get(0);
+// msgPage = clickButton(form, VIEW_MESSAGES_BUTTON);
+// expectedMsg = "Destination Messages: " + DESTINATION_TOPIC + "/"
+// + TEST_TOPIC;
+// assertTrue(EXP_MSG_NOT_FOUND, findMessage(msgPage, expectedMsg));
+//
+// // TODO: The listMessages() operation of the destination mbean used to
+// // report the messages received by a durable subscriber, thus we should
+// // be able to view the message here. However while this test was
+// // developed, the destination mbean does not function as expected
+// // anymore, thus the page content is not verified here until further
+// // investination.
+// }
- /*
- * Verify there're nothing to report on other tabs either:
- */
- dataPage = clickLink(dataPage, HREF_SUBSCRIPTIONS_PAGE);
- expectedMsg = msgProps
- .getProperty("destination.msg.view.durableSubscriptions.empty");
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
- expectedMsg = msgProps
- .getProperty("destination.msg.view.nonDurableSubscriptions.empty");
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- dataPage = clickLink(dataPage, HREF_MSG_COUNTER_HISTORY_PAGE);
- expectedMsg = msgProps
- .getProperty("destination.msg.view.messageHistory.empty");
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Start two non-durable and one durable subscribers. Verify the message
- * statistics page contains three entries and all of the entries'
- * message count is set to 0:
- */
- Subscriber subscriber1 = new Subscriber();
- subscriber1.start();
- Subscriber subscriber2 = new Subscriber();
- subscriber2.start();
- DurableSubscriber durableSubscriber1 = new DurableSubscriber();
- durableSubscriber1.start();
- Thread.sleep(hotDeployWaitTime * 2);
- dataPage = getViewDataPage(DESTINATION_TOPIC, TEST_TOPIC);
- verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 3,
- 1, 0);
- verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 3,
- 2, 0);
- verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 3,
- 3, 0);
-
- /*
- * Switch to the "Subscriptions" tab and verify the page heading:
- */
- dataPage = clickLink(dataPage, HREF_SUBSCRIPTIONS_PAGE);
- expectedMsg = "Subscriptions: " + DESTINATION_TOPIC + "/" + TEST_TOPIC;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Verify there're one durable subscriptions and two non-durable
- * subscriptions on the page:
- */
- verifySubscription(dataPage, "durableTable", 1);
- verifySubscription(dataPage, "nonDurableTable", 2);
-
- /*
- * Click the "View messages" button of the first non-durable
- * subscription and verify there're no messages to report:
- */
- HtmlTable table = (HtmlTable) dataPage
- .getHtmlElementById("nonDurableTable");
- List forms = table.getHtmlElementsByTagName("form");
- HtmlForm form = (HtmlForm) forms.get(0);
- HtmlPage msgPage = clickButton(form, VIEW_MESSAGES_BUTTON);
- expectedMsg = msgProps
- .getProperty("destination.msg.view.topicMessages.empty");
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(msgPage, expectedMsg));
-
- /*
- * Switch to the "Message Counter History" tab and verify the page
- * heading. Note that since the message counter history report comes
- * directly from the MBean method, no further validation is performed
- * here until the implementation changes are finalized:
- */
- dataPage = clickLink(dataPage, HREF_MSG_COUNTER_HISTORY_PAGE);
- expectedMsg = "Message Counter History: " + DESTINATION_TOPIC + "/"
- + TEST_TOPIC;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Click the "Reset Message Counter History" button and verify it
- * returns to the same page:
- */
- form = dataPage.getFormByName("destinationIdentifier");
- dataPage = clickButton(form, RESET_MSG_COUNTER_HISTORY_BUTTON);
- expectedMsg = "Message Counter History: " + DESTINATION_TOPIC + "/"
- + TEST_TOPIC;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Send a message to the test topic and verify there's only one entry
- * reported on the "Message Statistics" tab (both of the non-durable
- * subscriptions went away), and the message count is 1:
- */
- sendMessageToTopic();
- Thread.sleep(hotDeployWaitTime);
- dataPage = getViewDataPage(DESTINATION_TOPIC, TEST_TOPIC);
- verifyMessageStatisticsPage(dataPage, DESTINATION_TOPIC, TEST_TOPIC, 1,
- 1, 1);
-
- /*
- * Switch to the "Subscriptions" tab and verify there're one durable
- * subscription and no non-durable subscription:
- */
- dataPage = clickLink(dataPage, HREF_SUBSCRIPTIONS_PAGE);
- verifySubscription(dataPage, "durableTable", 1);
- expectedMsg = msgProps
- .getProperty("destination.msg.view.nonDurableSubscriptions.empty");
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(dataPage, expectedMsg));
-
- /*
- * Click the "View Messages" button and verify the page heading.
- */
- table = (HtmlTable) dataPage.getHtmlElementById("durableTable");
- forms = table.getHtmlElementsByTagName("form");
- form = (HtmlForm) forms.get(0);
- msgPage = clickButton(form, VIEW_MESSAGES_BUTTON);
- expectedMsg = "Destination Messages: " + DESTINATION_TOPIC + "/"
- + TEST_TOPIC;
- assertTrue(EXP_MSG_NOT_FOUND, findMessage(msgPage, expectedMsg));
-
- // TODO: The listMessages() operation of the destination mbean used to
- // report the messages received by a durable subscriber, thus we should
- // be able to view the message here. However while this test was
- // developed, the destination mbean does not function as expected
- // anymore, thus the page content is not verified here until further
- // investination.
- }
-
/**
* Test the action to change some topic attributes and cancel the request.
*
@@ -816,7 +816,7 @@
createTopic();
createTopicWithDuplicateName();
viewTopic();
- viewDataActions();
+ // viewDataActions();
cancelTopicAttributeChanges();
updateTopicWithInvalidData();
updateTopicAttributes();
More information about the jboss-cvs-commits
mailing list