mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/configuration/TestConfigPageDisplayHelperImpl.java
@Test
    public void testConfigPanelStatusChanged() throws SecurityException, NoSuchFieldException, 
        IllegalArgumentException, IllegalAccessException
    {
        addConfigToMap();
        
        ControllerModel model = mock(ControllerModel.class);
        ToggleEvent event = mock(ToggleEvent.class);
        UIComponent comp = mock(UIComponent.class);
        UIOutput output = mock(UIOutput.class);
        
        when(m_ActiveController.getActiveController()).thenReturn(model);
        when(model.getId()).thenReturn(CONTROLLERID);
        when(event.getComponent()).thenReturn(comp);
        when(comp.findComponent(CONFIG_HEADER_ID)).thenReturn(output);
        when(comp.findComponent(FACTORY_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_CONFIG_HEADER_ID)).thenReturn(null);
        when(output.getValue()).thenReturn("config PID");
        
        m_SUT.configPanelStatusChanged(event);
        PanelCollapsedStatus status = m_SUT.getPanelCollapsedStatus(CONTROLLERID, "config PID");
        assertThat(status.isCollapsed(), is(true));
        
        when(comp.findComponent(CONFIG_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_HEADER_ID)).thenReturn(output);
        when(comp.findComponent(FACTORY_CONFIG_HEADER_ID)).thenReturn(null);
        when(output.getValue()).thenReturn("factory PID");
        
        m_SUT.configPanelStatusChanged(event);
        status = m_SUT.getPanelCollapsedStatus(CONTROLLERID, "factory PID");
        assertThat(status.isCollapsed(), is(false));
        
        when(comp.findComponent(CONFIG_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_CONFIG_HEADER_ID)).thenReturn(output);
        when(output.getValue()).thenReturn("factory config PID");
        
        m_SUT.configPanelStatusChanged(event);
        status = m_SUT.getPanelCollapsedStatus(CONTROLLERID, "factory config PID");
        assertThat(status.isCollapsed(), is(false));
    }
/**
     * Test the configPanelStatusChagned method.
     * Verify that a toggle event changes the status stored for the specified panel.
     */
Test the configPanelStatusChagned method.
Verify that a toggle event changes the status stored for the specified panel.
Test the configPanelStatusChagned method . Verify that a toggle event changes the status stored for the specified panel .
@Test
    public void testConfigPanelStatusChanged() throws SecurityException, NoSuchFieldException, 
        IllegalArgumentException, IllegalAccessException
    {
        addConfigToMap();
        ControllerModel model = mock(ControllerModel.class);
        ToggleEvent event = mock(ToggleEvent.class);
        UIComponent comp = mock(UIComponent.class);
        UIOutput output = mock(UIOutput.class);
        when(m_ActiveController.getActiveController()).thenReturn(model);
        when(model.getId()).thenReturn(CONTROLLERID);
        when(event.getComponent()).thenReturn(comp);
        when(comp.findComponent(CONFIG_HEADER_ID)).thenReturn(output);
        when(comp.findComponent(FACTORY_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_CONFIG_HEADER_ID)).thenReturn(null);
        when(output.getValue()).thenReturn("config PID");
        m_SUT.configPanelStatusChanged(event);
        PanelCollapsedStatus status = m_SUT.getPanelCollapsedStatus(CONTROLLERID, "config PID");
        assertThat(status.isCollapsed(), is(true));
        when(comp.findComponent(CONFIG_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_HEADER_ID)).thenReturn(output);
        when(comp.findComponent(FACTORY_CONFIG_HEADER_ID)).thenReturn(null);
        when(output.getValue()).thenReturn("factory PID");
        m_SUT.configPanelStatusChanged(event);
        status = m_SUT.getPanelCollapsedStatus(CONTROLLERID, "factory PID");
        assertThat(status.isCollapsed(), is(false));
        when(comp.findComponent(CONFIG_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_HEADER_ID)).thenReturn(null);
        when(comp.findComponent(FACTORY_CONFIG_HEADER_ID)).thenReturn(output);
        when(output.getValue()).thenReturn("factory config PID");
        m_SUT.configPanelStatusChanged(event);
        status = m_SUT.getPanelCollapsedStatus(CONTROLLERID, "factory config PID");
        assertThat(status.isCollapsed(), is(false));
    }
@ Test public void testConfigPanelStatusChanged ( ) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException { addConfigToMap ( ) ; ControllerModel model = mock ( ControllerModel . class ) ; ToggleEvent event = mock ( ToggleEvent . class ) ; UIComponent comp = mock ( UIComponent . class ) ; UIOutput output = mock ( UIOutput . class ) ; when ( m_ActiveController . getActiveController ( ) ) . thenReturn ( model ) ; when ( model . getId ( ) ) . thenReturn ( CONTROLLERID ) ; when ( event . getComponent ( ) ) . thenReturn ( comp ) ; when ( comp . findComponent ( CONFIG_HEADER_ID ) ) . thenReturn ( output ) ; when ( comp . findComponent ( FACTORY_HEADER_ID ) ) . thenReturn ( null ) ; when ( comp . findComponent ( FACTORY_CONFIG_HEADER_ID ) ) . thenReturn ( null ) ; when ( output . getValue ( ) ) . thenReturn ( "config PID" ) ; m_SUT . configPanelStatusChanged ( event ) ; PanelCollapsedStatus status = m_SUT . getPanelCollapsedStatus ( CONTROLLERID , "config PID" ) ; assertThat ( status . isCollapsed ( ) , is ( true ) ) ; when ( comp . findComponent ( CONFIG_HEADER_ID ) ) . thenReturn ( null ) ; when ( comp . findComponent ( FACTORY_HEADER_ID ) ) . thenReturn ( output ) ; when ( comp . findComponent ( FACTORY_CONFIG_HEADER_ID ) ) . thenReturn ( null ) ; when ( output . getValue ( ) ) . thenReturn ( "factory PID" ) ; m_SUT . configPanelStatusChanged ( event ) ; status = m_SUT . getPanelCollapsedStatus ( CONTROLLERID , "factory PID" ) ; assertThat ( status . isCollapsed ( ) , is ( false ) ) ; when ( comp . findComponent ( CONFIG_HEADER_ID ) ) . thenReturn ( null ) ; when ( comp . findComponent ( FACTORY_HEADER_ID ) ) . thenReturn ( null ) ; when ( comp . findComponent ( FACTORY_CONFIG_HEADER_ID ) ) . thenReturn ( output ) ; when ( output . getValue ( ) ) . thenReturn ( "factory config PID" ) ; m_SUT . configPanelStatusChanged ( event ) ; status = m_SUT . getPanelCollapsedStatus ( CONTROLLERID , "factory config PID" ) ; assertThat ( status . isCollapsed ( ) , is ( false ) ) ; }
Test the configPanelStatusChagned method.
Test the configPanelStatusChagned method .