Permalink
Browse files

moving changes from EAP

  • Loading branch information...
1 parent 16db8ba commit 8d87f36739877e32478c6e38fecad378bb56baa8 @clebertsuconic clebertsuconic committed Nov 23, 2011
Showing with 82 additions and 54 deletions.
  1. +14 −14 build-hornetq.xml
  2. +1 −0 build.xml
  3. +3 −4 src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
  4. +2 −2 src/main/org/hornetq/core/server/cluster/ClusterConnection.java
  5. +11 −11 src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
  6. +23 −6 src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
  7. +1 −1 src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
  8. +1 −1 tests/src/org/hornetq/tests/integration/cluster/NodeManagerTest.java
  9. +1 −1 tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeReconnectTest.java
  10. +1 −1 tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
  11. +1 −1 tests/src/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java
  12. +1 −1 tests/src/org/hornetq/tests/integration/cluster/failover/FailBackManualTest.java
  13. +1 −1 tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
  14. +1 −1 .../src/org/hornetq/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java
  15. +1 −1 tests/src/org/hornetq/tests/integration/cluster/failover/SecurityFailoverTest.java
  16. +1 −1 tests/src/org/hornetq/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java
  17. +15 −3 tests/src/org/hornetq/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java
  18. +2 −2 ...etq/core/server/impl → tests/src/org/hornetq/tests/integration/cluster/util}/InVMNodeManager.java
  19. +1 −2 tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
View
@@ -1660,76 +1660,76 @@
</javac>
</target>
- <target name="performance-tests" depends="jar, compile-unit-tests">
+ <target name="performance-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/performance/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="integration-tests" depends="jar, compile-unit-tests">
+ <target name="integration-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="management-tests" depends="jar, compile-unit-tests">
+ <target name="management-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/management/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="jms-management-tests" depends="jar, compile-unit-tests">
+ <target name="jms-management-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/jms/server/management/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="spring-tests" depends="jar, compile-unit-tests">
+ <target name="spring-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/spring/*${test-mask}.class"/>
</antcall>
</target>
- <target name="failover-tests" depends="jar, compile-unit-tests">
+ <target name="failover-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/cluster/failover/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="distribution-tests" depends="jar, compile-unit-tests">
+ <target name="distribution-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/cluster/distribution/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="cluster-tests" depends="jar, compile-unit-tests">
+ <target name="cluster-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/cluster/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="concurrent-tests" depends="jar, compile-unit-tests">
+ <target name="concurrent-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/concurrent/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="unit-tests" depends="jar, compile-unit-tests">
+ <target name="unit-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/unit/**/*${test-mask}.class"/>
<!-- if tests.validate.error is defined, it will fail the build in case of any test failure -->
<!-- <param name="tests.validate.error" value="Defined!"/> -->
</antcall>
</target>
- <target name="timing-tests" depends="jar, compile-unit-tests">
+ <target name="timing-tests" depends="compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/timing/**/*${test-mask}.class"/>
</antcall>
</target>
- <target name="tests" depends="jar, compile-unit-tests">
+ <target name="tests">
<echo message=""/>
<echo message="Running unit tests, fork=${junit.fork}, junit.batchtest.fork=${junit.batchtest.fork}"/>
<echo message="classpath is:${toString:unit.test.execution.classpath}"/>
@@ -1957,9 +1957,9 @@
</junit>
</target>
- <target name="all-tests" depends="unit-tests, integration-tests, concurrent-tests, stress-tests, jms-tests, joram-tests, rest-tests"/>
+ <target name="all-tests" depends="jar, unit-tests, integration-tests, concurrent-tests, stress-tests, jms-tests, joram-tests, rest-tests"/>
- <target name="hudson-tests" depends="unit-tests, integration-tests, concurrent-tests, timing-tests, jms-tests, joram-tests"/>
+ <target name="hudson-tests" depends="jar, unit-tests, integration-tests, concurrent-tests, timing-tests, jms-tests, joram-tests"/>
<target name="compile-reports">
<mkdir dir="${test.stylesheets.dir}"/>
View
@@ -303,6 +303,7 @@ Copyright 2009 Red Hat, Inc.
</target>
<target name="jms-tests" depends="createthirdparty">
+ <ant antfile="build-hornetq.xml" target="jar"/>
<ant antfile="build-hornetq.xml" target="jms-tests"/>
<ant antfile="build-hornetq.xml" target="compile-reports"/>
</target>
@@ -177,17 +177,16 @@ public String toString()
return "Remote Proxy on channel " + Integer.toHexString(System.identityHashCode(this));
}
};
-
- final boolean isCC = msg.isClusterConnection();
+
if (acceptorUsed.getClusterConnection() != null)
{
- acceptorUsed.getClusterConnection().addClusterTopologyListener(listener, isCC);
+ acceptorUsed.getClusterConnection().addClusterTopologyListener(listener);
rc.addCloseListener(new CloseListener()
{
public void connectionClosed()
{
- acceptorUsed.getClusterConnection().removeClusterTopologyListener(listener, isCC);
+ acceptorUsed.getClusterConnection().removeClusterTopologyListener(listener);
}
});
}
@@ -42,9 +42,9 @@
void nodeAnnounced(long eventUID, String nodeID, Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean backup);
- void addClusterTopologyListener(ClusterTopologyListener listener, boolean clusterConnection);
+ void addClusterTopologyListener(ClusterTopologyListener listener);
- void removeClusterTopologyListener(ClusterTopologyListener listener, boolean clusterConnection);
+ void removeClusterTopologyListener(ClusterTopologyListener listener);
/**
* @return a Map of node ID and addresses
@@ -246,7 +246,7 @@ public ClusterConnectionImpl(final ClusterManagerInternal manager,
clusterConnector = new StaticClusterConnector(tcConfigs);
- backupServerLocator = clusterConnector.createServerLocator(false);
+ backupServerLocator = clusterConnector.createServerLocator();
if (backupServerLocator != null)
{
@@ -356,7 +356,7 @@ public ClusterConnectionImpl(final ClusterManagerImpl manager,
clusterConnector = new DiscoveryClusterConnector(dg);
- backupServerLocator = clusterConnector.createServerLocator(true);
+ backupServerLocator = clusterConnector.createServerLocator();
if (backupServerLocator != null)
{
@@ -507,15 +507,15 @@ private TopologyMember getLocalMember()
return topology.getMember(manager.getNodeId());
}
- public void addClusterTopologyListener(final ClusterTopologyListener listener, final boolean clusterConnection)
+ public void addClusterTopologyListener(final ClusterTopologyListener listener)
{
topology.addClusterTopologyListener(listener);
// no need to use an executor here since the Topology is already using one
topology.sendTopology(listener);
}
- public void removeClusterTopologyListener(final ClusterTopologyListener listener, final boolean clusterConnection)
+ public void removeClusterTopologyListener(final ClusterTopologyListener listener)
{
topology.removeClusterTopologyListener(listener);
}
@@ -642,7 +642,7 @@ public synchronized void activate() throws Exception
backupServerLocator = null;
}
- serverLocator = clusterConnector.createServerLocator(true);
+ serverLocator = clusterConnector.createServerLocator();
if (serverLocator != null)
{
@@ -680,7 +680,7 @@ public synchronized void activate() throws Exception
this.serverLocator.setRetryInterval(retryInterval);
}
- serverLocator.addClusterTopologyListener(this);
+ addClusterTopologyListener(this);
serverLocator.setAfterConnectionInternalListener(this);
@@ -1567,7 +1567,7 @@ public String describe()
interface ClusterConnector
{
- ServerLocatorInternal createServerLocator(boolean includeTopology);
+ ServerLocatorInternal createServerLocator();
}
private class StaticClusterConnector implements ClusterConnector
@@ -1579,15 +1579,15 @@ public StaticClusterConnector(TransportConfiguration[] tcConfigs)
this.tcConfigs = tcConfigs;
}
- public ServerLocatorInternal createServerLocator(boolean includeTopology)
+ public ServerLocatorInternal createServerLocator()
{
if (tcConfigs != null && tcConfigs.length > 0)
{
if (log.isDebugEnabled())
{
log.debug(ClusterConnectionImpl.this + "Creating a serverLocator for " + Arrays.toString(tcConfigs));
}
- ServerLocatorImpl locator = new ServerLocatorImpl(includeTopology ? topology : null, true, tcConfigs);
+ ServerLocatorImpl locator = new ServerLocatorImpl(topology, true, tcConfigs);
locator.setClusterConnection(true);
return locator;
}
@@ -1617,9 +1617,9 @@ public DiscoveryClusterConnector(DiscoveryGroupConfiguration dg)
this.dg = dg;
}
- public ServerLocatorInternal createServerLocator(boolean includeTopology)
+ public ServerLocatorInternal createServerLocator()
{
- ServerLocatorImpl locator = new ServerLocatorImpl(includeTopology ? topology : null, true, dg);
+ ServerLocatorImpl locator = new ServerLocatorImpl(topology, true, dg);
return locator;
}
@@ -399,12 +399,29 @@ public void run()
// We execute this on the same executor to make sure the force delivery message is written after
// any delivery is completed
- ServerMessage forcedDeliveryMessage = new ServerMessageImpl(storageManager.generateUniqueID(), 50);
-
- forcedDeliveryMessage.putLongProperty(ClientConsumerImpl.FORCED_DELIVERY_MESSAGE, sequence);
- forcedDeliveryMessage.setAddress(messageQueue.getName());
-
- callback.sendMessage(forcedDeliveryMessage, id, 0);
+ synchronized (lock)
+ {
+ if (transferring)
+ {
+ // Case it's transferring (reattach), we will retry later
+ messageQueue.getExecutor().execute(new Runnable()
+ {
+ public void run()
+ {
+ forceDelivery(sequence);
+ }
+ });
+ }
+ else
+ {
+ ServerMessage forcedDeliveryMessage = new ServerMessageImpl(storageManager.generateUniqueID(), 50);
+
+ forcedDeliveryMessage.putLongProperty(ClientConsumerImpl.FORCED_DELIVERY_MESSAGE, sequence);
+ forcedDeliveryMessage.setAddress(messageQueue.getName());
+
+ callback.sendMessage(forcedDeliveryMessage, id, 0);
+ }
+ }
}
catch (Exception e)
{
@@ -283,7 +283,7 @@ public boolean storeIsPaging()
@Override
public String toString()
{
- return "ServerMessage[messageID=" + messageID + ",priority=" + this.getPriority() +
+ return "ServerMessage[messageID=" + messageID + ",priority=" + this.getPriority() + ", bodySize=" + this.getBodyBuffer().capacity() +
",expiration=" + (this.getExpiration() != 0 ? new java.util.Date(this.getExpiration()) : 0) +
", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]@" + System.identityHashCode(this);
}
@@ -14,7 +14,7 @@
package org.hornetq.tests.integration.cluster;
import org.hornetq.core.server.NodeManager;
-import org.hornetq.core.server.impl.InVMNodeManager;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
import org.hornetq.tests.util.ServiceTestBase;
import java.util.ArrayList;
@@ -41,8 +41,8 @@
import org.hornetq.core.server.NodeManager;
import org.hornetq.core.server.cluster.Bridge;
import org.hornetq.core.server.cluster.impl.BridgeImpl;
-import org.hornetq.core.server.impl.InVMNodeManager;
import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
/**
* A BridgeReconnectTest
@@ -57,7 +57,7 @@
import org.hornetq.core.server.cluster.RemoteQueueBinding;
import org.hornetq.core.server.group.GroupingHandler;
import org.hornetq.core.server.group.impl.GroupingHandlerConfiguration;
-import org.hornetq.core.server.impl.InVMNodeManager;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
@@ -34,8 +34,8 @@
import org.hornetq.core.client.impl.ServerLocatorInternal;
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.server.impl.InVMNodeManager;
import org.hornetq.jms.client.HornetQTextMessage;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
/**
* @author <a href="mailto:andy.taylor@jboss.com">Andy Taylor</a>
@@ -21,8 +21,8 @@
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
import org.hornetq.core.client.impl.ServerLocatorInternal;
import org.hornetq.core.config.ClusterConnectionConfiguration;
-import org.hornetq.core.server.impl.InVMNodeManager;
import org.hornetq.jms.client.HornetQTextMessage;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
import org.hornetq.tests.integration.cluster.util.TestableServer;
import java.util.ArrayList;
@@ -41,7 +41,7 @@
import org.hornetq.core.remoting.impl.invm.InVMRegistry;
import org.hornetq.core.remoting.impl.invm.TransportConstants;
import org.hornetq.core.server.NodeManager;
-import org.hornetq.core.server.impl.InVMNodeManager;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
import org.hornetq.tests.integration.cluster.util.SameProcessHornetQServer;
import org.hornetq.tests.integration.cluster.util.TestableServer;
import org.hornetq.tests.util.ServiceTestBase;
@@ -26,7 +26,7 @@
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.NodeManager;
-import org.hornetq.core.server.impl.InVMNodeManager;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
import org.hornetq.tests.integration.cluster.util.SameProcessHornetQServer;
import org.hornetq.tests.integration.cluster.util.TestableServer;
@@ -24,8 +24,8 @@
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.security.Role;
-import org.hornetq.core.server.impl.InVMNodeManager;
import org.hornetq.spi.core.security.HornetQSecurityManager;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
import org.hornetq.tests.integration.cluster.util.TestableServer;
/**
@@ -27,7 +27,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.NodeManager;
-import org.hornetq.core.server.impl.InVMNodeManager;
+import org.hornetq.tests.integration.cluster.util.InVMNodeManager;
import org.hornetq.tests.integration.cluster.util.SameProcessHornetQServer;
import org.hornetq.tests.integration.cluster.util.TestableServer;
Oops, something went wrong.

0 comments on commit 8d87f36

Please sign in to comment.