mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsStackRequest.java
@Test
    public void testGetSelectedCommsStacksOne()
    {
        List<CommsStackModel> stacks = m_SUT.getCommsStacksAsync(systemId1);
        List<CommsStackModel> selectedStacks = m_SUT.getSelectedCommsStacksAsync(systemId1, stacks.get(2));
        
        assertThat(selectedStacks.size(), is(1));
        
        assertThat(stacks.get(2).getTransport(), is(selectedStacks.get(0).getTransport()));
        assertThat(stacks.get(2).getLink(), is(selectedStacks.get(0).getLink()));
        assertThat(stacks.get(2).getPhysical(), is(selectedStacks.get(0).getPhysical()));
        
        //test null return
        when(m_CommsMgr.getLinksAsync(systemId1)).thenReturn(new ArrayList<CommsLayerLinkModelImpl>());
        when(m_CommsMgr.getTransportsAsync(systemId1)).thenReturn(new ArrayList<CommsLayerBaseModel>());
        when(m_CommsMgr.getPhysicalsAsync(systemId1)).thenReturn(new ArrayList<CommsLayerBaseModel>());
        
        selectedStacks = m_SUT.getSelectedCommsStacksAsync(systemId1, stacks.get(2));
    }
/**
     * Test return of of one comms stack.
     * Verify one stack is returned if a particular stack is selected.
     */
Test return of of one comms stack.
Verify one stack is returned if a particular stack is selected.
Test return of of one comms stack . Verify one stack is returned if a particular stack is selected .
@Test
    public void testGetSelectedCommsStacksOne()
    {
        List<CommsStackModel> stacks = m_SUT.getCommsStacksAsync(systemId1);
        List<CommsStackModel> selectedStacks = m_SUT.getSelectedCommsStacksAsync(systemId1, stacks.get(2));
        assertThat(selectedStacks.size(), is(1));
        assertThat(stacks.get(2).getTransport(), is(selectedStacks.get(0).getTransport()));
        assertThat(stacks.get(2).getLink(), is(selectedStacks.get(0).getLink()));
        assertThat(stacks.get(2).getPhysical(), is(selectedStacks.get(0).getPhysical()));
        when(m_CommsMgr.getLinksAsync(systemId1)).thenReturn(new ArrayList<CommsLayerLinkModelImpl>());
        when(m_CommsMgr.getTransportsAsync(systemId1)).thenReturn(new ArrayList<CommsLayerBaseModel>());
        when(m_CommsMgr.getPhysicalsAsync(systemId1)).thenReturn(new ArrayList<CommsLayerBaseModel>());
        selectedStacks = m_SUT.getSelectedCommsStacksAsync(systemId1, stacks.get(2));
    }
@ Test public void testGetSelectedCommsStacksOne ( ) { List < CommsStackModel > stacks = m_SUT . getCommsStacksAsync ( systemId1 ) ; List < CommsStackModel > selectedStacks = m_SUT . getSelectedCommsStacksAsync ( systemId1 , stacks . get ( 2 ) ) ; assertThat ( selectedStacks . size ( ) , is ( 1 ) ) ; assertThat ( stacks . get ( 2 ) . getTransport ( ) , is ( selectedStacks . get ( 0 ) . getTransport ( ) ) ) ; assertThat ( stacks . get ( 2 ) . getLink ( ) , is ( selectedStacks . get ( 0 ) . getLink ( ) ) ) ; assertThat ( stacks . get ( 2 ) . getPhysical ( ) , is ( selectedStacks . get ( 0 ) . getPhysical ( ) ) ) ; when ( m_CommsMgr . getLinksAsync ( systemId1 ) ) . thenReturn ( new ArrayList < CommsLayerLinkModelImpl > ( ) ) ; when ( m_CommsMgr . getTransportsAsync ( systemId1 ) ) . thenReturn ( new ArrayList < CommsLayerBaseModel > ( ) ) ; when ( m_CommsMgr . getPhysicalsAsync ( systemId1 ) ) . thenReturn ( new ArrayList < CommsLayerBaseModel > ( ) ) ; selectedStacks = m_SUT . getSelectedCommsStacksAsync ( systemId1 , stacks . get ( 2 ) ) ; }
Test return of of one comms stack.
Test return of of one comms stack .
//test null return