Checker checker = new Checker()
{
@Override
public void check(ApplicationContext context) throws Throwable
{
ClusterInfoSession session = null;
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();
assertTrue(poll(baseTimeoutMillis, statsCollector,
new Condition<MetricGetters>() { @Override public boolean conditionMet(MetricGetters sc)
{ return 100000 == sc.getMessageProcessorCount(); } }));
// now there's 100000 mps in the container created from the KeySource. So we steal the
// shard and force if offline but continuously disrupt it while it tries to come
// back up.
// 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();
String path = clusterId.asPath() + "/" + String.valueOf(0);
session = TestUtils.stealShard(originalSession, factory, path,baseTimeoutMillis);
DefaultRouterSlotInfo si = (DefaultRouterSlotInfo)session.getData(path, null);