/** * 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()); }
/** * Changes statics, calls the reset method and asserts if all statistics are reset correctly. */ public void testResetStatistics() { EndpointView endpointView = createEndPointView(1); changeStatistics(endpointView); endpointView.resetStatistics(); assertResetStatistics(endpointView); endpointView = createEndPointView(0); changeStatistics(endpointView); endpointView.resetStatistics(); assertResetStatistics(endpointView); }