mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/configuration/TestConfigPageDisplayHelperImpl.java
@Test
    public void testConfigTabViewChange()
    {
        assertThat(m_SUT.getConfigTabIndex(), is(0));
        
        TabChangeEvent changeEvent = mock(TabChangeEvent.class);
        Tab newTab = mock(Tab.class);
        Tab tab1 = mock(Tab.class);
        Tab tab2 = mock(Tab.class);
        Tab tab3 = mock(Tab.class);
        UIComponent comp = mock(UIComponent.class);
        
        List<UIComponent> tabList = new ArrayList<UIComponent>();
        tabList.add(tab1);
        tabList.add(tab2);
        tabList.add(tab3);
        
        when(changeEvent.getTab()).thenReturn(newTab);
        when(changeEvent.getComponent()).thenReturn(comp);
        when(comp.getChildren()).thenReturn(tabList);
        when(newTab.getTitle()).thenReturn("tab2");
        when(tab1.getTitle()).thenReturn("tab1");
        when(tab2.getTitle()).thenReturn("tab2");
        when(tab3.getTitle()).thenReturn("tab3");
        
        m_SUT.configTabViewChange(changeEvent);
        
        assertThat(m_SUT.getConfigTabIndex(), is(1));
    }
/**
     * Test the configuration tab view change method.
     * Verify that a tab change event is handled appropriately.
     */
Test the configuration tab view change method.
Verify that a tab change event is handled appropriately.
Test the configuration tab view change method . Verify that a tab change event is handled appropriately .
@Test
    public void testConfigTabViewChange()
    {
        assertThat(m_SUT.getConfigTabIndex(), is(0));
        TabChangeEvent changeEvent = mock(TabChangeEvent.class);
        Tab newTab = mock(Tab.class);
        Tab tab1 = mock(Tab.class);
        Tab tab2 = mock(Tab.class);
        Tab tab3 = mock(Tab.class);
        UIComponent comp = mock(UIComponent.class);
        List<UIComponent> tabList = new ArrayList<UIComponent>();
        tabList.add(tab1);
        tabList.add(tab2);
        tabList.add(tab3);
        when(changeEvent.getTab()).thenReturn(newTab);
        when(changeEvent.getComponent()).thenReturn(comp);
        when(comp.getChildren()).thenReturn(tabList);
        when(newTab.getTitle()).thenReturn("tab2");
        when(tab1.getTitle()).thenReturn("tab1");
        when(tab2.getTitle()).thenReturn("tab2");
        when(tab3.getTitle()).thenReturn("tab3");
        m_SUT.configTabViewChange(changeEvent);
        assertThat(m_SUT.getConfigTabIndex(), is(1));
    }
@ Test public void testConfigTabViewChange ( ) { assertThat ( m_SUT . getConfigTabIndex ( ) , is ( 0 ) ) ; TabChangeEvent changeEvent = mock ( TabChangeEvent . class ) ; Tab newTab = mock ( Tab . class ) ; Tab tab1 = mock ( Tab . class ) ; Tab tab2 = mock ( Tab . class ) ; Tab tab3 = mock ( Tab . class ) ; UIComponent comp = mock ( UIComponent . class ) ; List < UIComponent > tabList = new ArrayList < UIComponent > ( ) ; tabList . add ( tab1 ) ; tabList . add ( tab2 ) ; tabList . add ( tab3 ) ; when ( changeEvent . getTab ( ) ) . thenReturn ( newTab ) ; when ( changeEvent . getComponent ( ) ) . thenReturn ( comp ) ; when ( comp . getChildren ( ) ) . thenReturn ( tabList ) ; when ( newTab . getTitle ( ) ) . thenReturn ( "tab2" ) ; when ( tab1 . getTitle ( ) ) . thenReturn ( "tab1" ) ; when ( tab2 . getTitle ( ) ) . thenReturn ( "tab2" ) ; when ( tab3 . getTitle ( ) ) . thenReturn ( "tab3" ) ; m_SUT . configTabViewChange ( changeEvent ) ; assertThat ( m_SUT . getConfigTabIndex ( ) , is ( 1 ) ) ; }
Test the configuration tab view change method.
Test the configuration tab view change method .