}
@Test
public void testBootstrap() throws Throwable {
logger.info("testBootstrap: start");
ClusterView initialClusterView = instance.getClusterViewService()
.getClusterView();
assertNotNull(initialClusterView);
AssertingTopologyEventListener ada = new AssertingTopologyEventListener();
ada.addExpected(Type.TOPOLOGY_INIT);
instance.bindTopologyEventListener(ada);
assertEquals(1, ada.getEvents().size());
TopologyEvent initEvent = ada.getEvents().remove(0);
assertNotNull(initEvent);
assertEquals(initialClusterView.getId(), initEvent.getNewView()
.getClusterViews().iterator().next().getId());
assertEquals(initialClusterView.getInstances().get(0).getSlingId(),
initEvent.getNewView().getLocalInstance().getSlingId());
// hard assumption that the class we get is an
// IsolatedInstanceDescription
// this is because we dont have any established clusterview yet - hence
// still entirely isolated
assertEquals(IsolatedInstanceDescription.class, initialClusterView
.getInstances().get(0).getClass());
assertEquals(IsolatedInstanceDescription.class, instance
.getClusterViewService().getClusterView().getInstances().get(0)
.getClass());
instance.runHeartbeatOnce();