JBoss hornetq SVN: r10091 - in trunk: hornetq-rest and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-30 19:49:46 -0500 (Thu, 30 Dec 2010)
New Revision: 10091
Modified:
trunk/build-maven.xml
trunk/hornetq-rest/pom.xml
Log:
update release
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-12-31 00:39:40 UTC (rev 10090)
+++ trunk/build-maven.xml 2010-12-31 00:49:46 UTC (rev 10091)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.2.0.QA-10058"/>
+ <property name="hornetq.version" value="2.2.0.QA-10090"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
Modified: trunk/hornetq-rest/pom.xml
===================================================================
--- trunk/hornetq-rest/pom.xml 2010-12-31 00:39:40 UTC (rev 10090)
+++ trunk/hornetq-rest/pom.xml 2010-12-31 00:49:46 UTC (rev 10091)
@@ -10,7 +10,7 @@
<properties>
<resteasy.version>2.0.1.GA</resteasy.version>
- <hornetq.version>2.2.0.QA-10058</hornetq.version>
+ <hornetq.version>2.2.0.QA-10090</hornetq.version>
</properties>
<licenses>
13 years, 12 months
JBoss hornetq SVN: r10090 - in trunk: src/config/jboss-as-4/clustered and 10 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-30 19:39:40 -0500 (Thu, 30 Dec 2010)
New Revision: 10090
Modified:
trunk/src/config/common/schema/hornetq-configuration.xsd
trunk/src/config/jboss-as-4/clustered/hornetq-configuration.xml
trunk/src/config/jboss-as-4/non-clustered/hornetq-configuration.xml
trunk/src/config/jboss-as-5/clustered/hornetq-configuration.xml
trunk/src/config/jboss-as-5/non-clustered/hornetq-configuration.xml
trunk/src/config/jboss-as-6/clustered/hornetq-configuration.xml
trunk/src/config/jboss-as-6/non-clustered/hornetq-configuration.xml
trunk/src/main/org/hornetq/core/config/Configuration.java
trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
trunk/tests/config/ConfigurationTest-full-config.xml
trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
Log:
JBPAPP-5557 - supporting name on hornetq-configuration to inject dependency on the application server
Modified: trunk/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/config/common/schema/hornetq-configuration.xsd 2010-12-31 00:39:40 UTC (rev 10090)
@@ -4,6 +4,8 @@
<xsd:element name="configuration">
<xsd:complexType>
<xsd:all>
+ <xsd:element maxOccurs="1" minOccurs="0" name="name" type="xsd:string">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" ref="clustered"/>
<xsd:element maxOccurs="1" minOccurs="0" ref="file-deployment-enabled"/>
<xsd:element maxOccurs="1" minOccurs="0" ref="persistence-enabled"/>
Modified: trunk/src/config/jboss-as-4/clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as-4/clustered/hornetq-configuration.xml 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/config/jboss-as-4/clustered/hornetq-configuration.xml 2010-12-31 00:39:40 UTC (rev 10090)
@@ -15,6 +15,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <!-- Don't change this name.
+ This is used by the dependency framework on the deployers,
+ to make sure this deployment is done before any other deployment -->
+ <name>HornetQ.main.config</name>
+
<clustered>true</clustered>
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
Modified: trunk/src/config/jboss-as-4/non-clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as-4/non-clustered/hornetq-configuration.xml 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/config/jboss-as-4/non-clustered/hornetq-configuration.xml 2010-12-31 00:39:40 UTC (rev 10090)
@@ -15,6 +15,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <!-- Don't change this name.
+ This is used by the dependency framework on the deployers,
+ to make sure this deployment is done before any other deployment -->
+ <name>HornetQ.main.config</name>
+
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
<bindings-directory>${jboss.server.data.dir}/hornetq/bindings</bindings-directory>
Modified: trunk/src/config/jboss-as-5/clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as-5/clustered/hornetq-configuration.xml 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/config/jboss-as-5/clustered/hornetq-configuration.xml 2010-12-31 00:39:40 UTC (rev 10090)
@@ -15,6 +15,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <!-- Don't change this name.
+ This is used by the dependency framework on the deployers,
+ to make sure this deployment is done before any other deployment -->
+ <name>HornetQ.main.config</name>
+
<clustered>true</clustered>
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
Modified: trunk/src/config/jboss-as-5/non-clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as-5/non-clustered/hornetq-configuration.xml 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/config/jboss-as-5/non-clustered/hornetq-configuration.xml 2010-12-31 00:39:40 UTC (rev 10090)
@@ -15,6 +15,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <!-- Don't change this name.
+ This is used by the dependency framework on the deployers,
+ to make sure this deployment is done before any other deployment -->
+ <name>HornetQ.main.config</name>
+
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
<bindings-directory>${jboss.server.data.dir}/hornetq/bindings</bindings-directory>
Modified: trunk/src/config/jboss-as-6/clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as-6/clustered/hornetq-configuration.xml 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/config/jboss-as-6/clustered/hornetq-configuration.xml 2010-12-31 00:39:40 UTC (rev 10090)
@@ -15,6 +15,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <!-- Don't change this name.
+ This is used by the dependency framework on the deployers,
+ to make sure this deployment is done before any other deployment -->
+ <name>HornetQ.main.config</name>
+
<clustered>true</clustered>
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
Modified: trunk/src/config/jboss-as-6/non-clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as-6/non-clustered/hornetq-configuration.xml 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/config/jboss-as-6/non-clustered/hornetq-configuration.xml 2010-12-31 00:39:40 UTC (rev 10090)
@@ -15,6 +15,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+ <!-- Don't change this name.
+ This is used by the dependency framework on the deployers,
+ to make sure this deployment is done before any other deployment -->
+ <name>HornetQ.main.config</name>
+
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
<bindings-directory>${jboss.server.data.dir}/hornetq/bindings</bindings-directory>
Modified: trunk/src/main/org/hornetq/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/Configuration.java 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/main/org/hornetq/core/config/Configuration.java 2010-12-31 00:39:40 UTC (rev 10090)
@@ -38,6 +38,13 @@
public interface Configuration extends Serializable
{
// General attributes -------------------------------------------------------------------
+
+
+ /** To be used on dependency management on the application server */
+ String getName();
+
+ /** To be used on dependency management on the application server */
+ void setName(String name);
/**
* Returns whether this server is clustered.
Modified: trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java 2010-12-31 00:39:40 UTC (rev 10090)
@@ -183,6 +183,8 @@
public static final String DEFAULT_LOG_DELEGATE_FACTORY_CLASS_NAME = JULLogDelegateFactory.class.getCanonicalName();
// Attributes -----------------------------------------------------------------------------
+
+ protected String name = "ConfigurationImpl::" + System.identityHashCode(this);
protected boolean clustered = ConfigurationImpl.DEFAULT_CLUSTERED;
@@ -1361,4 +1363,20 @@
this.connectorServiceConfigurations = configs;
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.config.Configuration#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.config.Configuration#setName(java.lang.String)
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
}
Modified: trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-12-31 00:39:40 UTC (rev 10090)
@@ -117,7 +117,7 @@
private static final String SEND_TO_DLA_ON_NO_ROUTE = "send-to-dla-on-no-route";
// Attributes ----------------------------------------------------
-
+
private boolean validateAIO = false;
// Static --------------------------------------------------------
@@ -125,7 +125,7 @@
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
-
+
/**
* @return the validateAIO
*/
@@ -161,12 +161,16 @@
{
XMLUtil.validate(e, FileConfigurationParser.CONFIGURATION_SCHEMA_URL);
+ config.setName(XMLConfigurationUtil.getString(e, "name", config.getName(), Validators.NO_CHECK));
+
config.setClustered(XMLConfigurationUtil.getBoolean(e, "clustered", config.isClustered()));
config.setAllowAutoFailBack(XMLConfigurationUtil.getBoolean(e, "allow-failback", config.isClustered()));
-
- config.setFailoverOnServerShutdown(XMLConfigurationUtil.getBoolean(e, "failover-on-shutdown", config.isFailoverOnServerShutdown()));
+ config.setFailoverOnServerShutdown(XMLConfigurationUtil.getBoolean(e,
+ "failover-on-shutdown",
+ config.isFailoverOnServerShutdown()));
+
config.setBackup(XMLConfigurationUtil.getBoolean(e, "backup", config.isBackup()));
config.setSharedStore(XMLConfigurationUtil.getBoolean(e, "shared-store", config.isSharedStore()));
@@ -440,7 +444,7 @@
// correct settings in xml
// If we fall back later on these settings can be ignored
boolean supportsAIO = AIOSequentialFileFactory.isSupported();
-
+
if (supportsAIO)
{
config.setJournalType(JournalType.ASYNCIO);
@@ -451,7 +455,7 @@
{
log.warn("AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal");
}
-
+
config.setJournalType(JournalType.NIO);
}
}
@@ -468,7 +472,7 @@
"journal-file-size",
config.getJournalFileSize(),
Validators.GT_ZERO));
-
+
int journalBufferTimeout = XMLConfigurationUtil.getInteger(e,
"journal-buffer-timeout",
config.getJournalType() == JournalType.ASYNCIO ? ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO
@@ -499,7 +503,7 @@
config.setJournalBufferSize_NIO(journalBufferSize);
config.setJournalMaxIO_NIO(journalMaxIO);
}
-
+
config.setJournalMinFiles(XMLConfigurationUtil.getInteger(e,
"journal-min-files",
config.getJournalMinFiles(),
@@ -565,7 +569,7 @@
parseQueues(e, config);
parseSecurity(e, config);
-
+
NodeList connectorServiceConfigs = e.getElementsByTagName("connector-service");
ArrayList<ConnectorServiceConfiguration> configs = new ArrayList<ConnectorServiceConfiguration>();
@@ -869,7 +873,7 @@
for (int i = 0; i < paramsNodes.getLength(); i++)
{
Node paramNode = paramsNodes.item(i);
-
+
NamedNodeMap attributes = paramNode.getAttributes();
Node nkey = attributes.getNamedItem("key");
@@ -911,7 +915,10 @@
if (child.getNodeName().equals("connector-ref"))
{
- String connectorName = XMLConfigurationUtil.getString(e, "connector-ref", null, Validators.NOT_NULL_OR_EMPTY);
+ String connectorName = XMLConfigurationUtil.getString(e,
+ "connector-ref",
+ null,
+ Validators.NOT_NULL_OR_EMPTY);
connectorNames.add(connectorName);
}
@@ -937,7 +944,7 @@
String groupAddress = XMLConfigurationUtil.getString(e, "group-address", null, Validators.NOT_NULL_OR_EMPTY);
int groupPort = XMLConfigurationUtil.getInteger(e, "group-port", -1, Validators.MINUS_ONE_OR_GT_ZERO);
-
+
long discoveryInitialWaitTimeout = XMLConfigurationUtil.getLong(e,
"initial-wait-timeout",
HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT,
@@ -973,7 +980,7 @@
String name = e.getAttribute("name");
String address = XMLConfigurationUtil.getString(e, "address", null, Validators.NOT_NULL_OR_EMPTY);
-
+
String connectorName = XMLConfigurationUtil.getString(e, "connector-ref", null, Validators.NOT_NULL_OR_EMPTY);
boolean duplicateDetection = XMLConfigurationUtil.getBoolean(e,
@@ -1004,7 +1011,7 @@
List<String> staticConnectorNames = new ArrayList<String>();
boolean allowDirectConnectionsOnly = false;
-
+
NodeList children = e.getChildNodes();
for (int j = 0; j < children.getLength(); j++)
@@ -1018,7 +1025,7 @@
else if (child.getNodeName().equals("static-connectors"))
{
Node attr = child.getAttributes().getNamedItem("allow-direct-connections-only");
- if(attr != null)
+ if (attr != null)
{
allowDirectConnectionsOnly = "true".equalsIgnoreCase(attr.getNodeValue()) || allowDirectConnectionsOnly;
}
@@ -1120,11 +1127,11 @@
"password",
ConfigurationImpl.DEFAULT_CLUSTER_PASSWORD,
Validators.NO_CHECK);
-
+
boolean ha = XMLConfigurationUtil.getBoolean(brNode, "ha", false);
String filterString = null;
-
+
List<String> staticConnectorNames = new ArrayList<String>();
String discoveryGroupName = null;
@@ -1193,11 +1200,11 @@
private void getStaticConnectors(List<String> staticConnectorNames, Node child)
{
- NodeList children2 = ((Element) child).getElementsByTagName("connector-ref");
+ NodeList children2 = ((Element)child).getElementsByTagName("connector-ref");
for (int k = 0; k < children2.getLength(); k++)
{
- Element child2 = (Element) children2.item(k);
+ Element child2 = (Element)children2.item(k);
String connectorName = child2.getChildNodes().item(0).getNodeValue();
@@ -1249,7 +1256,7 @@
mainConfig.getDivertConfigurations().add(config);
}
-
+
private ConnectorServiceConfiguration parseConnectorService(final Element e)
{
Node nameNode = e.getAttributes().getNamedItem("name");
Modified: trunk/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-full-config.xml 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/tests/config/ConfigurationTest-full-config.xml 2010-12-31 00:39:40 UTC (rev 10090)
@@ -2,6 +2,7 @@
xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq ../../src/config/common/schema/hornetq-configuration.xsd">
+ <name>SomeNameForUseOnTheApplicationServer</name>
<clustered>true</clustered>
<scheduled-thread-pool-max-size>12345</scheduled-thread-pool-max-size>
<thread-pool-max-size>54321</thread-pool-max-size>
Modified: trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java 2010-12-30 02:44:46 UTC (rev 10089)
+++ trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java 2010-12-31 00:39:40 UTC (rev 10090)
@@ -37,6 +37,7 @@
public void testDefaults()
{
// Check they match the values from the test file
+ Assert.assertEquals("SomeNameForUseOnTheApplicationServer", conf.getName());
Assert.assertEquals(false, conf.isPersistenceEnabled());
Assert.assertEquals(true, conf.isFileDeploymentEnabled());
Assert.assertEquals(true, conf.isClustered());
13 years, 12 months
JBoss hornetq SVN: r10089 - in trunk/tests/src/org/hornetq/tests: integration and 25 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-29 21:44:46 -0500 (Wed, 29 Dec 2010)
New Revision: 10089
Modified:
trunk/tests/src/org/hornetq/tests/concurrent/stomp/ConcurrentStompTest.java
trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java
trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java
trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java
trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
trunk/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java
trunk/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java
trunk/tests/src/org/hornetq/tests/integration/client/RequestorTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java
trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java
trunk/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/FloodServerTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/connection/ExceptionListenerTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java
trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlUsingCoreTest.java
trunk/tests/src/org/hornetq/tests/integration/management/BroadcastGroupControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java
trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/DivertControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/JMXDomainTest.java
trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java
trunk/tests/src/org/hornetq/tests/integration/management/ManagementWithStompTest.java
trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java
trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java
trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java
trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithModifiedConfigurationTest.java
trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java
trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java
trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java
trunk/tests/src/org/hornetq/tests/integration/security/NettySecurityClientTest.java
trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java
trunk/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
trunk/tests/src/org/hornetq/tests/integration/stomp/StompTestBase.java
trunk/tests/src/org/hornetq/tests/integration/stomp/StompWebSocketTest.java
trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java
trunk/tests/src/org/hornetq/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
trunk/tests/src/org/hornetq/tests/unit/jms/misc/ManifestTest.java
trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java
trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
Encapsulating new ConfigurationImpl on the testsuite
Modified: trunk/tests/src/org/hornetq/tests/concurrent/stomp/ConcurrentStompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/concurrent/stomp/ConcurrentStompTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/concurrent/stomp/ConcurrentStompTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -133,7 +133,7 @@
private HornetQServer createServer() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setSecurityEnabled(false);
config.setPersistenceEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -202,7 +202,7 @@
{
super.setUp();
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setSecurityEnabled(false);
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
server = HornetQServers.newHornetQServer(config, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -17,12 +17,17 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.*;
+import org.hornetq.api.core.client.ClientConsumer;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.MessageHandler;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.tests.util.RandomUtil;
@@ -148,7 +153,7 @@
{
super.setUp();
- Configuration config = new ConfigurationImpl();
+ Configuration config = createDefaultConfig();
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()));
config.setSecurityEnabled(false);
server = HornetQServers.newHornetQServer(config, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -18,7 +18,13 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.*;
+import org.hornetq.api.core.client.ClientConsumer;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
@@ -26,9 +32,8 @@
import org.hornetq.core.server.HornetQServers;
import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.tests.util.ServiceTestBase;
-import org.hornetq.tests.util.UnitTestCase;
-public class CoreClientTest extends UnitTestCase
+public class CoreClientTest extends ServiceTestBase
{
private static final Logger log = Logger.getLogger(CoreClientTest.class);
@@ -58,7 +63,7 @@
{
final SimpleString QUEUE = new SimpleString("CoreClientTestQueue");
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -23,20 +23,28 @@
import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.*;
-import org.hornetq.core.config.impl.ConfigurationImpl;
+import org.hornetq.api.core.client.ClientConsumer;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.MessageHandler;
+import org.hornetq.api.core.client.ServerLocator;
+import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.server.Queue;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.tests.util.RandomUtil;
+import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*/
-public class DeadLetterAddressTest extends UnitTestCase
+public class DeadLetterAddressTest extends ServiceTestBase
{
private static final Logger log = Logger.getLogger(DeadLetterAddressTest.class);
@@ -458,7 +466,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ Configuration configuration = createDefaultConfig();
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -19,6 +19,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
+import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
@@ -31,7 +32,7 @@
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*/
-public class ExpiryAddressTest extends UnitTestCase
+public class ExpiryAddressTest extends ServiceTestBase
{
private static final Logger log = Logger.getLogger(ExpiryAddressTest.class);
@@ -305,7 +306,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ Configuration configuration = createDefaultConfig();
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -32,6 +32,7 @@
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.jms.server.management.NullInitialContext;
+import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
@@ -42,7 +43,7 @@
*
*
*/
-public class FailureDeadlockTest extends UnitTestCase
+public class FailureDeadlockTest extends ServiceTestBase
{
private static final Logger log = Logger.getLogger(FailureDeadlockTest.class);
@@ -59,7 +60,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
conf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
Modified: trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -1,31 +1,35 @@
package org.hornetq.tests.integration.client;
import junit.framework.Assert;
-import junit.framework.TestCase;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
import org.hornetq.api.core.Message;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.*;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.SendAcknowledgementHandler;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.protocol.core.Packet;
import org.hornetq.core.protocol.core.impl.PacketImpl;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.util.UnitTestCase;
/**
*
* From https://jira.jboss.org/jira/browse/HORNETQ-144
*
*/
-public class HornetQCrashTest extends TestCase
+public class HornetQCrashTest extends UnitTestCase
{
private static final Logger log = Logger.getLogger(HornetQCrashTest.class);
@@ -36,7 +40,7 @@
public void testHang() throws Exception
{
- Configuration configuration = new ConfigurationImpl();
+ Configuration configuration = createDefaultConfig();
configuration.setPersistenceEnabled(false);
configuration.setSecurityEnabled(false);
configuration.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -22,6 +22,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
+import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
@@ -143,7 +144,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ Configuration configuration = createDefaultConfig();
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -26,6 +26,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
+import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
@@ -565,7 +566,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ Configuration configuration = createDefaultConfig();
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -273,7 +273,7 @@
{
super.setUp();
- Configuration config = new ConfigurationImpl();
+ Configuration config = createDefaultConfig();
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()));
config.setSecurityEnabled(false);
server = HornetQServers.newHornetQServer(config, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/NIOvsOIOTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -156,7 +156,7 @@
{
String acceptorFactoryClassName = "org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory";
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -18,6 +18,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
+import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
@@ -64,7 +65,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ Configuration configuration = createDefaultConfig();
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -76,7 +76,7 @@
protected void setUp() throws Exception
{
super.setUp();
- Configuration config = new ConfigurationImpl();
+ Configuration config = createDefaultConfig();
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()));
config.setSecurityEnabled(false);
server = HornetQServers.newHornetQServer(config, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/RequestorTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/RequestorTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/RequestorTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -216,7 +216,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
service = HornetQServers.newHornetQServer(conf, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -245,7 +245,7 @@
{
super.setUp();
- Configuration config = new ConfigurationImpl();
+ Configuration config = createDefaultConfig();
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()));
config.setSecurityEnabled(false);
server = HornetQServers.newHornetQServer(config, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/SessionClosedOnRemotingConnectionFailureTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -112,7 +112,7 @@
{
super.setUp();
- Configuration config = new ConfigurationImpl();
+ Configuration config = createDefaultConfig();
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName()));
config.setSecurityEnabled(false);
server = HornetQServers.newHornetQServer(config, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -30,7 +30,6 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.BroadcastGroupConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
@@ -100,6 +99,8 @@
ServerLocator csi = (ServerLocator)ois.readObject();
Assert.assertNotNull(csi);
+
+ locator.close();
}
public void testCloseUnusedClientSessionFactoryWithoutGlobalPools() throws Exception
@@ -562,7 +563,7 @@
private void startServer() throws Exception
{
- Configuration liveConf = new ConfigurationImpl();
+ Configuration liveConf = createDefaultConfig();
liveConf.setSecurityEnabled(false);
liveTC = new TransportConfiguration(InVMConnectorFactory.class.getName());
liveConf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -18,6 +18,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
+import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
@@ -753,7 +754,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ Configuration configuration = createDefaultConfig();
configuration.setWildcardRoutingEnabled(true);
configuration.setSecurityEnabled(false);
configuration.setTransactionTimeoutScanPeriod(500);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -16,6 +16,8 @@
import java.util.ArrayList;
import java.util.Map;
+import javax.management.MBeanServer;
+
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
@@ -26,11 +28,8 @@
import org.hornetq.core.server.NodeManager;
import org.hornetq.core.server.impl.HornetQServerImpl;
import org.hornetq.spi.core.security.HornetQSecurityManager;
-import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
import org.hornetq.tests.util.UnitTestCase;
-import javax.management.MBeanServer;
-
/**
* A BridgeTestBase
*
@@ -94,7 +93,7 @@
final boolean netty,
final NodeManager nodeManager)
{
- Configuration serviceConf = new ConfigurationImpl();
+ Configuration serviceConf = createBasicConfig();
serviceConf.setClustered(true);
serviceConf.setSecurityEnabled(false);
serviceConf.setSharedStore(true);
@@ -142,7 +141,7 @@
final int liveId,
final NodeManager nodeManager)
{
- Configuration serviceConf = new ConfigurationImpl();
+ Configuration serviceConf = createBasicConfig();
serviceConf.setClustered(true);
serviceConf.setSecurityEnabled(false);
serviceConf.setBackup(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -1295,7 +1295,7 @@
throw new IllegalArgumentException("Already a server at node " + node);
}
- Configuration configuration = new ConfigurationImpl();
+ Configuration configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
configuration.setJournalMinFiles(2);
@@ -1363,7 +1363,7 @@
throw new IllegalArgumentException("Already a server at node " + node);
}
- Configuration configuration = new ConfigurationImpl();
+ Configuration configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
configuration.setJournalMinFiles(2);
@@ -1438,7 +1438,7 @@
throw new IllegalArgumentException("Already a server at node " + node);
}
- Configuration configuration = new ConfigurationImpl();
+ Configuration configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
configuration.setBindingsDirectory(getBindingsDir(node, false));
@@ -1517,7 +1517,7 @@
throw new IllegalArgumentException("Already a server at node " + node);
}
- Configuration configuration = new ConfigurationImpl();
+ Configuration configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
configuration.setSharedStore(sharedStorage);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteMultipleLivesMultipleBackupsFailoverTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -149,7 +149,7 @@
protected static Configuration createBackupConfiguration(int liveNode, int nodeid, boolean createClusterConnections, int[] otherBackupNodes, int... otherClusterNodes)
{
- Configuration config1 = new ConfigurationImpl();
+ Configuration config1 = createBasicConfig();
config1.getAcceptorConfigurations().add(createTransportConfiguration(true, true, generateParams(nodeid, true)));
config1.setSecurityEnabled(false);
config1.setSharedStore(true);
@@ -189,7 +189,7 @@
protected static Configuration createLiveConfiguration(int liveNode, int... otherLiveNodes)
{
- Configuration config0 = new ConfigurationImpl();
+ Configuration config0 = createBasicConfig();
TransportConfiguration liveConnector = createTransportConfiguration(true, false, generateParams(liveNode, true));
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
config0.getAcceptorConfigurations().add(createTransportConfiguration(true, true, generateParams(liveNode, true)));
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/RemoteSingleLiveMultipleBackupsFailoverTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -38,7 +38,7 @@
// Attributes ----------------------------------------------------
private static Map<Integer, String> backups = new HashMap<Integer, String>();
-
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -78,7 +78,7 @@
System.out.println("restarting live node as a backup");
createBackupConfig(0, 0, false, 1, 2, 3);
servers.get(0).start();
-
+
System.out.println("stopping waiting nodes");
for (int i = 1; i <= 3; i++)
{
@@ -88,19 +88,19 @@
servers.get(i).stop();
}
}
-
+
System.out.println("failing node " + backupNode);
servers.get(backupNode).crash(session);
session.close();
backupNode = waitForNewLive(5, true, servers, 0);
assertEquals(0, backupNode);
session = sendAndConsume(sf, false);
-
+
locator.close();
-
+
servers.get(0).stop();
}
-
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -122,7 +122,7 @@
protected void tearDown() throws Exception
{
super.tearDown();
- //make sure
+ // make sure
for (TestableServer testableServer : servers.values())
{
try
@@ -131,7 +131,7 @@
}
catch (Exception e)
{
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
}
}
@@ -147,17 +147,16 @@
{
servers.put(liveNode, new RemoteProcessHornetQServer(SharedLiveServerConfiguration.class.getName()));
}
-
protected void createBackupConfig(int liveNode, int nodeid, boolean createClusterConnections, int... nodes)
{
servers.put(nodeid, new RemoteProcessHornetQServer(backups.get(nodeid)));
}
-
+
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
-
+
public static class SharedLiveServerConfiguration extends RemoteServerConfiguration
{
@Override
@@ -165,11 +164,15 @@
{
int liveNode = 0;
int[] otherLiveNodes = new int[0];
-
- Configuration config0 = new ConfigurationImpl();
- TransportConfiguration liveConnector = createTransportConfiguration(true, false, generateParams(liveNode, true));
+
+ Configuration config0 = createBasicConfig();
+ TransportConfiguration liveConnector = createTransportConfiguration(true,
+ false,
+ generateParams(liveNode, true));
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
- config0.getAcceptorConfigurations().add(createTransportConfiguration(true, true, generateParams(liveNode, true)));
+ config0.getAcceptorConfigurations().add(createTransportConfiguration(true,
+ true,
+ generateParams(liveNode, true)));
config0.setSecurityEnabled(false);
config0.setSharedStore(true);
config0.setJournalType(JournalType.NIO);
@@ -177,13 +180,23 @@
List<String> pairs = new ArrayList<String>();
for (int node : otherLiveNodes)
{
- TransportConfiguration otherLiveConnector = createTransportConfiguration(true, false, generateParams(node, true));
+ TransportConfiguration otherLiveConnector = createTransportConfiguration(true,
+ false,
+ generateParams(node, true));
config0.getConnectorConfigurations().put(otherLiveConnector.getName(), otherLiveConnector);
- pairs.add(otherLiveConnector.getName());
+ pairs.add(otherLiveConnector.getName());
}
- ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
- pairs, false);
+ ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1",
+ "jms",
+ liveConnector.getName(),
+ -1,
+ false,
+ false,
+ 1,
+ 1,
+ pairs,
+ false);
config0.getClusterConfigurations().add(ccc0);
config0.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
@@ -191,7 +204,7 @@
config0.setJournalDirectory(config0.getJournalDirectory() + "_" + liveNode);
config0.setPagingDirectory(config0.getPagingDirectory() + "_" + liveNode);
config0.setLargeMessagesDirectory(config0.getLargeMessagesDirectory() + "_" + liveNode);
-
+
return config0;
}
}
@@ -204,13 +217,13 @@
return createBackupConfiguration(0, 0, false, 1, 2, 3, 4, 5);
}
}
-
+
public static class SharedBackupServerConfiguration1 extends RemoteServerConfiguration
{
@Override
public Configuration getConfiguration()
{
- return createBackupConfiguration(0, 1, false, 0, 2, 3, 4, 5);
+ return createBackupConfiguration(0, 1, false, 0, 2, 3, 4, 5);
}
}
@@ -219,7 +232,7 @@
@Override
public Configuration getConfiguration()
{
- return createBackupConfiguration(0, 2, false, 0, 1, 3, 4, 5);
+ return createBackupConfiguration(0, 2, false, 0, 1, 3, 4, 5);
}
}
@@ -228,7 +241,7 @@
@Override
public Configuration getConfiguration()
{
- return createBackupConfiguration(0, 3, false, 0, 1, 2, 4, 5);
+ return createBackupConfiguration(0, 3, false, 0, 1, 2, 4, 5);
}
}
@@ -237,7 +250,7 @@
@Override
public Configuration getConfiguration()
{
- return createBackupConfiguration(0, 4, false, 0, 1, 2, 3, 5);
+ return createBackupConfiguration(0, 4, false, 0, 1, 2, 3, 5);
}
}
@@ -246,13 +259,16 @@
@Override
public Configuration getConfiguration()
{
- return createBackupConfiguration(0, 5, false, 0, 1, 2, 3, 4);
+ return createBackupConfiguration(0, 5, false, 0, 1, 2, 3, 4);
}
}
- protected static Configuration createBackupConfiguration(int liveNode, int nodeid, boolean createClusterConnections, int... nodes)
+ protected static Configuration createBackupConfiguration(int liveNode,
+ int nodeid,
+ boolean createClusterConnections,
+ int... nodes)
{
- Configuration config1 = new ConfigurationImpl();
+ Configuration config1 = createBasicConfig();
config1.getAcceptorConfigurations().add(createTransportConfiguration(true, true, generateParams(nodeid, true)));
config1.setSecurityEnabled(false);
config1.setSharedStore(true);
@@ -269,12 +285,21 @@
}
TransportConfiguration backupConnector = createTransportConfiguration(true, false, generateParams(nodeid, true));
List<String> pairs = null;
- ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1,
- createClusterConnections? staticConnectors:pairs, false);
+ ClusterConnectionConfiguration ccc1 = new ClusterConnectionConfiguration("cluster1",
+ "jms",
+ backupConnector.getName(),
+ -1,
+ false,
+ false,
+ 1,
+ 1,
+ createClusterConnections ? staticConnectors
+ : pairs,
+ false);
config1.getClusterConfigurations().add(ccc1);
config1.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
-System.out.println(config1.getBindingsDirectory());
+ System.out.println(config1.getBindingsDirectory());
config1.setBindingsDirectory(config1.getBindingsDirectory() + "_" + liveNode);
config1.setJournalDirectory(config1.getJournalDirectory() + "_" + liveNode);
config1.setPagingDirectory(config1.getPagingDirectory() + "_" + liveNode);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -27,7 +27,6 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
import org.hornetq.core.server.JournalType;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
@@ -61,7 +60,7 @@
@Override
public Configuration getConfiguration()
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setSecurityEnabled(false);
config.setJournalType(JournalType.NIO);
config.setSharedStore(true);
@@ -89,7 +88,7 @@
@Override
public Configuration getConfiguration()
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setSecurityEnabled(false);
config.setJournalType(JournalType.NIO);
config.setSharedStore(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -35,7 +35,7 @@
@Override
protected void start() throws Exception
{
- Configuration liveConf = new ConfigurationImpl();
+ Configuration liveConf = createDefaultConfig();
liveConf.setSecurityEnabled(false);
liveConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -36,7 +36,7 @@
@Override
protected void start() throws Exception
{
- Configuration liveConf = new ConfigurationImpl();
+ Configuration liveConf = createDefaultConfig();
liveConf.setJMXManagementEnabled(false);
liveConf.setSecurityEnabled(false);
liveConf.getAcceptorConfigurations().clear();
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -1469,7 +1469,7 @@
private void start() throws Exception
{
- Configuration liveConf = new ConfigurationImpl();
+ Configuration liveConf = createDefaultConfig();
liveConf.setSecurityEnabled(false);
liveConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
Modified: trunk/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/http/CoreClientOverHttpTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -39,7 +39,7 @@
{
final SimpleString QUEUE = new SimpleString("CoreClientOverHttpTestQueue");
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
@@ -51,7 +51,8 @@
server.start();
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(), params));
+ ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(),
+ params));
ClientSessionFactory sf = locator.createSessionFactory();
ClientSession session = sf.createSession(false, true, true);
@@ -65,10 +66,10 @@
for (int i = 0; i < numMessages; i++)
{
ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
- false,
- 0,
- System.currentTimeMillis(),
- (byte)1);
+ false,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
message.getBodyBuffer().writeString("CoreClientOverHttpTest");
producer.send(message);
}
@@ -90,7 +91,6 @@
locator.close();
-
server.stop();
}
@@ -98,7 +98,7 @@
{
final SimpleString QUEUE = new SimpleString("CoreClientOverHttpTestQueue");
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
@@ -110,7 +110,8 @@
server.start();
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(), params));
+ ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(),
+ params));
locator.setConnectionTTL(500);
ClientSessionFactory sf = locator.createSessionFactory();
@@ -129,12 +130,12 @@
server.stop();
}
- //https://issues.jboss.org/browse/JBPAPP-5542
+ // https://issues.jboss.org/browse/JBPAPP-5542
public void testCoreHttpClient8kPlus() throws Exception
{
final SimpleString QUEUE = new SimpleString("CoreClientOverHttpTestQueue");
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
@@ -146,7 +147,8 @@
server.start();
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(), params));
+ ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName(),
+ params));
ClientSessionFactory sf = locator.createSessionFactory();
ClientSession session = sf.createSession(false, true, true);
@@ -158,15 +160,15 @@
final int numMessages = 100;
String[] content = new String[numMessages];
-
+
for (int i = 0; i < numMessages; i++)
{
ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
- false,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- content[i] = this.getFixedSizeString(i*1024*8);
+ false,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
+ content[i] = this.getFixedSizeString(((i % 5) + 1) * 1024 * 8);
message.getBodyBuffer().writeString(content[i]);
producer.send(message);
}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/FloodServerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/FloodServerTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/FloodServerTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -80,7 +80,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -704,7 +704,7 @@
private void startServer() throws Exception
{
- Configuration liveConf = new ConfigurationImpl();
+ Configuration liveConf = createBasicConfig();
liveConf.setSecurityEnabled(false);
liveTC = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory");
liveConf.getAcceptorConfigurations()
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -156,7 +156,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -109,7 +109,9 @@
super.setUp();
// Start the servers
- Configuration conf0 = new ConfigurationImpl();
+ Configuration conf0 = createBasicConfig();
+ conf0.setJournalDirectory(getJournalDir(0, false));
+ conf0.setBindingsDirectory(getBindingsDir(0, false));
conf0.setSecurityEnabled(false);
conf0.getAcceptorConfigurations()
.add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
@@ -120,8 +122,10 @@
jmsServer0.setContext(context0);
jmsServer0.start();
- Configuration conf1 = new ConfigurationImpl();
+ Configuration conf1 = createBasicConfig();
conf1.setSecurityEnabled(false);
+ conf1.setJournalDirectory(getJournalDir(1, false));
+ conf1.setBindingsDirectory(getBindingsDir(1, false));
params1 = new HashMap<String, Object>();
params1.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
conf1.getAcceptorConfigurations()
@@ -181,11 +185,11 @@
server0.stop();
cff0 = cff1 = null;
-
+
cff0xa = cff1xa = null;
cf0 = cf1 = null;
-
+
cf0xa = cf1xa = null;
sourceQueueFactory = targetQueueFactory = localTargetQueueFactory = sourceTopicFactory = null;
@@ -215,7 +219,8 @@
{
public ConnectionFactory createConnectionFactory() throws Exception
{
- HornetQConnectionFactory cf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ HornetQConnectionFactory cf = (HornetQConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
+ new TransportConfiguration(InVMConnectorFactory.class.getName()));
// Note! We disable automatic reconnection on the session factory. The bridge needs to do the reconnection
cf.setReconnectAttempts(0);
@@ -223,7 +228,7 @@
cf.setBlockOnDurableSend(true);
cf.setCacheLargeMessagesClient(true);
- return (ConnectionFactory) cf;
+ return (ConnectionFactory)cf;
}
};
@@ -232,7 +237,8 @@
{
public Object createConnectionFactory() throws Exception
{
- HornetQXAConnectionFactory cf = (HornetQXAConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF,new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ HornetQXAConnectionFactory cf = (HornetQXAConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF,
+ new TransportConfiguration(InVMConnectorFactory.class.getName()));
// Note! We disable automatic reconnection on the session factory. The bridge needs to do the reconnection
cf.setReconnectAttempts(0);
@@ -253,8 +259,9 @@
public ConnectionFactory createConnectionFactory() throws Exception
{
- HornetQJMSConnectionFactory cf = (HornetQJMSConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(InVMConnectorFactory.class.getName(),
- params1));
+ HornetQJMSConnectionFactory cf = (HornetQJMSConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
+ new TransportConfiguration(InVMConnectorFactory.class.getName(),
+ params1));
// Note! We disable automatic reconnection on the session factory. The bridge needs to do the reconnection
cf.setReconnectAttempts(0);
@@ -271,8 +278,9 @@
public XAConnectionFactory createConnectionFactory() throws Exception
{
- HornetQXAConnectionFactory cf = (HornetQXAConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF, new TransportConfiguration(InVMConnectorFactory.class.getName(),
- params1));
+ HornetQXAConnectionFactory cf = (HornetQXAConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.XA_CF,
+ new TransportConfiguration(InVMConnectorFactory.class.getName(),
+ params1));
// Note! We disable automatic reconnection on the session factory. The bridge needs to do the reconnection
cf.setReconnectAttempts(0);
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -58,7 +58,7 @@
import org.hornetq.tests.integration.jms.server.management.JMSUtil;
import org.hornetq.tests.unit.util.InVMContext;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.UnitTestCase;
+import org.hornetq.tests.util.ServiceTestBase;
/**
*
@@ -73,33 +73,36 @@
*
*
*/
-public class JMSFailoverTest extends UnitTestCase
+public class JMSFailoverTest extends ServiceTestBase
{
private static final Logger log = Logger.getLogger(JMSFailoverTest.class);
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
-
+
protected InVMContext ctx1 = new InVMContext();
-
+
protected InVMContext ctx2 = new InVMContext();
-
+
protected Configuration backupConf;
-
+
protected Configuration liveConf;
-
+
protected JMSServerManager liveJMSService;
protected HornetQServer liveService;
-
+
protected JMSServerManager backupJMSService;
protected HornetQServer backupService;
protected Map<String, Object> backupParams = new HashMap<String, Object>();
+
private TransportConfiguration backuptc;
+
private TransportConfiguration livetc;
+
private TransportConfiguration liveAcceptortc;
private TransportConfiguration backupAcceptortc;
@@ -131,19 +134,17 @@
JMSUtil.crash(liveService, coreSession);
-
assertNotNull(ctx2.lookup("/queue/queue1"));
}
finally
{
- if(conn != null)
+ if (conn != null)
{
conn.close();
}
}
}
-
public void testCreateTopic() throws Exception
{
liveJMSService.createTopic(true, "topic", "/topic/t1");
@@ -169,7 +170,7 @@
}
finally
{
- if(conn != null)
+ if (conn != null)
{
conn.close();
}
@@ -232,7 +233,7 @@
Thread.sleep(2000);
- JMSUtil.crash(liveService, ((HornetQSession) sess).getCoreSession());
+ JMSUtil.crash(liveService, ((HornetQSession)sess).getCoreSession());
for (int i = 0; i < numMessages; i++)
{
@@ -255,13 +256,15 @@
public void testManualFailover() throws Exception
{
- HornetQConnectionFactory jbcfLive = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
+ HornetQConnectionFactory jbcfLive = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
+ new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
jbcfLive.setBlockOnNonDurableSend(true);
jbcfLive.setBlockOnDurableSend(true);
- HornetQConnectionFactory jbcfBackup = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory",
- backupParams));
+ HornetQConnectionFactory jbcfBackup = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
+ new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory",
+ backupParams));
jbcfBackup.setBlockOnNonDurableSend(true);
jbcfBackup.setBlockOnDurableSend(true);
jbcfBackup.setInitialConnectAttempts(-1);
@@ -345,25 +348,31 @@
protected void startServers() throws Exception
{
NodeManager nodeManager = new InVMNodeManager();
- backuptc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory",
- backupParams);
+ backuptc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory", backupParams);
livetc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory");
liveAcceptortc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory");
-
backupAcceptortc = new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory",
- backupParams);
-
- backupConf = new ConfigurationImpl();
+ backupParams);
+ backupConf = createBasicConfig(0);
+
backupConf.getAcceptorConfigurations().add(backupAcceptortc);
backupConf.getConnectorConfigurations().put(livetc.getName(), livetc);
backupConf.getConnectorConfigurations().put(backuptc.getName(), backuptc);
ArrayList<String> staticConnectors = new ArrayList<String>();
staticConnectors.add(livetc.getName());
- ClusterConnectionConfiguration cccBackup = new ClusterConnectionConfiguration("cluster1", "jms", backuptc.getName(), -1, false, false, 1, 1,
- staticConnectors, false);
+ ClusterConnectionConfiguration cccBackup = new ClusterConnectionConfiguration("cluster1",
+ "jms",
+ backuptc.getName(),
+ -1,
+ false,
+ false,
+ 1,
+ 1,
+ staticConnectors,
+ false);
backupConf.getClusterConfigurations().add(cccBackup);
backupConf.setSecurityEnabled(false);
@@ -383,20 +392,29 @@
backupService = new InVMNodeManagerServer(backupConf, nodeManager);
backupJMSService = new JMSServerManagerImpl(backupService);
-
+
backupJMSService.setContext(ctx2);
-
+
backupJMSService.start();
-
+ liveConf = createBasicConfig(0);
- liveConf = new ConfigurationImpl();
+ liveConf.setJournalDirectory(getJournalDir());
+ liveConf.setBindingsDirectory(getBindingsDir());
+
liveConf.setSecurityEnabled(false);
- liveConf.getAcceptorConfigurations()
- .add(liveAcceptortc);
- List<String> pairs = null;
- ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", livetc.getName(), -1, false, false, 1, 1,
- pairs, false);
+ liveConf.getAcceptorConfigurations().add(liveAcceptortc);
+ List<String> pairs = null;
+ ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1",
+ "jms",
+ livetc.getName(),
+ -1,
+ false,
+ false,
+ 1,
+ 1,
+ pairs,
+ false);
liveConf.getClusterConfigurations().add(ccc0);
liveConf.setSharedStore(true);
liveConf.setJournalType(getDefaultJournalType());
@@ -409,14 +427,14 @@
liveConf.setPersistenceEnabled(true);
liveConf.setClustered(true);
liveService = new InVMNodeManagerServer(liveConf, nodeManager);
-
+
liveJMSService = new JMSServerManagerImpl(liveService);
-
+
liveJMSService.setContext(ctx1);
liveJMSService.start();
- JMSUtil.waitForServer(backupService);
+ JMSUtil.waitForServer(backupService);
}
@Override
@@ -429,13 +447,13 @@
Assert.assertEquals(0, InVMRegistry.instance.size());
liveService = null;
-
+
liveJMSService = null;
-
+
backupJMSService = null;
-
+
ctx1 = null;
-
+
ctx2 = null;
backupService = null;
@@ -459,11 +477,11 @@
}
}
-
// Inner classes -------------------------------------------------
class InVMNodeManagerServer extends HornetQServerImpl
{
final NodeManager nodeManager;
+
public InVMNodeManagerServer(NodeManager nodeManager)
{
super();
@@ -482,13 +500,18 @@
this.nodeManager = nodeManager;
}
- public InVMNodeManagerServer(Configuration configuration, HornetQSecurityManager securityManager, NodeManager nodeManager)
+ public InVMNodeManagerServer(Configuration configuration,
+ HornetQSecurityManager securityManager,
+ NodeManager nodeManager)
{
super(configuration, securityManager);
this.nodeManager = nodeManager;
}
- public InVMNodeManagerServer(Configuration configuration, MBeanServer mbeanServer, HornetQSecurityManager securityManager, NodeManager nodeManager)
+ public InVMNodeManagerServer(Configuration configuration,
+ MBeanServer mbeanServer,
+ HornetQSecurityManager securityManager,
+ NodeManager nodeManager)
{
super(configuration, mbeanServer, securityManager);
this.nodeManager = nodeManager;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -323,7 +323,7 @@
{
super.setUp();
- Configuration liveConf = new ConfigurationImpl();
+ Configuration liveConf = createBasicConfig();
liveConf.setSecurityEnabled(false);
liveConf.setJournalType(getDefaultJournalType());
liveConf.getAcceptorConfigurations()
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -48,7 +48,7 @@
@Override
protected void startServers() throws Exception
{
- backupConf = new ConfigurationImpl();
+ backupConf = createBasicConfig();
backupConf.setJournalType(getDefaultJournalType());
backupConf.setSecurityEnabled(false);
backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
@@ -71,7 +71,7 @@
- liveConf = new ConfigurationImpl();
+ liveConf = createBasicConfig();
liveConf.setSecurityEnabled(false);
liveConf.setJournalType(getDefaultJournalType());
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/connection/ExceptionListenerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/connection/ExceptionListenerTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/connection/ExceptionListenerTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -61,7 +61,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations()
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -335,7 +335,7 @@
{
super.setUp();
- config = new ConfigurationImpl();
+ config = createBasicConfig();
config.getConnectorConfigurations().put("netty",
new TransportConfiguration(NettyConnectorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -1064,7 +1064,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -87,7 +87,7 @@
private void startHornetQServer(final String acceptorFactory) throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(acceptorFactory));
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -580,7 +580,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
@@ -652,7 +652,7 @@
private JMSServerManager startHornetQServer(final int discoveryPort) throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getDiscoveryGroupConfigurations()
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -494,7 +494,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations()
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -420,7 +420,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations()
Modified: trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -36,7 +36,7 @@
{
public void testConfigureJULViaConfiguration() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
String className = JULLogDelegateFactory.class.getCanonicalName();
@@ -55,7 +55,7 @@
public void testConfigureLog4jViaConfiguration() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
String className = Log4jLogDelegateFactory.class.getCanonicalName();
@@ -105,7 +105,7 @@
public void testDefaultWithConfiguration() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
HornetQServer server = super.createServer(false, config);
@@ -120,7 +120,7 @@
public void testUserDefinedLogger() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
String className = MyLogDelegateFactory.class.getCanonicalName();
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -69,7 +69,7 @@
new HashMap<String, Object>(),
RandomUtil.randomString());
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(acceptorConfig);
@@ -87,7 +87,7 @@
TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(),
new HashMap<String, Object>(),
RandomUtil.randomString());
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(acceptorConfig);
@@ -147,7 +147,7 @@
TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(),
new HashMap<String, Object>(),
RandomUtil.randomString());
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(acceptorConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -298,7 +298,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -180,7 +180,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -177,14 +177,14 @@
ConfigurationImpl.DEFAULT_CLUSTER_USER,
ConfigurationImpl.DEFAULT_CLUSTER_PASSWORD);
- Configuration conf_1 = new ConfigurationImpl();
+ Configuration conf_1 = createBasicConfig();
conf_1.setSecurityEnabled(false);
conf_1.setJMXManagementEnabled(true);
conf_1.setClustered(true);
conf_1.getAcceptorConfigurations().add(acceptorConfig);
conf_1.getQueueConfigurations().add(targetQueueConfig);
- Configuration conf_0 = new ConfigurationImpl();
+ Configuration conf_0 = createBasicConfig();
conf_0.setSecurityEnabled(false);
conf_0.setJMXManagementEnabled(true);
conf_0.setClustered(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlUsingCoreTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlUsingCoreTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -155,14 +155,14 @@
ConfigurationImpl.DEFAULT_CLUSTER_USER,
ConfigurationImpl.DEFAULT_CLUSTER_PASSWORD);
- Configuration conf_1 = new ConfigurationImpl();
+ Configuration conf_1 = createBasicConfig();
conf_1.setSecurityEnabled(false);
conf_1.setJMXManagementEnabled(true);
conf_1.setClustered(true);
conf_1.getAcceptorConfigurations().add(acceptorConfig);
conf_1.getQueueConfigurations().add(targetQueueConfig);
- Configuration conf_0 = new ConfigurationImpl();
+ Configuration conf_0 = createBasicConfig();
conf_0.setSecurityEnabled(false);
conf_0.setJMXManagementEnabled(true);
conf_0.setClustered(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/BroadcastGroupControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/BroadcastGroupControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/BroadcastGroupControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -79,7 +79,7 @@
connectorInfos.add(connectorConfiguration.getName());
BroadcastGroupConfiguration broadcastGroupConfig = BroadcastGroupControlTest.randomBroadcastGroupConfiguration(connectorInfos);
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.setClustered(true);
@@ -118,7 +118,7 @@
connectorInfos.add(connectorConfiguration.getName());
BroadcastGroupConfiguration broadcastGroupConfig = BroadcastGroupControlTest.randomBroadcastGroupConfiguration(connectorInfos);
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.setClustered(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -155,7 +155,7 @@
0,
0);
- Configuration conf_1 = new ConfigurationImpl();
+ Configuration conf_1 = createBasicConfig();
conf_1.setSecurityEnabled(false);
conf_1.setJMXManagementEnabled(true);
conf_1.setClustered(true);
@@ -165,7 +165,7 @@
conf_1.getDiscoveryGroupConfigurations().put(discoveryName, discoveryGroupConfig);
conf_1.getBroadcastGroupConfigurations().add(broadcastGroupConfig);
- Configuration conf_0 = new ConfigurationImpl();
+ Configuration conf_0 = createBasicConfig();
conf_0.setSecurityEnabled(false);
conf_0.setJMXManagementEnabled(true);
conf_0.setClustered(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -226,14 +226,14 @@
RandomUtil.randomPositiveInt(),
discoveryGroupName);
- Configuration conf_1 = new ConfigurationImpl();
+ Configuration conf_1 = createBasicConfig();
conf_1.setSecurityEnabled(false);
conf_1.setJMXManagementEnabled(true);
conf_1.setClustered(true);
conf_1.getAcceptorConfigurations().add(acceptorConfig);
conf_1.getQueueConfigurations().add(queueConfig);
- Configuration conf_0 = new ConfigurationImpl();
+ Configuration conf_0 = createBasicConfig();
conf_0.setSecurityEnabled(false);
conf_0.setJMXManagementEnabled(true);
conf_0.setClustered(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/DivertControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/DivertControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/DivertControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -100,7 +100,7 @@
RandomUtil.randomBoolean(),
null,
null);
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.setClustered(true);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/JMXDomainTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/JMXDomainTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/JMXDomainTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -53,7 +53,7 @@
String jmxDomain_1 = ConfigurationImpl.DEFAULT_JMX_DOMAIN + ".1";
- Configuration config_1 = new ConfigurationImpl();
+ Configuration config_1 = createBasicConfig();
Map<String, Object> params = new HashMap<String, Object>();
params.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
config_1.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName(), params));
Modified: trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -59,7 +59,7 @@
String queue = RandomUtil.randomString();
String address = RandomUtil.randomString();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setJMXManagementEnabled(false);
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
@@ -78,7 +78,7 @@
public void testHandleManagementMessageWithOperationWhichFails() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setJMXManagementEnabled(false);
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
@@ -97,7 +97,7 @@
public void testHandleManagementMessageWithUnknowResource() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setJMXManagementEnabled(false);
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
@@ -116,7 +116,7 @@
public void testHandleManagementMessageWithUnknownAttribute() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setJMXManagementEnabled(false);
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
@@ -136,7 +136,7 @@
public void testHandleManagementMessageWithKnownAttribute() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setJMXManagementEnabled(false);
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
@@ -156,7 +156,7 @@
public void testGetResources() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setJMXManagementEnabled(false);
ManagementServiceImpl managementService = new ManagementServiceImpl(null, conf);
managementService.setStorageManager(new NullStorageManager());
Modified: trunk/tests/src/org/hornetq/tests/integration/management/ManagementWithStompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ManagementWithStompTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ManagementWithStompTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -165,7 +165,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
Map<String, Object> params = new HashMap<String, Object>();
Modified: trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -208,7 +208,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
// the notifications are independent of JMX
conf.setJMXManagementEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -1308,7 +1308,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -85,7 +85,7 @@
@Override
protected HornetQServer setupAndStartHornetQServer() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithDefaultConfigurationTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -62,7 +62,7 @@
@Override
protected HornetQServer setupAndStartHornetQServer() throws Exception
{
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
HornetQServer server = HornetQServers.newHornetQServer(conf, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithModifiedConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithModifiedConfigurationTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/SecurityManagementWithModifiedConfigurationTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -68,7 +68,7 @@
@Override
protected HornetQServer setupAndStartHornetQServer() throws Exception
{
- ConfigurationImpl conf = new ConfigurationImpl();
+ ConfigurationImpl conf = createBasicConfig();
conf.setSecurityEnabled(true);
conf.setClusterPassword(configuredClusterPassword);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -138,7 +138,7 @@
{
super.setUp();
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createBasicConfig();
conf.setSecurityEnabled(true);
// the notifications are independent of JMX
conf.setJMXManagementEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -68,7 +68,7 @@
TransportConfiguration tc = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.getAcceptorConfigurations().add(tc);
config.setSecurityEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -78,7 +78,7 @@
TransportConfiguration tc = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.getAcceptorConfigurations().add(tc);
config.setSecurityEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/security/NettySecurityClientTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/security/NettySecurityClientTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/security/NettySecurityClientTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -72,7 +72,7 @@
{
super.setUp();
- ConfigurationImpl config = new ConfigurationImpl();
+ ConfigurationImpl config = createBasicConfig();
config.setSecurityEnabled(false);
config.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
messagingService = HornetQServers.newHornetQServer(config, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -248,7 +248,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ ConfigurationImpl configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
configuration.setMessageExpiryScanPeriod(1000);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
Modified: trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -589,7 +589,7 @@
{
super.setUp();
- ConfigurationImpl configuration = new ConfigurationImpl();
+ ConfigurationImpl configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
configuration.getAcceptorConfigurations().add(transportConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -140,7 +140,7 @@
@Override
protected void setUp() throws Exception
{
- ConfigurationImpl config = new ConfigurationImpl();
+ ConfigurationImpl config = createBasicConfig();
config.setSecurityEnabled(false);
Map<String, Object> params = new HashMap<String, Object>();
params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompTestBase.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompTestBase.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -108,7 +108,7 @@
*/
protected JMSServerManager createServer() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setSecurityEnabled(false);
config.setPersistenceEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompWebSocketTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompWebSocketTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompWebSocketTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -20,12 +20,9 @@
import java.util.HashMap;
import java.util.Map;
-import junit.framework.TestCase;
-
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.CoreQueueConfiguration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory;
@@ -37,8 +34,9 @@
import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.spi.core.protocol.ProtocolType;
+import org.hornetq.tests.util.UnitTestCase;
-public class StompWebSocketTest extends TestCase {
+public class StompWebSocketTest extends UnitTestCase {
private static final transient Logger log = Logger.getLogger(StompWebSocketTest.class);
private JMSServerManager server;
@@ -64,7 +62,7 @@
*/
private JMSServerManager createServer() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setSecurityEnabled(false);
config.setPersistenceEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -71,7 +71,7 @@
super.setUp();
addressSettings.clear();
- configuration = new ConfigurationImpl();
+ configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
configuration.setTransactionTimeoutScanPeriod(500);
TransportConfiguration transportConfig = new TransportConfiguration(UnitTestCase.INVM_ACCEPTOR_FACTORY);
Modified: trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -99,7 +99,7 @@
private HornetQServer createServer() throws Exception
{
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setSecurityEnabled(false);
config.setPersistenceEnabled(false);
Modified: trunk/tests/src/org/hornetq/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -527,7 +527,7 @@
{
super.setUp();
- Configuration config = new ConfigurationImpl();
+ Configuration config = createBasicConfig();
config.setFileDeploymentEnabled(false);
config.setSecurityEnabled(false);
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
Modified: trunk/tests/src/org/hornetq/tests/unit/jms/misc/ManifestTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/jms/misc/ManifestTest.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/unit/jms/misc/ManifestTest.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -67,7 +67,7 @@
try
{
- HornetQServer server = HornetQServers.newHornetQServer(new ConfigurationImpl());
+ HornetQServer server = HornetQServers.newHornetQServer(createBasicConfig());
ConnectionMetaData meta = new HornetQConnectionMetaData(server.getVersion());
Modified: trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -348,93 +348,6 @@
new HashMap<String, AddressSettings>());
}
}
-
- protected Configuration createDefaultConfig()
- {
- return createDefaultConfig(false);
- }
-
- protected Configuration createDefaultConfig(final boolean netty)
- {
- if (netty)
- {
- return createDefaultConfig(new HashMap<String, Object>(),
- INVM_ACCEPTOR_FACTORY,
- NETTY_ACCEPTOR_FACTORY);
- }
- else
- {
- return createDefaultConfig(new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY);
- }
- }
-
- protected Configuration createClusteredDefaultConfig(final int index,
- final Map<String, Object> params,
- final String... acceptors)
- {
- Configuration config = createDefaultConfig(index, params, acceptors);
-
- config.setClustered(true);
-
- return config;
- }
-
- protected Configuration createDefaultConfig(final int index,
- final Map<String, Object> params,
- final String... acceptors)
- {
- Configuration configuration = new ConfigurationImpl();
- configuration.setSecurityEnabled(false);
- configuration.setBindingsDirectory(getBindingsDir(index, false));
- configuration.setJournalMinFiles(2);
- configuration.setJournalDirectory(getJournalDir(index, false));
- configuration.setJournalFileSize(100 * 1024);
- configuration.setJournalType(getDefaultJournalType());
- configuration.setPagingDirectory(getPageDir(index, false));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(index, false));
- configuration.setJournalCompactMinFiles(0);
- configuration.setJournalCompactPercentage(0);
-
- configuration.getAcceptorConfigurations().clear();
-
- for (String acceptor : acceptors)
- {
- TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
- configuration.getAcceptorConfigurations().add(transportConfig);
- }
-
- return configuration;
- }
-
- protected static Configuration createDefaultConfig(final Map<String, Object> params, final String... acceptors)
- {
- Configuration configuration = new ConfigurationImpl();
- configuration.setSecurityEnabled(false);
- configuration.setJMXManagementEnabled(false);
- configuration.setBindingsDirectory(getBindingsDir());
- configuration.setJournalMinFiles(2);
- configuration.setJournalDirectory(getJournalDir());
- configuration.setJournalFileSize(100 * 1024);
- configuration.setPagingDirectory(getPageDir());
- configuration.setLargeMessagesDirectory(getLargeMessagesDir());
- configuration.setJournalCompactMinFiles(0);
- configuration.setJournalCompactPercentage(0);
-
- configuration.setFileDeploymentEnabled(false);
-
- configuration.setJournalType(getDefaultJournalType());
-
- configuration.getAcceptorConfigurations().clear();
-
- for (String acceptor : acceptors)
- {
- TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
- configuration.getAcceptorConfigurations().add(transportConfig);
- }
-
- return configuration;
- }
-
protected ServerLocator createFactory(final boolean isNetty) throws Exception
{
if (isNetty)
Modified: trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java 2010-12-29 20:51:10 UTC (rev 10088)
+++ trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java 2010-12-30 02:44:46 UTC (rev 10089)
@@ -31,6 +31,7 @@
import java.net.ServerSocket;
import java.nio.ByteBuffer;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -53,6 +54,8 @@
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
@@ -104,6 +107,109 @@
// Static --------------------------------------------------------
+ protected Configuration createDefaultConfig()
+ {
+ return createDefaultConfig(false);
+ }
+
+ protected Configuration createDefaultConfig(final boolean netty)
+ {
+ if (netty)
+ {
+ return createDefaultConfig(new HashMap<String, Object>(),
+ INVM_ACCEPTOR_FACTORY,
+ NETTY_ACCEPTOR_FACTORY);
+ }
+ else
+ {
+ return createDefaultConfig(new HashMap<String, Object>(), INVM_ACCEPTOR_FACTORY);
+ }
+ }
+
+ protected static Configuration createClusteredDefaultConfig(final int index,
+ final Map<String, Object> params,
+ final String... acceptors)
+ {
+ Configuration config = createDefaultConfig(index, params, acceptors);
+
+ config.setClustered(true);
+
+ return config;
+ }
+
+ protected static Configuration createDefaultConfig(final int index,
+ final Map<String, Object> params,
+ final String... acceptors)
+ {
+ Configuration configuration = createBasicConfig(index);
+
+ configuration.getAcceptorConfigurations().clear();
+
+ for (String acceptor : acceptors)
+ {
+ TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
+ configuration.getAcceptorConfigurations().add(transportConfig);
+ }
+
+ return configuration;
+ }
+
+ protected static ConfigurationImpl createBasicConfig()
+ {
+ return createBasicConfig(0);
+ }
+
+
+ /**
+ * @param serverID
+ * @return
+ */
+ protected static ConfigurationImpl createBasicConfig(final int serverID)
+ {
+ ConfigurationImpl configuration = new ConfigurationImpl();
+ configuration.setSecurityEnabled(false);
+ configuration.setBindingsDirectory(getBindingsDir(serverID, false));
+ configuration.setJournalMinFiles(2);
+ configuration.setJournalDirectory(getJournalDir(serverID, false));
+ configuration.setJournalFileSize(100 * 1024);
+ configuration.setJournalType(getDefaultJournalType());
+ configuration.setPagingDirectory(getPageDir(serverID, false));
+ configuration.setLargeMessagesDirectory(getLargeMessagesDir(serverID, false));
+ configuration.setJournalCompactMinFiles(0);
+ configuration.setJournalCompactPercentage(0);
+ return configuration;
+ }
+
+ protected static Configuration createDefaultConfig(final Map<String, Object> params, final String... acceptors)
+ {
+ Configuration configuration = new ConfigurationImpl();
+ configuration.setSecurityEnabled(false);
+ configuration.setJMXManagementEnabled(false);
+ configuration.setBindingsDirectory(getBindingsDir());
+ configuration.setJournalMinFiles(2);
+ configuration.setJournalDirectory(getJournalDir());
+ configuration.setJournalFileSize(100 * 1024);
+ configuration.setPagingDirectory(getPageDir());
+ configuration.setLargeMessagesDirectory(getLargeMessagesDir());
+ configuration.setJournalCompactMinFiles(0);
+ configuration.setJournalCompactPercentage(0);
+
+ configuration.setFileDeploymentEnabled(false);
+
+ configuration.setJournalType(getDefaultJournalType());
+
+ configuration.getAcceptorConfigurations().clear();
+
+ for (String acceptor : acceptors)
+ {
+ TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params);
+ configuration.getAcceptorConfigurations().add(transportConfig);
+ }
+
+ return configuration;
+ }
+
+
protected static String getUDPDiscoveryAddress()
{
return System.getProperty("TEST-UDP-ADDRESS", "230.1.2.3");
@@ -532,7 +638,7 @@
/**
* @return the bindingsDir
*/
- protected String getBindingsDir(final int index, final boolean backup)
+ protected static String getBindingsDir(final int index, final boolean backup)
{
return getBindingsDir(testDir) + index + "-" + (backup ? "B" : "L");
}
@@ -553,7 +659,7 @@
return testDir + "/page";
}
- protected String getPageDir(final int index, final boolean backup)
+ protected static String getPageDir(final int index, final boolean backup)
{
return getPageDir(testDir) + index + "-" + (backup ? "B" : "L");
}
13 years, 12 months
JBoss hornetq SVN: r10088 - trunk/tests/src/org/hornetq/tests/integration/jms/server/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-29 15:51:10 -0500 (Wed, 29 Dec 2010)
New Revision: 10088
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlRestartTest.java
Log:
Fixing test
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlRestartTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlRestartTest.java 2010-12-29 20:32:05 UTC (rev 10087)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlRestartTest.java 2010-12-29 20:51:10 UTC (rev 10088)
@@ -156,7 +156,7 @@
}
private JMSServerManager createJMSServer() throws Exception {
- Configuration conf = new ConfigurationImpl();
+ Configuration conf = createDefaultConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.setPersistenceEnabled(true);
13 years, 12 months
JBoss hornetq SVN: r10087 - in trunk/src/main/org/hornetq: jms/management/impl and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-29 15:32:05 -0500 (Wed, 29 Dec 2010)
New Revision: 10087
Modified:
trunk/src/main/org/hornetq/core/management/impl/AbstractControl.java
trunk/src/main/org/hornetq/core/management/impl/AcceptorControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/AddressControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/BroadcastGroupControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/ClusterConnectionControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/DivertControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
Log:
tweaks on management
Modified: trunk/src/main/org/hornetq/core/management/impl/AbstractControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/AbstractControl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/AbstractControl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -79,7 +79,7 @@
}
- abstract MBeanOperationInfo[] fillMBeanOperationInfo();
+ protected abstract MBeanOperationInfo[] fillMBeanOperationInfo();
@Override
public MBeanInfo getMBeanInfo()
Modified: trunk/src/main/org/hornetq/core/management/impl/AcceptorControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/AcceptorControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/AcceptorControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -135,7 +135,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(AcceptorControl.class);
}
Modified: trunk/src/main/org/hornetq/core/management/impl/AddressControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/AddressControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/AddressControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -209,7 +209,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(AddressControl.class);
}
Modified: trunk/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -249,7 +249,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(BridgeControl.class);
}
Modified: trunk/src/main/org/hornetq/core/management/impl/BroadcastGroupControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/BroadcastGroupControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/BroadcastGroupControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -201,7 +201,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(BroadcastGroupControl.class);
}
Modified: trunk/src/main/org/hornetq/core/management/impl/ClusterConnectionControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/ClusterConnectionControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/ClusterConnectionControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -263,7 +263,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(ClusterConnectionControl.class);
}
Modified: trunk/src/main/org/hornetq/core/management/impl/DivertControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/DivertControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/DivertControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -145,7 +145,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(DivertControl.class);
}
Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -1886,7 +1886,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(HornetQServerControl.class);
}
Modified: trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -831,7 +831,7 @@
}
@Override
- MBeanOperationInfo[] fillMBeanOperationInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(QueueControl.class);
}
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -28,7 +28,6 @@
import org.hornetq.core.management.impl.MBeanInfoHelper;
import org.hornetq.core.messagecounter.MessageCounter;
import org.hornetq.core.messagecounter.impl.MessageCounterHelper;
-import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
import org.hornetq.jms.client.HornetQDestination;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.jms.client.SelectorTranslator;
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-29 20:32:05 UTC (rev 10087)
@@ -21,14 +21,13 @@
import java.util.concurrent.atomic.AtomicLong;
import javax.management.ListenerNotFoundException;
-import javax.management.MBeanInfo;
import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
import javax.management.Notification;
import javax.management.NotificationBroadcasterSupport;
import javax.management.NotificationEmitter;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
-import javax.management.StandardMBean;
import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.jms.JMSFactoryType;
@@ -38,6 +37,7 @@
import org.hornetq.api.jms.management.JMSServerControl;
import org.hornetq.api.jms.management.TopicControl;
import org.hornetq.core.filter.Filter;
+import org.hornetq.core.management.impl.AbstractControl;
import org.hornetq.core.management.impl.MBeanInfoHelper;
import org.hornetq.core.server.ServerConsumer;
import org.hornetq.core.server.ServerSession;
@@ -55,7 +55,7 @@
* @version <tt>$Revision$</tt>
*
*/
-public class JMSServerControlImpl extends StandardMBean implements JMSServerControl, NotificationEmitter
+public class JMSServerControlImpl extends AbstractControl implements JMSServerControl, NotificationEmitter
{
// Constants -----------------------------------------------------
@@ -145,7 +145,7 @@
public JMSServerControlImpl(final JMSServerManager server) throws Exception
{
- super(JMSServerControl.class);
+ super(JMSServerControl.class, server.getHornetQServer().getStorageManager());
this.server = server;
broadcaster = new NotificationBroadcasterSupport();
}
@@ -688,22 +688,19 @@
}
}
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+ /* (non-Javadoc)
+ * @see org.hornetq.core.management.impl.AbstractControl#fillMBeanOperationInfo()
+ */
@Override
- public MBeanInfo getMBeanInfo()
+ protected MBeanOperationInfo[] fillMBeanOperationInfo()
{
- MBeanInfo info = super.getMBeanInfo();
- return new MBeanInfo(info.getClassName(),
- info.getDescription(),
- info.getAttributes(),
- info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControl.class),
- info.getNotifications());
+ return MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControl.class);
}
- // Package protected ---------------------------------------------
- // Protected -----------------------------------------------------
-
// Private -------------------------------------------------------
private void sendNotification(final NotificationType type, final String message)
@@ -719,34 +716,6 @@
throw new IllegalStateException("HornetQ JMS Server is not started. it can not be managed yet");
}
}
-
- protected void clearIO()
- {
- // the storage manager could be null on the backup on certain components
- if (server.getHornetQServer().getStorageManager() != null)
- {
- server.getHornetQServer().getStorageManager().clearContext();
- }
- }
-
- protected void blockOnIO()
- {
- // the storage manager could be null on the backup on certain components
- if (server.getHornetQServer().getStorageManager() != null)
- {
- try
- {
- server.getHornetQServer().getStorageManager().waitOnOperations();
- server.getHornetQServer().getStorageManager().clearContext();
- }
- catch (Exception e)
- {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- }
-
// Inner classes -------------------------------------------------
public static enum NotificationType
13 years, 12 months
JBoss hornetq SVN: r10086 - in trunk: src/main/org/hornetq/core/postoffice/impl and 5 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-29 12:43:44 -0500 (Wed, 29 Dec 2010)
New Revision: 10086
Modified:
trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
trunk/src/main/org/hornetq/core/server/ServerMessage.java
trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
trunk/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
Log:
HORNETQ-598 consider duplicate IDs during move message
Modified: trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -24,7 +24,6 @@
import org.hornetq.api.core.PropertyConversionException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.buffers.impl.ResetLimitWrappedHornetQBuffer;
-import org.hornetq.core.client.impl.LargeMessageController;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.message.BodyEncoder;
import org.hornetq.core.protocol.core.impl.PacketImpl;
Modified: trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -26,17 +26,14 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Message;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.management.ManagementHelper;
import org.hornetq.api.core.management.NotificationType;
import org.hornetq.core.filter.Filter;
import org.hornetq.core.journal.IOAsyncTask;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.paging.PageTransactionInfo;
import org.hornetq.core.paging.PagingManager;
import org.hornetq.core.paging.PagingStore;
-import org.hornetq.core.paging.impl.PageTransactionInfoImpl;
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.AddressManager;
import org.hornetq.core.postoffice.Binding;
@@ -64,7 +61,6 @@
import org.hornetq.core.transaction.TransactionOperation;
import org.hornetq.core.transaction.TransactionOperationAbstract;
import org.hornetq.core.transaction.TransactionPropertyIndexes;
-import org.hornetq.core.transaction.Transaction.State;
import org.hornetq.core.transaction.impl.TransactionImpl;
import org.hornetq.utils.TypedProperties;
import org.hornetq.utils.UUIDGenerator;
@@ -557,25 +553,14 @@
setPagingStore(message);
- Object duplicateID = message.getObjectProperty(Message.HDR_DUPLICATE_DETECTION_ID);
+ byte[] duplicateIDBytes = message.getDuplicateIDBytes();
DuplicateIDCache cache = null;
-
- byte[] duplicateIDBytes = null;
-
- if (duplicateID != null)
+
+ if (duplicateIDBytes != null)
{
cache = getDuplicateIDCache(message.getAddress());
- if (duplicateID instanceof SimpleString)
- {
- duplicateIDBytes = ((SimpleString)duplicateID).getData();
- }
- else
- {
- duplicateIDBytes = (byte[])duplicateID;
- }
-
if (cache.contains(duplicateIDBytes))
{
if (context.getTransaction() == null)
Modified: trunk/src/main/org/hornetq/core/server/ServerMessage.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/ServerMessage.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/src/main/org/hornetq/core/server/ServerMessage.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -13,7 +13,6 @@
package org.hornetq.core.server;
-import org.hornetq.api.core.SimpleString;
import org.hornetq.core.journal.EncodingSupport;
import org.hornetq.core.message.impl.MessageInternal;
import org.hornetq.core.paging.PagingStore;
@@ -59,4 +58,8 @@
boolean storeIsPaging();
void encodeMessageIDToBuffer();
+
+ byte [] getDuplicateIDBytes();
+
+ Object getDuplicateProperty();
}
Modified: trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -36,6 +36,7 @@
import org.hornetq.core.paging.cursor.PagedReference;
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.Bindings;
+import org.hornetq.core.postoffice.DuplicateIDCache;
import org.hornetq.core.postoffice.PostOffice;
import org.hornetq.core.server.Consumer;
import org.hornetq.core.server.HandleStatus;
@@ -981,7 +982,15 @@
{
iter.remove();
deliveringCount.incrementAndGet();
- move(toAddress, ref);
+ try
+ {
+ move(toAddress, ref);
+ }
+ catch (Exception e)
+ {
+ deliveringCount.decrementAndGet();
+ throw e;
+ }
return true;
}
}
@@ -993,32 +1002,69 @@
Transaction tx = new TransactionImpl(storageManager);
int count = 0;
- Iterator<MessageReference> iter = iterator();
- while (iter.hasNext())
+ try
{
- MessageReference ref = iter.next();
- if (filter == null || filter.match(ref.getMessage()))
+ Iterator<MessageReference> iter = iterator();
+
+ DuplicateIDCache targetDuplicateCache = postOffice.getDuplicateIDCache(toAddress);
+
+ while (iter.hasNext())
{
+ MessageReference ref = iter.next();
+ if (filter == null || filter.match(ref.getMessage()))
+ {
+ boolean ignored = false;
+
+ deliveringCount.incrementAndGet();
+ count++;
+
+ byte [] duplicateBytes = ref.getMessage().getDuplicateIDBytes();
+ if (duplicateBytes != null)
+ {
+ if (targetDuplicateCache.contains(duplicateBytes))
+ {
+ log.info("Message with duplicate ID " + ref.getMessage().getDuplicateProperty() + " was already set at " + toAddress + ". Move from " + this.address + " being ignored and message removed from " + this.address);
+ acknowledge(tx, ref);
+ ignored = true;
+ }
+ }
+ if (!ignored)
+ {
+ move(toAddress, tx, ref, false);
+ }
+ iter.remove();
+ }
+ }
+
+ List<MessageReference> cancelled = scheduledDeliveryHandler.cancel(filter);
+ for (MessageReference ref : cancelled)
+ {
+ byte [] duplicateBytes = ref.getMessage().getDuplicateIDBytes();
+ if (duplicateBytes != null)
+ {
+ if (targetDuplicateCache.contains(duplicateBytes))
+ {
+ log.info("Message with duplicate ID " + ref.getMessage().getDuplicateProperty() + " was already set at " + toAddress + ". Move from " + this.address + " being ignored");
+ continue;
+ }
+ }
+
deliveringCount.incrementAndGet();
+ count++;
move(toAddress, tx, ref, false);
- iter.remove();
- count++;
+ acknowledge(tx, ref);
}
+
+ tx.commit();
+
+ return count;
}
-
- List<MessageReference> cancelled = scheduledDeliveryHandler.cancel(filter);
- for (MessageReference ref : cancelled)
+ catch (Exception e)
{
- deliveringCount.incrementAndGet();
- move(toAddress, tx, ref, false);
- acknowledge(tx, ref);
- count++;
+ deliveringCount.addAndGet(-count);
+ throw e;
}
-
- tx.commit();
-
- return count;
}
public synchronized boolean changeReferencePriority(final long messageID, final byte newPriority) throws Exception
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -14,7 +14,6 @@
package org.hornetq.core.server.impl;
import java.io.InputStream;
-import java.util.Arrays;
import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
@@ -89,7 +88,7 @@
{
super(other);
}
-
+
public boolean isServerMessage()
{
return true;
@@ -109,10 +108,10 @@
public synchronized int incrementRefCount() throws Exception
{
- refCount ++;
-
+ refCount++;
+
if (pagingStore != null)
- {
+ {
if (refCount == 1)
{
pagingStore.addSize(getMemoryEstimate() + MessageReferenceImpl.getMemoryEstimate());
@@ -213,8 +212,7 @@
{
if (other.containsProperty(Message.HDR_ORIG_MESSAGE_ID))
{
- putStringProperty(Message.HDR_ORIGINAL_ADDRESS,
- other.getSimpleStringProperty(Message.HDR_ORIGINAL_ADDRESS));
+ putStringProperty(Message.HDR_ORIGINAL_ADDRESS, other.getSimpleStringProperty(Message.HDR_ORIGINAL_ADDRESS));
putLongProperty(Message.HDR_ORIG_MESSAGE_ID, other.getLongProperty(Message.HDR_ORIG_MESSAGE_ID));
}
@@ -269,12 +267,7 @@
@Override
public String toString()
{
- return "ServerMessage[messageID=" + messageID +
- ", durable=" +
- durable +
- ", address=" +
- getAddress() +
- "]";
+ return "ServerMessage[messageID=" + messageID + ", durable=" + durable + ", address=" + getAddress() + "]";
}
// FIXME - this is stuff that is only used in large messages
@@ -293,5 +286,34 @@
buffer.setLong(buffer.getInt(MessageImpl.BUFFER_HEADER_SPACE) + DataConstants.SIZE_INT, messageID);
}
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.server.ServerMessage#getDuplicateIDBytes()
+ */
+ public byte[] getDuplicateIDBytes()
+ {
+ Object duplicateID = getDuplicateProperty();
+
+ if (duplicateID == null)
+ {
+ return null;
+ }
+ else
+ {
+ if (duplicateID instanceof SimpleString)
+ {
+ return ((SimpleString)duplicateID).getData();
+ }
+ else
+ {
+ return (byte[])duplicateID;
+ }
+ }
+ }
+ public Object getDuplicateProperty()
+ {
+ return getObjectProperty(Message.HDR_DUPLICATE_DETECTION_ID);
+ }
+
}
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -28,6 +28,7 @@
import org.hornetq.core.management.impl.MBeanInfoHelper;
import org.hornetq.core.messagecounter.MessageCounter;
import org.hornetq.core.messagecounter.impl.MessageCounterHelper;
+import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
import org.hornetq.jms.client.HornetQDestination;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.jms.client.SelectorTranslator;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -29,6 +29,12 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.client.ClientConsumer;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.JMSFactoryType;
import org.hornetq.api.jms.management.JMSQueueControl;
@@ -47,6 +53,7 @@
import org.hornetq.tests.integration.management.ManagementTestBase;
import org.hornetq.tests.unit.util.InVMContext;
import org.hornetq.tests.util.RandomUtil;
+import org.hornetq.utils.UUIDGenerator;
import org.hornetq.utils.json.JSONArray;
/**
@@ -70,6 +77,8 @@
protected HornetQQueue queue;
+ protected String queueName;
+
protected Context context;
// Static --------------------------------------------------------
@@ -98,9 +107,9 @@
MessageConsumer consumer = JMSUtil.createConsumer(connection, queue);
Assert.assertEquals(1, queueControl.getConsumerCount());
-
+
JSONArray jsonArray = new JSONArray(queueControl.listConsumersAsJSON());
-
+
assertEquals(1, jsonArray.length());
JMSUtil.sendMessages(queue, 2);
@@ -753,6 +762,236 @@
serverManager.destroyQueue(otherQueueName);
}
+ public void testMoveMessagesWithDuplicateIDSet() throws Exception
+ {
+ String otherQueueName = RandomUtil.randomString();
+
+ serverManager.createQueue(false, otherQueueName, null, true, otherQueueName);
+ HornetQDestination otherQueue = (HornetQDestination)HornetQJMSClient.createQueue(otherQueueName);
+
+ ServerLocator locator = createInVMNonHALocator();
+
+ ClientSessionFactory sf = locator.createSessionFactory();
+
+ ClientSession session = sf.createSession(true, true);
+
+ ClientProducer prod1 = session.createProducer(queue.getAddress());
+ ClientProducer prod2 = session.createProducer(otherQueue.getAddress());
+
+ for (int i = 0; i < 10; i++)
+ {
+ ClientMessage msg = session.createMessage(true);
+
+ msg.putStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID, new SimpleString("dupl-" + i));
+
+ prod1.send(msg);
+ if (i < 5)
+ {
+ prod2.send(msg);
+ }
+ }
+
+ session.commit();
+
+ JMSQueueControl queueControl = createManagementControl();
+ JMSQueueControl otherQueueControl = ManagementControlHelper.createJMSQueueControl((HornetQQueue)otherQueue,
+ mbeanServer);
+
+ Assert.assertEquals(10, queueControl.getMessageCount());
+
+ int moved = queueControl.moveMessages(null, otherQueueName);
+
+ assertEquals(10, moved);
+
+ assertEquals(0, queueControl.getDeliveringCount());
+
+ session.start();
+
+ ClientConsumer cons1 = session.createConsumer(queue.getAddress());
+
+ assertNull(cons1.receiveImmediate());
+
+ cons1.close();
+
+ ClientConsumer cons2 = session.createConsumer(otherQueue.getAddress());
+
+ for (int i = 0; i < 10; i++)
+ {
+ ClientMessage msg = cons2.receive(10000);
+
+ assertNotNull(msg);
+
+ msg.acknowledge();
+ }
+
+ cons2.close();
+
+ session.close();
+
+ sf.close();
+
+ locator.close();
+
+ Assert.assertEquals(0, queueControl.getMessageCount());
+
+ Assert.assertEquals(0, otherQueueControl.getMessageCount());
+
+ serverManager.destroyQueue(otherQueueName);
+ }
+
+
+ public void testMoveIndividualMessagesWithDuplicateIDSetUsingI() throws Exception
+ {
+ String otherQueueName = RandomUtil.randomString();
+
+ serverManager.createQueue(false, otherQueueName, null, true, otherQueueName);
+ HornetQDestination otherQueue = (HornetQDestination)HornetQJMSClient.createQueue(otherQueueName);
+
+ ServerLocator locator = createInVMNonHALocator();
+
+ ClientSessionFactory sf = locator.createSessionFactory();
+
+ ClientSession session = sf.createSession(true, true);
+
+ ClientProducer prod1 = session.createProducer(queue.getAddress());
+ ClientProducer prod2 = session.createProducer(otherQueue.getAddress());
+
+ String [] ids = new String[10];
+
+ for (int i = 0; i < 10; i++)
+ {
+ ClientMessage msg = session.createMessage(true);
+
+ msg.putStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID, new SimpleString("dupl-" + i));
+
+ msg.setUserID(UUIDGenerator.getInstance().generateUUID());
+
+ prod1.send(msg);
+
+ ids[i] = "ID:" + msg.getUserID().toString();
+ if (i < 5)
+ {
+ msg.setUserID(UUIDGenerator.getInstance().generateUUID());
+ prod2.send(msg);
+ }
+ }
+
+ session.commit();
+
+ JMSQueueControl queueControl = createManagementControl();
+ JMSQueueControl otherQueueControl = ManagementControlHelper.createJMSQueueControl((HornetQQueue)otherQueue,
+ mbeanServer);
+
+ Assert.assertEquals(10, queueControl.getMessageCount());
+
+ for (int i = 0 ; i < 10; i++)
+ {
+ queueControl.moveMessage(ids[i], otherQueueName);
+ }
+
+ assertEquals(0, queueControl.getDeliveringCount());
+
+ session.start();
+
+ ClientConsumer cons1 = session.createConsumer(queue.getAddress());
+
+ assertNull(cons1.receiveImmediate());
+
+ cons1.close();
+
+ ClientConsumer cons2 = session.createConsumer(otherQueue.getAddress());
+
+ for (int i = 0; i < 10; i++)
+ {
+ ClientMessage msg = cons2.receive(10000);
+
+ assertNotNull(msg);
+
+ msg.acknowledge();
+ }
+
+ cons2.close();
+
+ session.close();
+
+ sf.close();
+
+ locator.close();
+
+ Assert.assertEquals(0, queueControl.getMessageCount());
+
+ Assert.assertEquals(0, otherQueueControl.getMessageCount());
+
+ serverManager.destroyQueue(otherQueueName);
+ }
+
+ public void testMoveMessagesWithDuplicateIDSetSingleMessage() throws Exception
+ {
+ String otherQueueName = RandomUtil.randomString();
+
+ serverManager.createQueue(false, otherQueueName, null, true, otherQueueName);
+ HornetQDestination otherQueue = (HornetQDestination)HornetQJMSClient.createQueue(otherQueueName);
+
+ ServerLocator locator = createInVMNonHALocator();
+
+ ClientSessionFactory sf = locator.createSessionFactory();
+
+ ClientSession session = sf.createSession(true, true);
+
+ ClientProducer prod1 = session.createProducer(queue.getAddress());
+ ClientProducer prod2 = session.createProducer(otherQueue.getAddress());
+
+ ClientMessage msg = session.createMessage(true);
+
+ msg.putStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID, new SimpleString("dupl-1"));
+
+ prod1.send(msg);
+ prod2.send(msg);
+
+ JMSQueueControl queueControl = createManagementControl();
+ JMSQueueControl otherQueueControl = ManagementControlHelper.createJMSQueueControl((HornetQQueue)otherQueue,
+ mbeanServer);
+
+ Assert.assertEquals(1, queueControl.getMessageCount());
+ Assert.assertEquals(1, otherQueueControl.getMessageCount());
+
+ int moved = queueControl.moveMessages(null, otherQueueName);
+
+ assertEquals(1, moved);
+
+ assertEquals(0, queueControl.getDeliveringCount());
+
+ session.start();
+
+ ClientConsumer cons1 = session.createConsumer(queue.getAddress());
+
+ assertNull(cons1.receiveImmediate());
+
+ cons1.close();
+
+ ClientConsumer cons2 = session.createConsumer(otherQueue.getAddress());
+
+ msg = cons2.receive(10000);
+
+ assertNotNull(msg);
+
+ msg.acknowledge();
+
+ cons2.close();
+
+ session.close();
+
+ sf.close();
+
+ locator.close();
+
+ Assert.assertEquals(0, queueControl.getMessageCount());
+
+ Assert.assertEquals(0, otherQueueControl.getMessageCount());
+
+ serverManager.destroyQueue(otherQueueName);
+ }
+
public void testMoveMessageWithUnknownMessageID() throws Exception
{
String unknownMessageID = RandomUtil.randomString();
@@ -839,7 +1078,7 @@
serverManager.start();
serverManager.activated();
- String queueName = RandomUtil.randomString();
+ queueName = RandomUtil.randomString();
serverManager.createQueue(false, queueName, null, true, queueName);
queue = (HornetQQueue)HornetQJMSClient.createQueue(queueName);
}
@@ -873,7 +1112,8 @@
private Connection createConnection() throws JMSException
{
- HornetQConnectionFactory cf = (HornetQConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ HornetQConnectionFactory cf = (HornetQConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
+ new TransportConfiguration(InVMConnectorFactory.class.getName()));
cf.setBlockOnDurableSend(true);
Modified: trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-12-29 04:58:24 UTC (rev 10085)
+++ trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-12-29 17:43:44 UTC (rev 10086)
@@ -992,6 +992,24 @@
return null;
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.server.ServerMessage#getDuplicateIDBytes()
+ */
+ public byte[] getDuplicateIDBytes()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.server.ServerMessage#getDuplicateProperty()
+ */
+ public Object getDuplicateProperty()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
class FakeFilter implements Filter
13 years, 12 months
JBoss hornetq SVN: r10085 - trunk/tests/src/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-28 23:58:24 -0500 (Tue, 28 Dec 2010)
New Revision: 10085
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
Log:
just removing unused imports
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2010-12-29 04:50:11 UTC (rev 10084)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2010-12-29 04:58:24 UTC (rev 10085)
@@ -12,8 +12,6 @@
*/
package org.hornetq.tests.integration.client;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
13 years, 12 months
JBoss hornetq SVN: r10084 - in trunk: tests/src/org/hornetq/tests/integration/client and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-28 23:50:11 -0500 (Tue, 28 Dec 2010)
New Revision: 10084
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
trunk/src/main/org/hornetq/core/client/impl/LargeMessageControllerImpl.java
trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
Log:
fixing testcases on large message & flow control
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2010-12-28 22:33:12 UTC (rev 10083)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2010-12-29 04:50:11 UTC (rev 10084)
@@ -102,8 +102,6 @@
private volatile int creditsToSend;
- private volatile boolean slowConsumerInitialCreditSent = false;
-
private volatile Exception lastException;
private volatile int ackBytes;
@@ -667,8 +665,6 @@
ClientConsumerImpl.log.trace("Sending " + creditsToSend + " -1, for slow consumer");
}
- slowConsumerInitialCreditSent = false;
-
// sending the credits - 1 initially send to fire the slow consumer, or the slow consumer would be
// always buffering one after received the first message
final int credits = creditsToSend - 1;
@@ -717,22 +713,17 @@
* */
private void startSlowConsumer()
{
- if (!slowConsumerInitialCreditSent)
+ if (ClientConsumerImpl.trace)
{
- if (ClientConsumerImpl.trace)
- {
- ClientConsumerImpl.log.trace("Sending 1 credit to start delivering of one message to slow consumer");
- }
- slowConsumerInitialCreditSent = true;
- sendCredits(1);
+ ClientConsumerImpl.log.trace("Sending 1 credit to start delivering of one message to slow consumer");
}
+ sendCredits(1);
}
private void resetIfSlowConsumer()
{
if (clientWindowSize == 0)
{
- slowConsumerInitialCreditSent = false;
sendCredits(0);
}
}
Modified: trunk/src/main/org/hornetq/core/client/impl/LargeMessageControllerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/LargeMessageControllerImpl.java 2010-12-28 22:33:12 UTC (rev 10083)
+++ trunk/src/main/org/hornetq/core/client/impl/LargeMessageControllerImpl.java 2010-12-29 04:50:11 UTC (rev 10084)
@@ -271,7 +271,10 @@
outStream = output;
}
- consumerInternal.flowControl(totalFlowControl, !continues);
+ if (totalFlowControl > 0)
+ {
+ consumerInternal.flowControl(totalFlowControl, !continues);
+ }
}
public synchronized void saveBuffer(final OutputStream output) throws HornetQException
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2010-12-28 22:33:12 UTC (rev 10083)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2010-12-29 04:50:11 UTC (rev 10084)
@@ -73,11 +73,12 @@
protected void tearDown() throws Exception
{
locator.close();
-
- super.tearDown();
+
+ super.tearDown();
}
-// TODO need to test crashing a producer with unused credits returns them to the pool
+ // TODO need to test crashing a producer with unused credits returns them to the pool
+
public void testFlowControlSingleConsumer() throws Exception
{
testFlowControl(1000, 500, 10 * 1024, 1024, 1024, 1024, 1, 1, 0, false);
@@ -107,7 +108,7 @@
{
testFlowControl(1000, 500, 10 * 1024, 1024, 1024, 0, 1, 1, 0, false);
}
-
+
public void testFlowControlSingleConsumerSlowConsumer() throws Exception
{
testFlowControl(100, 500, 1024, 512, 512, 512, 1, 1, 10, false);
@@ -219,7 +220,6 @@
server.start();
-
locator.setProducerWindowSize(producerWindowSize);
locator.setConsumerWindowSize(consumerWindowSize);
locator.setAckBatchSize(ackBatchSize);
@@ -346,7 +346,7 @@
ProducerFlowControlTest.log.info("rate is " + rate + " msgs / sec");
session.close();
-
+
sf.close();
server.stop();
@@ -367,7 +367,6 @@
server.start();
-
locator.setProducerWindowSize(1024);
locator.setConsumerWindowSize(1024);
locator.setAckBatchSize(1024);
13 years, 12 months
JBoss hornetq SVN: r10083 - trunk/tests/joram-tests/src/org/hornetq/jms.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-28 17:33:12 -0500 (Tue, 28 Dec 2010)
New Revision: 10083
Modified:
trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java
Log:
small tweak
Modified: trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java
===================================================================
--- trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java 2010-12-28 17:44:00 UTC (rev 10082)
+++ trunk/tests/joram-tests/src/org/hornetq/jms/HornetQAdmin.java 2010-12-28 22:33:12 UTC (rev 10083)
@@ -59,6 +59,8 @@
private Process serverProcess;
private ClientSessionFactory sf;
+
+ ServerLocator serverLocator;
public HornetQAdmin()
{
@@ -78,7 +80,7 @@
public void start() throws Exception
{
- ServerLocator serverLocator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
+ serverLocator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
sf = serverLocator.createSessionFactory();
clientSession = sf.createSession(ConfigurationImpl.DEFAULT_CLUSTER_USER,
ConfigurationImpl.DEFAULT_CLUSTER_PASSWORD,
@@ -99,6 +101,14 @@
{
sf.close();
}
+
+ if (serverLocator != null)
+ {
+ serverLocator.close();
+ }
+
+ sf = null;
+ serverLocator = null;
}
public void createConnectionFactory(final String name)
13 years, 12 months
JBoss hornetq SVN: r10082 - trunk/tests/src/org/hornetq/tests/integration/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-28 12:44:00 -0500 (Tue, 28 Dec 2010)
New Revision: 10082
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
Log:
tweak
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-12-28 17:31:02 UTC (rev 10081)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-12-28 17:44:00 UTC (rev 10082)
@@ -33,7 +33,6 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.security.CheckType;
import org.hornetq.core.security.Role;
import org.hornetq.core.server.HornetQServer;
13 years, 12 months