JBoss hornetq SVN: r11036 - branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-22 17:35:04 -0400 (Fri, 22 Jul 2011)
New Revision: 11036
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java
Log:
ignoring tests case there's no properties set
Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java 2011-07-22 21:33:12 UTC (rev 11035)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java 2011-07-22 21:35:04 UTC (rev 11036)
@@ -65,16 +65,6 @@
private static final String TWITTER_ACCESS_TOKEN = System.getProperty("twitter.accessToken");
private static final String TWITTER_ACCESS_TOKEN_SECRET = System.getProperty("twitter.accessTokenSecret");
- @Override
- protected void setUp() throws Exception
- {
- if(TWITTER_CONSUMER_KEY == null || TWITTER_CONSUMER_SECRET == null || TWITTER_ACCESS_TOKEN == null || TWITTER_ACCESS_TOKEN_SECRET == null)
- {
- throw new Exception("* * * Please set twitter.consumerKey, twitter.consumerSecret, twitter.accessToken and twitter.accessTokenSecuret in system property * * *");
- }
- super.setUp();
- }
-
// incoming
13 years, 5 months
JBoss hornetq SVN: r11035 - branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-07-22 17:33:12 -0400 (Fri, 22 Jul 2011)
New Revision: 11035
Modified:
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java
Log:
ignoring tests case there's no properties set
Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java 2011-07-22 14:04:42 UTC (rev 11034)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java 2011-07-22 21:33:12 UTC (rev 11035)
@@ -18,6 +18,7 @@
import java.util.Set;
import junit.framework.Assert;
+import junit.framework.TestSuite;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientConsumer;
@@ -30,6 +31,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.ConnectorServiceConfiguration;
import org.hornetq.core.config.CoreQueueConfiguration;
+import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.ConnectorService;
import org.hornetq.core.server.HornetQServer;
@@ -75,6 +77,28 @@
// incoming
+
+
+ public static TestSuite suite()
+ {
+ TestSuite suite = new TestSuite(TwitterTest.class.getName() + " testsuite");
+
+ if (AIOSequentialFileFactory.isSupported())
+ {
+ suite.addTestSuite(TwitterTest.class);
+ }
+ else
+ {
+ // System.out goes towards JUnit report
+ String errorMsg = "Test " + TwitterTest.class.getName() +
+ " ignored as twitter.consumerKey, twitter.consumerSecret, twitter.accessToken and twitter.accessTokenSecuret is not set in system property * * *";
+ System.out.println(errorMsg);
+ log.warn(errorMsg);
+ }
+
+ return suite;
+ }
+
public void testSimpleIncoming() throws Exception
{
internalTestIncoming(true,false);
13 years, 5 months
JBoss hornetq SVN: r11034 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:04:42 -0400 (Fri, 22 Jul 2011)
New Revision: 11034
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
Log:
FIX test set-up & refactor.
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 14:04:06 UTC (rev 11033)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 14:04:42 UTC (rev 11034)
@@ -59,7 +59,6 @@
{
commonTestCode();
- sessionOne.commit();
for (int i = 0; i < 50; i++)
{
@@ -126,9 +125,7 @@
{
commonTestCode();
- sessionOne.commit();
-
- for (int i = 0; i < 100; i++)
+ for (int i = 0; i < 100; i++)
{
ClientMessage msg = consThree.receive(15000);
@@ -168,6 +165,8 @@
msg.putIntProperty(new SimpleString("key"), i);
producer.send(msg);
}
+ sessionOne.commit();
+
}
// Package protected ---------------------------------------------
@@ -203,23 +202,24 @@
super.setUp();
setupLiveServer(1, true, isShared(), true);
- setupBackupServer(2, 1, true, isShared(), true);
setupLiveServer(3, true, isShared(), true);
+ setupBackupServer(2, 3, true, isShared(), true);
- setupClusterConnectionWithBackups("test", "test", false, 1, true, 1, new int[] { 3 });
+ final String address = ReplicatedDistributionTest.ADDRESS.toString();
+ // notice the abuse of the method call, '3' is not a backup for '1'
+ setupClusterConnectionWithBackups("test", address, false, 1, true, 1, new int[] { 3 });
+ setupClusterConnectionWithBackups("test", address, false, 1, true, 3, new int[] { 2, 1 });
AddressSettings as = new AddressSettings();
as.setRedistributionDelay(0);
- getServer(1).getAddressSettingsRepository().addMatch("test.*", as);
- getServer(2).getAddressSettingsRepository().addMatch("test.*", as);
- getServer(2).getAddressSettingsRepository().addMatch("test.*", as);
+ for (int i : new int[] { 1, 2, 3 })
+ {
+ getServer(i).getAddressSettingsRepository().addMatch("test.*", as);
+ getServer(i).start();
+ }
- servers[1].start();
- servers[3].start();
- servers[2].start();
-
- setupSessionFactory(1, 0, true, true);
+ setupSessionFactory(1, -1, true, true);
setupSessionFactory(3, 2, true, true);
sessionOne = sfs[1].createSession(true, true);
13 years, 5 months
JBoss hornetq SVN: r11033 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:04:06 -0400 (Fri, 22 Jul 2011)
New Revision: 11033
Removed:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java
Log:
Delete empty class
Deleted: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java 2011-07-22 14:03:31 UTC (rev 11032)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FileStorageDiscoveryClusterWithBackupFailoverTest.java 2011-07-22 14:04:06 UTC (rev 11033)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.hornetq.tests.integration.cluster.failover;
-
-/**
- * A FileStorageClusterWithBackupFailoverTest
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public class FileStorageDiscoveryClusterWithBackupFailoverTest extends DiscoveryClusterWithBackupFailoverTest
-{
-}
13 years, 5 months
JBoss hornetq SVN: r11032 - in branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests: util and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:03:31 -0400 (Fri, 22 Jul 2011)
New Revision: 11032
Added:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/CountDownSessionFailureListener.java
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
Log:
Remove code duplication
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 14:02:49 UTC (rev 11031)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 14:03:31 UTC (rev 11032)
@@ -24,11 +24,11 @@
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.SessionFailureListener;
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
+import org.hornetq.tests.util.CountDownSessionFailureListener;
/**
* A SymmetricFailoverTest
@@ -42,6 +42,10 @@
// Constants -----------------------------------------------------
private static final SimpleString ADDRESS = new SimpleString("test.SomeAddress");
+ private ClientSession sessionOne;
+ private ClientSession sessionThree;
+ private ClientConsumer consThree;
+ private ClientProducer producer;
// Attributes ----------------------------------------------------
@@ -53,38 +57,10 @@
public void testRedistribution() throws Exception
{
- setupSessionFactory(1, 0, true, true);
- setupSessionFactory(3, 2, true, true);
+ commonTestCode();
- ClientSession sessionOne = sfs[1].createSession(true, true);
+ sessionOne.commit();
- ClientSession sessionThree = sfs[3].createSession(false, false);
-
- sessionOne.createQueue(ReplicatedDistributionTest.ADDRESS, ReplicatedDistributionTest.ADDRESS, true);
-
- sessionThree.createQueue(ReplicatedDistributionTest.ADDRESS, ReplicatedDistributionTest.ADDRESS, true);
-
- ClientConsumer consThree = sessionThree.createConsumer(ReplicatedDistributionTest.ADDRESS);
-
- sessionThree.start();
-
- waitForBindings(3, "test.SomeAddress", 1, 1, true);
- waitForBindings(1, "test.SomeAddress", 1, 1, false);
- try
- {
- ClientProducer producer = sessionOne.createProducer(ReplicatedDistributionTest.ADDRESS);
-
- for (int i = 0; i < 100; i++)
- {
- ClientMessage msg = sessionOne.createMessage(true);
-
- msg.putIntProperty(new SimpleString("key"), i);
-
- producer.send(msg);
- }
-
- sessionOne.commit();
-
for (int i = 0; i < 50; i++)
{
ClientMessage msg = consThree.receive(15000);
@@ -144,50 +120,16 @@
ClientConsumer consOne = sessionOne.createConsumer(ReplicatedDistributionTest.ADDRESS);
Assert.assertNull(consOne.receiveImmediate());
-
- }
- finally
- {
- sessionOne.close();
- sessionThree.close();
- }
}
public void testSimpleRedistribution() throws Exception
{
- setupSessionFactory(1, 0, true, true);
- setupSessionFactory(3, 2, true, true);
+ commonTestCode();
- ClientSession sessionOne = sfs[1].createSession(true, true);
+ sessionOne.commit();
- ClientSession sessionThree = sfs[3].createSession(false, false);
-
- sessionOne.createQueue(ReplicatedDistributionTest.ADDRESS, ReplicatedDistributionTest.ADDRESS, true);
-
- sessionThree.createQueue(ReplicatedDistributionTest.ADDRESS, ReplicatedDistributionTest.ADDRESS, true);
-
- ClientConsumer consThree = sessionThree.createConsumer(ReplicatedDistributionTest.ADDRESS);
-
- sessionThree.start();
-
- waitForBindings(3, "test.SomeAddress", 1, 1, true);
- waitForBindings(1, "test.SomeAddress", 1, 1, false);
-
- try
- {
- ClientProducer producer = sessionOne.createProducer(ReplicatedDistributionTest.ADDRESS);
-
for (int i = 0; i < 100; i++)
{
- ClientMessage msg = sessionOne.createMessage(true);
- msg.putIntProperty(new SimpleString("key"), i);
- producer.send(msg);
- }
-
- sessionOne.commit();
-
- for (int i = 0; i < 100; i++)
- {
ClientMessage msg = consThree.receive(15000);
Assert.assertNotNull(msg);
@@ -211,12 +153,20 @@
ClientConsumer consOne = sessionOne.createConsumer(ReplicatedDistributionTest.ADDRESS);
Assert.assertNull(consOne.receiveImmediate());
+ }
- }
- finally
+ private void commonTestCode() throws Exception, HornetQException
+ {
+ waitForBindings(3, "test.SomeAddress", 1, 1, true);
+ waitForBindings(1, "test.SomeAddress", 1, 1, false);
+
+ producer = sessionOne.createProducer(ReplicatedDistributionTest.ADDRESS);
+
+ for (int i = 0; i < 100; i++)
{
- sessionOne.close();
- sessionThree.close();
+ ClientMessage msg = sessionOne.createMessage(true);
+ msg.putIntProperty(new SimpleString("key"), i);
+ producer.send(msg);
}
}
@@ -233,23 +183,8 @@
final CountDownLatch latch = new CountDownLatch(1);
- class MyListener implements SessionFailureListener
- {
- public void connectionFailed(final HornetQException me, boolean failedOver)
- {
- latch.countDown();
- }
+ session.addFailureListener(new CountDownSessionFailureListener(latch));
- /* (non-Javadoc)
- * @see org.hornetq.api.core.client.SessionFailureListener#beforeReconnect(org.hornetq.api.core.exception.HornetQException)
- */
- public void beforeReconnect(final HornetQException exception)
- {
- }
- }
-
- session.addFailureListener(new MyListener());
-
RemotingConnection conn = ((ClientSessionInternal)session).getConnection();
// Simulate failure on connection
@@ -280,11 +215,35 @@
getServer(2).getAddressSettingsRepository().addMatch("test.*", as);
getServer(2).getAddressSettingsRepository().addMatch("test.*", as);
- servers[2].start();
servers[1].start();
servers[3].start();
+ servers[2].start();
+
+ setupSessionFactory(1, 0, true, true);
+ setupSessionFactory(3, 2, true, true);
+
+ sessionOne = sfs[1].createSession(true, true);
+ sessionThree = sfs[3].createSession(false, false);
+
+ sessionOne.createQueue(ReplicatedDistributionTest.ADDRESS, ReplicatedDistributionTest.ADDRESS, true);
+ sessionThree.createQueue(ReplicatedDistributionTest.ADDRESS, ReplicatedDistributionTest.ADDRESS, true);
+
+ consThree = sessionThree.createConsumer(ReplicatedDistributionTest.ADDRESS);
+
+ sessionThree.start();
}
+ @Override
+ protected void tearDown() throws Exception
+ {
+ if (sessionOne != null)
+ sessionOne.close();
+ if (sessionThree != null)
+ sessionThree.close();
+
+ super.tearDown();
+ }
+
protected boolean isShared()
{
return false;
Added: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/CountDownSessionFailureListener.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/CountDownSessionFailureListener.java (rev 0)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/util/CountDownSessionFailureListener.java 2011-07-22 14:03:31 UTC (rev 11032)
@@ -0,0 +1,29 @@
+package org.hornetq.tests.util;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.client.SessionFailureListener;
+
+public final class CountDownSessionFailureListener implements SessionFailureListener
+{
+ private final CountDownLatch latch;
+
+ public CountDownSessionFailureListener(CountDownLatch latch)
+ {
+ this.latch = latch;
+ }
+ @Override
+ public void connectionFailed(HornetQException exception, boolean failedOver)
+ {
+ latch.countDown();
+ }
+
+ @Override
+ public void beforeReconnect(HornetQException exception)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
13 years, 5 months
JBoss hornetq SVN: r11031 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:02:49 -0400 (Fri, 22 Jul 2011)
New Revision: 11031
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
Log:
Put common configuration code into methods
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 14:02:05 UTC (rev 11030)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 14:02:49 UTC (rev 11031)
@@ -1333,28 +1333,7 @@
Configuration configuration = createBasicConfig();
- configuration.setSecurityEnabled(false);
- configuration.setJournalMinFiles(2);
- configuration.setJournalMaxIO_AIO(1000);
- configuration.setJournalFileSize(100 * 1024);
- configuration.setJournalType(getDefaultJournalType());
- configuration.setSharedStore(sharedStorage);
- if (sharedStorage)
- {
- // Shared storage will share the node between the backup and live node
- configuration.setBindingsDirectory(getBindingsDir(node, false));
- configuration.setJournalDirectory(getJournalDir(node, false));
- configuration.setPagingDirectory(getPageDir(node, false));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, false));
- }
- else
- {
- configuration.setBindingsDirectory(getBindingsDir(node, true));
- configuration.setJournalDirectory(getJournalDir(node, true));
- configuration.setPagingDirectory(getPageDir(node, true));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, true));
- }
- configuration.setClustered(true);
+ configureSomeCommonValues(node, node, sharedStorage, configuration);
configuration.setJournalCompactMinFiles(0);
configuration.getAcceptorConfigurations().clear();
@@ -1401,28 +1380,7 @@
Configuration configuration = createBasicConfig();
- configuration.setSecurityEnabled(false);
- configuration.setJournalMinFiles(2);
- configuration.setJournalMaxIO_AIO(1000);
- configuration.setJournalFileSize(100 * 1024);
- configuration.setJournalType(getDefaultJournalType());
- configuration.setSharedStore(sharedStorage);
- if (sharedStorage)
- {
- // Shared storage will share the node between the backup and live node
- configuration.setBindingsDirectory(getBindingsDir(node, false));
- configuration.setJournalDirectory(getJournalDir(node, false));
- configuration.setPagingDirectory(getPageDir(node, false));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, false));
- }
- else
- {
- configuration.setBindingsDirectory(getBindingsDir(node, true));
- configuration.setJournalDirectory(getJournalDir(node, true));
- configuration.setPagingDirectory(getPageDir(node, true));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, true));
- }
- configuration.setClustered(true);
+ configureSomeCommonValues(node, node, sharedStorage, configuration);
configuration.setJournalCompactMinFiles(0);
configuration.getAcceptorConfigurations().clear();
@@ -1448,28 +1406,8 @@
Configuration configuration = createBasicConfig();
- configuration.setSecurityEnabled(false);
- configuration.setJournalMinFiles(2);
- configuration.setJournalMaxIO_AIO(1000);
- configuration.setJournalFileSize(100 * 1024);
- configuration.setJournalType(getDefaultJournalType());
- configuration.setSharedStore(sharedStorage);
- if (sharedStorage)
- {
- // Shared storage will share the node between the backup and live node
- configuration.setBindingsDirectory(getBindingsDir(liveNode, false));
- configuration.setJournalDirectory(getJournalDir(liveNode, false));
- configuration.setPagingDirectory(getPageDir(liveNode, false));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(liveNode, false));
- }
- else
- {
- configuration.setBindingsDirectory(getBindingsDir(node, true));
- configuration.setJournalDirectory(getJournalDir(node, true));
- configuration.setPagingDirectory(getPageDir(node, true));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, true));
- }
- configuration.setClustered(true);
+ configureSomeCommonValues(node, liveNode, sharedStorage, configuration);
+
configuration.setJournalCompactMinFiles(0);
configuration.setBackup(true);
@@ -1510,26 +1448,27 @@
servers[node] = server;
}
- protected void setupBackupServer(final int node,
- final int liveNode,
- final boolean fileStorage,
- final boolean sharedStorage,
- final boolean netty,
- NodeManager nodeManager)
+ private void configureSomeCommonValues(final int node,
+ final int liveNode,
+ final boolean sharedStorage,
+ Configuration configuration)
{
- if (servers[node] != null)
- {
- throw new IllegalArgumentException("Already a server at node " + node);
- }
-
- Configuration configuration = createBasicConfig();
-
configuration.setSecurityEnabled(false);
configuration.setJournalMinFiles(2);
configuration.setJournalMaxIO_AIO(1000);
configuration.setJournalFileSize(100 * 1024);
configuration.setJournalType(getDefaultJournalType());
+
+ configureCommonValues(node, liveNode, sharedStorage, configuration);
+ }
+
+ private void configureCommonValues(final int node,
+ final int liveNode,
+ final boolean sharedStorage,
+ Configuration configuration)
+ {
configuration.setSharedStore(sharedStorage);
+ configuration.setClustered(true);
if (sharedStorage)
{
// Shared storage will share the node between the backup and live node
@@ -1545,7 +1484,23 @@
configuration.setPagingDirectory(getPageDir(node, true));
configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, true));
}
- configuration.setClustered(true);
+ }
+
+ protected void setupBackupServer(final int node,
+ final int liveNode,
+ final boolean fileStorage,
+ final boolean sharedStorage,
+ final boolean netty,
+ NodeManager nodeManager)
+ {
+ if (servers[node] != null)
+ {
+ throw new IllegalArgumentException("Already a server at node " + node);
+ }
+
+ Configuration configuration = createBasicConfig();
+
+ configureSomeCommonValues(node, liveNode, sharedStorage, configuration);
configuration.setJournalCompactMinFiles(0);
configuration.setBackup(true);
@@ -1660,23 +1615,8 @@
Configuration configuration = createBasicConfig();
configuration.setSecurityEnabled(false);
- configuration.setSharedStore(sharedStorage);
- if (sharedStorage)
- {
- // Shared storage will share the node between the backup and live node
- configuration.setBindingsDirectory(getBindingsDir(liveNode, false));
- configuration.setJournalDirectory(getJournalDir(liveNode, false));
- configuration.setPagingDirectory(getPageDir(liveNode, false));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(liveNode, false));
- }
- else
- {
- configuration.setBindingsDirectory(getBindingsDir(node, true));
- configuration.setJournalDirectory(getJournalDir(node, true));
- configuration.setPagingDirectory(getPageDir(node, true));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(node, true));
- }
- configuration.setClustered(true);
+ configureCommonValues(node, liveNode, sharedStorage, configuration);
+
configuration.setBackup(true);
configuration.getAcceptorConfigurations().clear();
13 years, 5 months
JBoss hornetq SVN: r11030 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:02:05 -0400 (Fri, 22 Jul 2011)
New Revision: 11030
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
Log:
Fix test set-up
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 14:01:21 UTC (rev 11029)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2011-07-22 14:02:05 UTC (rev 11030)
@@ -111,11 +111,11 @@
fail(sessionThree);
// sessionThree.close();
- //
+ //
// setupSessionFactory(2, -1, true);
- //
+ //
// sessionThree = sfs[2].createSession(true, true);
- //
+ //
// sessionThree.start();
// consThree = sessionThree.createConsumer(ADDRESS);
@@ -269,7 +269,7 @@
setupLiveServer(1, true, isShared(), true);
setupBackupServer(2, 1, true, isShared(), true);
- setupBackupServer(3, 1, true, isShared(), true);
+ setupLiveServer(3, true, isShared(), true);
setupClusterConnectionWithBackups("test", "test", false, 1, true, 1, new int[] { 3 });
13 years, 5 months
JBoss hornetq SVN: r11029 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:01:21 -0400 (Fri, 22 Jul 2011)
New Revision: 11029
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java
Log:
Fix test set-up
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java 2011-07-22 14:00:43 UTC (rev 11028)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java 2011-07-22 14:01:21 UTC (rev 11029)
@@ -292,7 +292,7 @@
{
e.printStackTrace();
}
- Assert.assertEquals(e.getCode(), HornetQException.UNBLOCKED);
+ Assert.assertEquals("Expected UNBLOCKED", HornetQException.UNBLOCKED, e.getCode());
retry = true;
}
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java 2011-07-22 14:00:43 UTC (rev 11028)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedAsynchronousFailoverTest.java 2011-07-22 14:01:21 UTC (rev 11029)
@@ -20,36 +20,20 @@
* A ReplicatedAsynchronousFailoverTest
*
* @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class ReplicatedAsynchronousFailoverTest extends AsynchronousFailoverTest
{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
@Override
protected TestableServer createLiveServer()
{
- return new SameProcessHornetQServer(createServer(true, liveConfig));
+ return new SameProcessHornetQServer(createInVMFailoverServer(true, liveConfig, nodeManager));
}
@Override
protected TestableServer createBackupServer()
{
- return new SameProcessHornetQServer(createServer(true, backupConfig));
+ return new SameProcessHornetQServer(createInVMFailoverServer(true, backupConfig, nodeManager));
}
@Override
13 years, 5 months
JBoss hornetq SVN: r11028 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:00:43 -0400 (Fri, 22 Jul 2011)
New Revision: 11028
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
Log:
test 'correction'
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 14:00:06 UTC (rev 11027)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-07-22 14:00:43 UTC (rev 11028)
@@ -368,8 +368,8 @@
waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(1, QUEUES_TESTADDRESS, 1, 1, false);
- waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, false);
+ waitForBindings(1, QUEUES_TESTADDRESS, 2, 1, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 2, 1, false);
send(1, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 1, 2);
@@ -385,7 +385,7 @@
waitForBindings(4, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 2, 1, false);
// activated backup nodes
waitForBindings(4, QUEUES_TESTADDRESS, 1, 1, false);
@@ -401,7 +401,7 @@
// live nodes
waitForBindings(2, QUEUES_TESTADDRESS, 1, 1, true);
// live nodes
- waitForBindings(2, QUEUES_TESTADDRESS, 1, 0, false);
+ waitForBindings(2, QUEUES_TESTADDRESS, 2, 0, false);
send(2, QUEUES_TESTADDRESS, 10, false, null);
verifyReceiveRoundRobinInSomeOrder(true, 10, 2);
13 years, 5 months
JBoss hornetq SVN: r11027 - branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution.
by do-not-reply@jboss.org
Author: borges
Date: 2011-07-22 10:00:06 -0400 (Fri, 22 Jul 2011)
New Revision: 11027
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
Log:
Add consistency check
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 13:59:26 UTC (rev 11026)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-07-22 14:00:06 UTC (rev 11027)
@@ -1881,8 +1881,9 @@
}
TransportConfiguration connectorConfig = createTransportConfiguration(netty, false, generateParams(node, netty));
- server.getConfiguration().getConnectorConfigurations().put(name, connectorConfig);
-
+ Configuration config = server.getConfiguration();
+ config.getConnectorConfigurations().put(name, connectorConfig);
+ assertEquals(config.isBackup(), node > 2);
ClusterConnectionConfiguration clusterConf = new ClusterConnectionConfiguration(name,
address,
name,
13 years, 5 months