mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsLayerTypesMgrImpl.java
@Test
    public void testGetCommsTypes()
    {
        //test transport layer types
        Event getTypes = mockMessageGetCommsTypesResponse(systemId1, CommType.TransportLayer);
        m_CommsHelper.handleEvent(getTypes);

        List<String> transportTypes = m_SUT.getTransportLayerTypes(systemId1);
        //verify
        assertThat(transportTypes.size(), is(3));

        //verify the FQCNs were found
        assertThat(transportTypes, hasItem("class.name.one"));
        assertThat(transportTypes, hasItem("class.name.two"));
        assertThat(transportTypes, hasItem("class.name.three"));

        //test link layer types
        getTypes = mockMessageGetCommsTypesResponse(systemId1, CommType.Linklayer);
        m_CommsHelper.handleEvent(getTypes);

        List<String> linkTypes = m_SUT.getLinkLayerTypes(systemId1);
        //verify
        assertThat(linkTypes.size(), is(3));

        //verify the FQCNs were found
        assertThat(linkTypes, hasItem("class.name.one"));
        assertThat(linkTypes, hasItem("class.name.two"));
        assertThat(linkTypes, hasItem("class.name.three"));
        
        //test physical link types
        getTypes = mockMessageGetCommsTypesResponse(systemId1, CommType.PhysicalLink);
        m_CommsHelper.handleEvent(getTypes);

        List<String> physTypes = m_SUT.getPhysicalLinkClasses(systemId1);
        //verify
        assertThat(physTypes.size(), is(3));

        //verify the FQCNs were found
        assertThat(physTypes, hasItem("class.name.one"));
        assertThat(physTypes, hasItem("class.name.two"));
        assertThat(physTypes, hasItem("class.name.three"));
        
        //verify that handler will send get capabilities request
        verify(m_MessageFactory, times(9)).createCustomCommsMessage(
                eq(CustomCommsMessageType.GetCapabilitiesRequest), Mockito.any(Message.class));
        verify(m_MessageWrapper, times(9)).queue(eq(systemId1), Mockito.any(ResponseHandler.class));
        
        //verify an empty list is returned for each type
        assertThat(m_SUT.getLinkLayerTypes(8675309).size(), is(0));
        assertThat(m_SUT.getPhysicalLinkClasses(8675309).size(), is(0));
        assertThat(m_SUT.getTransportLayerTypes(8675309).size(), is(0));
    }
/**
     * Test the handling of the get comms types (transport, link, and physical).
     * Verify that the product types are correctly added.
     */
Test the handling of the get comms types (transport, link, and physical).
Verify that the product types are correctly added.
Test the handling of the get comms types ( transport link and physical ) . Verify that the product types are correctly added .
@Test
    public void testGetCommsTypes()
    {
        Event getTypes = mockMessageGetCommsTypesResponse(systemId1, CommType.TransportLayer);
        m_CommsHelper.handleEvent(getTypes);
        List<String> transportTypes = m_SUT.getTransportLayerTypes(systemId1);
        assertThat(transportTypes.size(), is(3));
         the FQCNs were found
        assertThat(transportTypes, hasItem("class.name.one"));
        assertThat(transportTypes, hasItem("class.name.two"));
        assertThat(transportTypes, hasItem("class.name.three"));
        getTypes = mockMessageGetCommsTypesResponse(systemId1, CommType.Linklayer);
        m_CommsHelper.handleEvent(getTypes);
        List<String> linkTypes = m_SUT.getLinkLayerTypes(systemId1);
        assertThat(linkTypes.size(), is(3));
         the FQCNs were found
        assertThat(linkTypes, hasItem("class.name.one"));
        assertThat(linkTypes, hasItem("class.name.two"));
        assertThat(linkTypes, hasItem("class.name.three"));
        getTypes = mockMessageGetCommsTypesResponse(systemId1, CommType.PhysicalLink);
        m_CommsHelper.handleEvent(getTypes);
        List<String> physTypes = m_SUT.getPhysicalLinkClasses(systemId1);
        assertThat(physTypes.size(), is(3));
         the FQCNs were found
        assertThat(physTypes, hasItem("class.name.one"));
        assertThat(physTypes, hasItem("class.name.two"));
        assertThat(physTypes, hasItem("class.name.three"));
         that handler will send get capabilities request
        verify(m_MessageFactory, times(9)).createCustomCommsMessage(
                eq(CustomCommsMessageType.GetCapabilitiesRequest), Mockito.any(Message.class));
        verify(m_MessageWrapper, times(9)).queue(eq(systemId1), Mockito.any(ResponseHandler.class));
         an empty list is returned for each type
        assertThat(m_SUT.getLinkLayerTypes(8675309).size(), is(0));
        assertThat(m_SUT.getPhysicalLinkClasses(8675309).size(), is(0));
        assertThat(m_SUT.getTransportLayerTypes(8675309).size(), is(0));
    }
@ Test public void testGetCommsTypes ( ) { Event getTypes = mockMessageGetCommsTypesResponse ( systemId1 , CommType . TransportLayer ) ; m_CommsHelper . handleEvent ( getTypes ) ; List < String > transportTypes = m_SUT . getTransportLayerTypes ( systemId1 ) ; assertThat ( transportTypes . size ( ) , is ( 3 ) ) ; assertThat ( transportTypes , hasItem ( "class.name.one" ) ) ; assertThat ( transportTypes , hasItem ( "class.name.two" ) ) ; assertThat ( transportTypes , hasItem ( "class.name.three" ) ) ; getTypes = mockMessageGetCommsTypesResponse ( systemId1 , CommType . Linklayer ) ; m_CommsHelper . handleEvent ( getTypes ) ; List < String > linkTypes = m_SUT . getLinkLayerTypes ( systemId1 ) ; assertThat ( linkTypes . size ( ) , is ( 3 ) ) ; assertThat ( linkTypes , hasItem ( "class.name.one" ) ) ; assertThat ( linkTypes , hasItem ( "class.name.two" ) ) ; assertThat ( linkTypes , hasItem ( "class.name.three" ) ) ; getTypes = mockMessageGetCommsTypesResponse ( systemId1 , CommType . PhysicalLink ) ; m_CommsHelper . handleEvent ( getTypes ) ; List < String > physTypes = m_SUT . getPhysicalLinkClasses ( systemId1 ) ; assertThat ( physTypes . size ( ) , is ( 3 ) ) ; assertThat ( physTypes , hasItem ( "class.name.one" ) ) ; assertThat ( physTypes , hasItem ( "class.name.two" ) ) ; assertThat ( physTypes , hasItem ( "class.name.three" ) ) ; verify ( m_MessageFactory , times ( 9 ) ) . createCustomCommsMessage ( eq ( CustomCommsMessageType . GetCapabilitiesRequest ) , Mockito . any ( Message . class ) ) ; verify ( m_MessageWrapper , times ( 9 ) ) . queue ( eq ( systemId1 ) , Mockito . any ( ResponseHandler . class ) ) ; assertThat ( m_SUT . getLinkLayerTypes ( 8675309 ) . size ( ) , is ( 0 ) ) ; assertThat ( m_SUT . getPhysicalLinkClasses ( 8675309 ) . size ( ) , is ( 0 ) ) ; assertThat ( m_SUT . getTransportLayerTypes ( 8675309 ) . size ( ) , is ( 0 ) ) ; }
Test the handling of the get comms types (transport, link, and physical).
Test the handling of the get comms types ( transport link and physical ) .
//test transport layer types //verify //verify the FQCNs were found //test link layer types //verify //verify the FQCNs were found //test physical link types //verify //verify the FQCNs were found //verify that handler will send get capabilities request //verify an empty list is returned for each type