mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/channel/TestChannelGuiDialogHelper.java
@Test
    public void testChannelChoicesGetImage()
    {
        List<NewChannelChoice> choices = m_SUT.getChannelChoices();
        
        assertThat(choices.size(), is(3));
        
        for (int x = 0; x < choices.size(); x++)
        {
            if (choices.get(x).getChannelName().equals("Socket"))
            {
                assertThat(choices.get(x).getImage(), is(COMMS_ICON_SOCKET));
            }
            else if (choices.get(x).getChannelName().equals("TransportLayer1"))
            {
                assertThat(choices.get(x).getImage(), is(COMMS_ICON_GENERIC));
            }
            else if (choices.get(x).getChannelName().equals("TransportLayer2"))
            {
                TransportLayerCapabilities transCaps = mock(TransportLayerCapabilities.class);
                when(choices.get(x).getCapabilities()).thenReturn(transCaps);
                
                List<LinkLayerTypeEnum> linkLayerMods = new ArrayList<>();
                linkLayerMods.add(LinkLayerTypeEnum.CELLULAR);
                
                when(transCaps.getLinkLayerModalitiesSupported()).thenReturn(linkLayerMods);
                
                choices.get(x).setCapabilities(transCaps);
                
                assertThat(choices.get(x).getImage(), is("thoseIcons/comms/comms_" + 
                        choices.get(x).getCapabilities().getLinkLayerModalitiesSupported().
                            get(0).toString().toLowerCase() + ".png"));
            }
        }
    }
/**
     * Verify the get image works properly.. channel name of socket returns the socket image, channel with no 
     * capabilities or no list of link layer modalities supported returns the generic comms image, channel with 
     * capabilities and has a list of link layer modalities supported will return the first modality supported in the 
     * list and display the image for it.
     */
Verify the get image works properly.. channel name of socket returns the socket image, channel with no
capabilities or no list of link layer modalities supported returns the generic comms image, channel with
capabilities and has a list of link layer modalities supported will return the first modality supported in the
list and display the image for it.
Verify the get image works properly .. channel name of socket returns the socket image channel with no capabilities or no list of link layer modalities supported returns the generic comms image channel with capabilities and has a list of link layer modalities supported will return the first modality supported in the list and display the image for it .
@Test
    public void testChannelChoicesGetImage()
    {
        List<NewChannelChoice> choices = m_SUT.getChannelChoices();
        assertThat(choices.size(), is(3));
        for (int x = 0; x < choices.size(); x++)
        {
            if (choices.get(x).getChannelName().equals("Socket"))
            {
                assertThat(choices.get(x).getImage(), is(COMMS_ICON_SOCKET));
            }
            else if (choices.get(x).getChannelName().equals("TransportLayer1"))
            {
                assertThat(choices.get(x).getImage(), is(COMMS_ICON_GENERIC));
            }
            else if (choices.get(x).getChannelName().equals("TransportLayer2"))
            {
                TransportLayerCapabilities transCaps = mock(TransportLayerCapabilities.class);
                when(choices.get(x).getCapabilities()).thenReturn(transCaps);
                List<LinkLayerTypeEnum> linkLayerMods = new ArrayList<>();
                linkLayerMods.add(LinkLayerTypeEnum.CELLULAR);
                when(transCaps.getLinkLayerModalitiesSupported()).thenReturn(linkLayerMods);
                choices.get(x).setCapabilities(transCaps);
                assertThat(choices.get(x).getImage(), is("thoseIcons/comms/comms_" + 
                        choices.get(x).getCapabilities().getLinkLayerModalitiesSupported().
                            get(0).toString().toLowerCase() + ".png"));
            }
        }
    }
@ Test public void testChannelChoicesGetImage ( ) { List < NewChannelChoice > choices = m_SUT . getChannelChoices ( ) ; assertThat ( choices . size ( ) , is ( 3 ) ) ; for ( int x = 0 ; x < choices . size ( ) ; x ++ ) { if ( choices . get ( x ) . getChannelName ( ) . equals ( "Socket" ) ) { assertThat ( choices . get ( x ) . getImage ( ) , is ( COMMS_ICON_SOCKET ) ) ; } else if ( choices . get ( x ) . getChannelName ( ) . equals ( "TransportLayer1" ) ) { assertThat ( choices . get ( x ) . getImage ( ) , is ( COMMS_ICON_GENERIC ) ) ; } else if ( choices . get ( x ) . getChannelName ( ) . equals ( "TransportLayer2" ) ) { TransportLayerCapabilities transCaps = mock ( TransportLayerCapabilities . class ) ; when ( choices . get ( x ) . getCapabilities ( ) ) . thenReturn ( transCaps ) ; List < LinkLayerTypeEnum > linkLayerMods = new ArrayList < > ( ) ; linkLayerMods . add ( LinkLayerTypeEnum . CELLULAR ) ; when ( transCaps . getLinkLayerModalitiesSupported ( ) ) . thenReturn ( linkLayerMods ) ; choices . get ( x ) . setCapabilities ( transCaps ) ; assertThat ( choices . get ( x ) . getImage ( ) , is ( "thoseIcons/comms/comms_" + choices . get ( x ) . getCapabilities ( ) . getLinkLayerModalitiesSupported ( ) . get ( 0 ) . toString ( ) . toLowerCase ( ) + ".png" ) ) ; } } }
Verify the get image works properly.. channel name of socket returns the socket image, channel with no
 capabilities or no list of link layer modalities supported returns the generic comms image, channel with
 capabilities and has a list of link layer modalities supported will return the first modality supported in the
 list and display the image for it.
Verify the get image works properly .. channel name of socket returns the socket image channel with no capabilities or no list of link layer modalities supported returns the generic comms image channel with capabilities and has a list of link layer modalities supported will return the first modality supported in the list and display the image for it .