/** * Switches on the endpoint view and tests if the active state of the endpoint view is updated. Additionally, * asserts for the active children count to make sure that all children are activated. * * @throws Exception if an exception occurs while activating endpoint view */ public void testSwitchOn() throws Exception { EndpointView endpointView = createEndPointView(2); endpointView.switchOn(); Assert.assertEquals("Switching on endpoint view has not activated all children", 2, endpointView.getActiveChildren()); Assert.assertTrue("Endpoint view is not active", endpointView.isActive()); endpointView = createEndPointView(0); endpointView.switchOn(); Assert.assertTrue("Endpoint view is not active", endpointView.isActive()); }
/** * Switches off the endpoint view and tests if the active state of the endpoint view is updated. Additionally, * asserts for the active children count to make sure that all children are de-activated. * * @throws Exception if an exception occurs while switching off the endpoint view */ public void testSwitchOff() throws Exception { EndpointView endpointView = createEndPointView(2); endpointView.switchOn(); endpointView.switchOff(); Assert.assertEquals("Switching off endpoint view has not deactivated all children", 0, endpointView.getActiveChildren()); Assert.assertFalse("Endpoint view is active", endpointView.isActive()); endpointView = createEndPointView(0); endpointView.switchOn(); endpointView.switchOff(); Assert.assertFalse("Endpoint view is active", endpointView.isActive()); }
/** * Switch on a leaf endpoint, or all endpoints on a group - from maintenance * @throws Exception */ public void switchOn() throws Exception { if (endpoint.getChildren() != null) { for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { e.getMetricsMBean().switchOn(); } } } else { if (endpoint.getContext() != null) { endpoint.getContext().switchOn(); } } }
/** * Switch on a leaf endpoint, or all endpoints on a group - from maintenance * @throws Exception */ public void switchOn() throws Exception { if (endpoint.getChildren() != null) { for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { e.getMetricsMBean().switchOn(); } } } else { if (endpoint.getContext() != null) { endpoint.getContext().switchOn(); } } }