mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsStackModel.java
@Test
    public void testGetImage()
    {
        //verify no link layer or transport layer the default image will be shown
        CommsStackModelImpl model = new CommsStackModelImpl(m_CommsImageInterface);
        
        assertThat(model.getImage(), is("thoseIcons/comms/comms_generic.png"));
        
        CommsLayerBaseModel commsBaseModelPhys = mock(CommsLayerBaseModel.class);
        when(commsBaseModelPhys.getImage()).thenReturn("commsPhysLayerImage.png");
        model.setPhysical(commsBaseModelPhys);
        
        //verify when both transport layer and link layer are null the physical image is shown
        assertThat(model.getImage(), is("commsPhysLayerImage.png"));
        
        CommsLayerLinkModel linkModel = mock(CommsLayerLinkModel.class);
        when(linkModel.getImage()).thenReturn("linkLayerImage.png");
        model.setLink(linkModel);
        
        //verify when comms stack model has link layer and transport layer is null the get image on 
        //link layer is called
        assertThat(model.getImage(), is("linkLayerImage.png"));
        
        CommsLayerBaseModel commsBaseModelTrans = mock(CommsLayerBaseModel.class);
        when(commsBaseModelTrans.getImage()).thenReturn("commsTransLayerImage.png");
        
        model.setTransport(commsBaseModelTrans);
        
        //verify when comms stack model has link layer and transport layer trans link image is shown
        assertThat(model.getImage(), is("commsTransLayerImage.png"));
        
        //verify link layer is null and transport layer present the transport layer image is shown
        model = new CommsStackModelImpl(m_CommsImageInterface);
        model.setTransport(commsBaseModelTrans);
        
        assertThat(model.getImage(), is("commsTransLayerImage.png"));
    }
/**
     * Verify depending on whether or not the comms stack model has a link layer or a transport layer the correct 
     * image is displayed.
     */
Verify depending on whether or not the comms stack model has a link layer or a transport layer the correct
image is displayed.
Verify depending on whether or not the comms stack model has a link layer or a transport layer the correct image is displayed .
@Test
    public void testGetImage()
    {
        CommsStackModelImpl model = new CommsStackModelImpl(m_CommsImageInterface);
        assertThat(model.getImage(), is("thoseIcons/comms/comms_generic.png"));
        CommsLayerBaseModel commsBaseModelPhys = mock(CommsLayerBaseModel.class);
        when(commsBaseModelPhys.getImage()).thenReturn("commsPhysLayerImage.png");
        model.setPhysical(commsBaseModelPhys);
        assertThat(model.getImage(), is("commsPhysLayerImage.png"));
        CommsLayerLinkModel linkModel = mock(CommsLayerLinkModel.class);
        when(linkModel.getImage()).thenReturn("linkLayerImage.png");
        model.setLink(linkModel);
        assertThat(model.getImage(), is("linkLayerImage.png"));
        CommsLayerBaseModel commsBaseModelTrans = mock(CommsLayerBaseModel.class);
        when(commsBaseModelTrans.getImage()).thenReturn("commsTransLayerImage.png");
        model.setTransport(commsBaseModelTrans);
        assertThat(model.getImage(), is("commsTransLayerImage.png"));
        model = new CommsStackModelImpl(m_CommsImageInterface);
        model.setTransport(commsBaseModelTrans);
        assertThat(model.getImage(), is("commsTransLayerImage.png"));
    }
@ Test public void testGetImage ( ) { CommsStackModelImpl model = new CommsStackModelImpl ( m_CommsImageInterface ) ; assertThat ( model . getImage ( ) , is ( "thoseIcons/comms/comms_generic.png" ) ) ; CommsLayerBaseModel commsBaseModelPhys = mock ( CommsLayerBaseModel . class ) ; when ( commsBaseModelPhys . getImage ( ) ) . thenReturn ( "commsPhysLayerImage.png" ) ; model . setPhysical ( commsBaseModelPhys ) ; assertThat ( model . getImage ( ) , is ( "commsPhysLayerImage.png" ) ) ; CommsLayerLinkModel linkModel = mock ( CommsLayerLinkModel . class ) ; when ( linkModel . getImage ( ) ) . thenReturn ( "linkLayerImage.png" ) ; model . setLink ( linkModel ) ; assertThat ( model . getImage ( ) , is ( "linkLayerImage.png" ) ) ; CommsLayerBaseModel commsBaseModelTrans = mock ( CommsLayerBaseModel . class ) ; when ( commsBaseModelTrans . getImage ( ) ) . thenReturn ( "commsTransLayerImage.png" ) ; model . setTransport ( commsBaseModelTrans ) ; assertThat ( model . getImage ( ) , is ( "commsTransLayerImage.png" ) ) ; model = new CommsStackModelImpl ( m_CommsImageInterface ) ; model . setTransport ( commsBaseModelTrans ) ; assertThat ( model . getImage ( ) , is ( "commsTransLayerImage.png" ) ) ; }
Verify depending on whether or not the comms stack model has a link layer or a transport layer the correct
 image is displayed.
Verify depending on whether or not the comms stack model has a link layer or a transport layer the correct image is displayed .
//verify no link layer or transport layer the default image will be shown //verify when both transport layer and link layer are null the physical image is shown //verify when comms stack model has link layer and transport layer is null the get image on  //link layer is called //verify when comms stack model has link layer and transport layer trans link image is shown //verify link layer is null and transport layer present the transport layer image is shown