try
{
// start things and verify that the init method was called
Dempsy dempsy = (Dempsy)context.getBean("dempsy");
TestMp mp = (TestMp) getMp(dempsy, "test-app","test-cluster1");
final ClusterId clusterId = new ClusterId("test-app","test-cluster1");
// verify we haven't called it again, not that there's really
// a way to given the code
assertEquals(1, mp.startCalls.get());
// make sure that there are no Mps
MetricGetters statsCollector = (MetricGetters)dempsy.getCluster(new ClusterId("test-app","test-cluster1")).getNodes().get(0).getStatsCollector();
// This will wait until the keySpace is up to the maxcount which is set (in the setup, below) to 100000
assertTrue(poll(baseTimeoutMillis, statsCollector,
new Condition<MetricGetters>() { @Override public boolean conditionMet(MetricGetters sc)
{ return 100000 == sc.getMessageProcessorCount(); } }));
// now push the cluster into backup node.
ClusterInfoSession originalSession = dempsy.getCluster(new ClusterId("test-app","test-cluster1")).getNodes().get(0).retouRteg().getClusterSession();
ClusterInfoSessionFactory factory = dempsy.getClusterSessionFactory();
session = TestUtils.stealShard(originalSession, factory, clusterId.asPath() + "/" + String.valueOf(0),baseTimeoutMillis);
// If we got here then the MpContainer is on standby and the number of Mps should
// drop to zero.
assertTrue(poll(baseTimeoutMillis, statsCollector,
new Condition<MetricGetters>() { @Override public boolean conditionMet(MetricGetters sc)