mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestSelectedCommsHelper.java
@Test
    public void testRemoveStack()
    {
        CommsStackModelImpl stack = new CommsStackModelImpl(m_CommsImageInterface);
        CommsLayerBaseModel trans = new CommsLayerBaseModel(0, uuid, pid, "clazz", 
                CommType.TransportLayer, m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        CommsLayerLinkModelImpl link = new CommsLayerLinkModelImpl(0, uuid2, pid, pid, 
                m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        
        stack.setTransport(trans);
        stack.setLink(link);
        
        m_SUT.setRemoveStack(stack);
        
        String removeNames = m_SUT.getRemoveStackLayerNames();
        
        assertThat(removeNames.contains(uuid.toString()), is(true));
        assertThat(removeNames.contains(uuid2.toString()), is(true));  
        
        m_SUT.sendRemoveStackRequest(123);
        
        verify(m_MessageFactory).createTransportLayerMessage(eq(TransportLayerMessageType.
                DeleteRequest), Mockito.any(Message.class));
        verify(m_MessageWrapper, times(2)).queue(Mockito.anyInt(), (ResponseHandler) eq(null));
        
        verify(m_MessageFactory).createLinkLayerMessage(eq(LinkLayerMessageType.DeleteRequest), 
                Mockito.any(Message.class));
        verify(m_MessageWrapper, times(2)).queue(Mockito.anyInt(), (ResponseHandler) eq(null));
        
        //test null values
        stack.setTransport(null);
        stack.setLink(null);
        
        assertThat( m_SUT.getRemoveStackLayerNames(), is(""));
    }
/**
     * Test remove stack functionality.
     * Verify names of layers to be removed.
     * Verify remote message to remove transport and link layer is sent.  
     */
Test remove stack functionality.
Verify names of layers to be removed.
Verify remote message to remove transport and link layer is sent.
Test remove stack functionality . Verify names of layers to be removed . Verify remote message to remove transport and link layer is sent .
@Test
    public void testRemoveStack()
    {
        CommsStackModelImpl stack = new CommsStackModelImpl(m_CommsImageInterface);
        CommsLayerBaseModel trans = new CommsLayerBaseModel(0, uuid, pid, "clazz", 
                CommType.TransportLayer, m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        CommsLayerLinkModelImpl link = new CommsLayerLinkModelImpl(0, uuid2, pid, pid, 
                m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        stack.setTransport(trans);
        stack.setLink(link);
        m_SUT.setRemoveStack(stack);
        String removeNames = m_SUT.getRemoveStackLayerNames();
        assertThat(removeNames.contains(uuid.toString()), is(true));
        assertThat(removeNames.contains(uuid2.toString()), is(true));  
        m_SUT.sendRemoveStackRequest(123);
        verify(m_MessageFactory).createTransportLayerMessage(eq(TransportLayerMessageType.
                DeleteRequest), Mockito.any(Message.class));
        verify(m_MessageWrapper, times(2)).queue(Mockito.anyInt(), (ResponseHandler) eq(null));
        verify(m_MessageFactory).createLinkLayerMessage(eq(LinkLayerMessageType.DeleteRequest), 
                Mockito.any(Message.class));
        verify(m_MessageWrapper, times(2)).queue(Mockito.anyInt(), (ResponseHandler) eq(null));
        stack.setTransport(null);
        stack.setLink(null);
        assertThat( m_SUT.getRemoveStackLayerNames(), is(""));
    }
@ Test public void testRemoveStack ( ) { CommsStackModelImpl stack = new CommsStackModelImpl ( m_CommsImageInterface ) ; CommsLayerBaseModel trans = new CommsLayerBaseModel ( 0 , uuid , pid , "clazz" , CommType . TransportLayer , m_FactoryMgr , m_TypesMgr , m_ConfigWrapper , m_CommsImageInterface ) ; CommsLayerLinkModelImpl link = new CommsLayerLinkModelImpl ( 0 , uuid2 , pid , pid , m_FactoryMgr , m_TypesMgr , m_ConfigWrapper , m_CommsImageInterface ) ; stack . setTransport ( trans ) ; stack . setLink ( link ) ; m_SUT . setRemoveStack ( stack ) ; String removeNames = m_SUT . getRemoveStackLayerNames ( ) ; assertThat ( removeNames . contains ( uuid . toString ( ) ) , is ( true ) ) ; assertThat ( removeNames . contains ( uuid2 . toString ( ) ) , is ( true ) ) ; m_SUT . sendRemoveStackRequest ( 123 ) ; verify ( m_MessageFactory ) . createTransportLayerMessage ( eq ( TransportLayerMessageType . DeleteRequest ) , Mockito . any ( Message . class ) ) ; verify ( m_MessageWrapper , times ( 2 ) ) . queue ( Mockito . anyInt ( ) , ( ResponseHandler ) eq ( null ) ) ; verify ( m_MessageFactory ) . createLinkLayerMessage ( eq ( LinkLayerMessageType . DeleteRequest ) , Mockito . any ( Message . class ) ) ; verify ( m_MessageWrapper , times ( 2 ) ) . queue ( Mockito . anyInt ( ) , ( ResponseHandler ) eq ( null ) ) ; stack . setTransport ( null ) ; stack . setLink ( null ) ; assertThat ( m_SUT . getRemoveStackLayerNames ( ) , is ( "" ) ) ; }
Test remove stack functionality.
Test remove stack functionality .
//test null values