Author: borges
Date: 2012-02-01 11:50:29 -0500 (Wed, 01 Feb 2012)
New Revision: 12068
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
Log:
Restore (newer) waitForBackup() code
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2012-02-01
16:50:09 UTC (rev 12067)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2012-02-01
16:50:29 UTC (rev 12068)
@@ -279,29 +279,24 @@
return sf;
}
- protected void waitForBackup(ClientSessionFactoryInternal sf, long seconds) throws
Exception
- {
- long time = System.currentTimeMillis();
- long toWait = seconds * 1000;
- while (sf.getBackupConnector() == null)
- {
- try
- {
- Thread.sleep(100);
- } catch (InterruptedException e)
- {
- // ignore
- }
- if (sf.getBackupConnector() != null)
- {
- break;
- } else if (System.currentTimeMillis() > (time + toWait))
- {
- fail("backup server never started");
- }
- }
- System.out.println("sf.getBackupConnector() = " + sf.getBackupConnector());
- }
+ /**
+ * Waits for backup to be in the "started" state and to finish
synchronization with its live.
+ * @param sessionFactory
+ * @param seconds
+ * @throws Exception
+ */
+ protected void waitForBackup(ClientSessionFactoryInternal sessionFactory, int seconds)
throws Exception
+ {
+ final HornetQServerImpl actualServer =
(HornetQServerImpl)backupServer.getServer();
+ if (actualServer.getConfiguration().isSharedStore())
+ {
+ waitForServer(actualServer);
+ }
+ else
+ {
+ waitForRemoteBackup(sessionFactory, seconds, true, actualServer);
+ }
+ }
/**
* @param sessionFactory
Show replies by date