mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestTransportLayer.java
public final void testCapabilities() 
        throws CCommException, InterruptedException, IllegalArgumentException, FactoryException, UnmarshalException
    {
        //echo transport
        CustomCommsService customCommsService = ServiceUtils.getService(m_Context, CustomCommsService.class);
        Set<TransportLayerFactory> factories = 
                customCommsService.getTransportLayerFactories();
        
        boolean foundFactory = false;
        boolean foundConnOrientedFactory = false;
        for (TransportLayerFactory factory : factories)
        {
            if (factory.getProductType().equals(EchoTransport.class.getName()))
            {
                foundFactory = true;
                assertThat(factory.getCapabilities().getProductName(), is("Echo Transport"));
                assertThat(factory.getCapabilities().getDescription(), 
                    is("An example transport layer that echoes messages back through the same transport layer"));
            }
            
            if (factory.getProductType().equals(ConnectionOrientedTransport.class.getName()))
            {
                foundConnOrientedFactory = true;
                assertThat(factory.getCapabilities().getProductName(), is("Connection Oriented Transport"));
                assertThat(factory.getCapabilities().getDescription(), 
                        is("An example connection oriented transport layer that echoes messages sent back through "
                                + "the same transport layer"));
                assertThat(((TransportLayerCapabilities)factory.getCapabilities()).isConnectionOriented(), is(true));
            }
        }
        
        assertThat("Echo factory is found", foundFactory, is(true));
        assertThat("Connection Oriented Transport is found", foundConnOrientedFactory, is(true));
    }
/**
     * Verify a transport layer can get its name and description from the capabilities.
     */
Verify a transport layer can get its name and description from the capabilities.
Verify a transport layer can get its name and description from the capabilities .
public final void testCapabilities() 
        throws CCommException, InterruptedException, IllegalArgumentException, FactoryException, UnmarshalException
    {
        CustomCommsService customCommsService = ServiceUtils.getService(m_Context, CustomCommsService.class);
        Set<TransportLayerFactory> factories = 
                customCommsService.getTransportLayerFactories();
        boolean foundFactory = false;
        boolean foundConnOrientedFactory = false;
        for (TransportLayerFactory factory : factories)
        {
            if (factory.getProductType().equals(EchoTransport.class.getName()))
            {
                foundFactory = true;
                assertThat(factory.getCapabilities().getProductName(), is("Echo Transport"));
                assertThat(factory.getCapabilities().getDescription(), 
                    is("An example transport layer that echoes messages back through the same transport layer"));
            }
            if (factory.getProductType().equals(ConnectionOrientedTransport.class.getName()))
            {
                foundConnOrientedFactory = true;
                assertThat(factory.getCapabilities().getProductName(), is("Connection Oriented Transport"));
                assertThat(factory.getCapabilities().getDescription(), 
                        is("An example connection oriented transport layer that echoes messages sent back through "
                                + "the same transport layer"));
                assertThat(((TransportLayerCapabilities)factory.getCapabilities()).isConnectionOriented(), is(true));
            }
        }
        assertThat("Echo factory is found", foundFactory, is(true));
        assertThat("Connection Oriented Transport is found", foundConnOrientedFactory, is(true));
    }
public final void testCapabilities ( ) throws CCommException , InterruptedException , IllegalArgumentException , FactoryException , UnmarshalException { CustomCommsService customCommsService = ServiceUtils . getService ( m_Context , CustomCommsService . class ) ; Set < TransportLayerFactory > factories = customCommsService . getTransportLayerFactories ( ) ; boolean foundFactory = false ; boolean foundConnOrientedFactory = false ; for ( TransportLayerFactory factory : factories ) { if ( factory . getProductType ( ) . equals ( EchoTransport . class . getName ( ) ) ) { foundFactory = true ; assertThat ( factory . getCapabilities ( ) . getProductName ( ) , is ( "Echo Transport" ) ) ; assertThat ( factory . getCapabilities ( ) . getDescription ( ) , is ( "An example transport layer that echoes messages back through the same transport layer" ) ) ; } if ( factory . getProductType ( ) . equals ( ConnectionOrientedTransport . class . getName ( ) ) ) { foundConnOrientedFactory = true ; assertThat ( factory . getCapabilities ( ) . getProductName ( ) , is ( "Connection Oriented Transport" ) ) ; assertThat ( factory . getCapabilities ( ) . getDescription ( ) , is ( "An example connection oriented transport layer that echoes messages sent back through " + "the same transport layer" ) ) ; assertThat ( ( ( TransportLayerCapabilities ) factory . getCapabilities ( ) ) . isConnectionOriented ( ) , is ( true ) ) ; } } assertThat ( "Echo factory is found" , foundFactory , is ( true ) ) ; assertThat ( "Connection Oriented Transport is found" , foundConnOrientedFactory , is ( true ) ) ; }
Verify a transport layer can get its name and description from the capabilities.
Verify a transport layer can get its name and description from the capabilities .
//echo transport