mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestLinkLayer.java
public final void testSendEvent() throws CCommException, InterruptedException
    {
        final String linkName = "SendEvent";
        createLinkLayer(linkName);

        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, LinkLayer.TOPIC_DATA_SENT, 
                String.format("(%s=%s)", FactoryDescriptor.EVENT_PROP_OBJ_NAME, linkName));
   
        AddressManagerService addressMgrSvc = ServiceUtils.getService(m_Context, AddressManagerService.class);
        
        Address addr = addressMgrSvc.getOrCreateAddress("Example:30");
        
        //activate the link so that it can send the frame
        m_LinkLayer.activateLayer();
        
        LinkFrame frame = new BaseLinkFrame();
        m_LinkLayer.send(frame, addr);
        
        m_LastEvent = syncer.waitForEvent(2);
        
        assertThat((LinkFrame)m_LastEvent.getProperty(LinkLayer.EVENT_PROP_LINK_FRAME), is(frame));
        assertThat((Address)m_LastEvent.getProperty("dest." + Address.EVENT_PROP_ADDRESS_SUFFIX), is(addr));
        
        m_LinkLayer.deactivateLayer();
    }
/**
     * Verify that a {@link LinkLayer} will post an event when it sends data.
     */
Verify that a  LinkLayer will post an event when it sends data.
Verify that a LinkLayer will post an event when it sends data .
public final void testSendEvent() throws CCommException, InterruptedException
    {
        final String linkName = "SendEvent";
        createLinkLayer(linkName);
        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, LinkLayer.TOPIC_DATA_SENT, 
                String.format("(%s=%s)", FactoryDescriptor.EVENT_PROP_OBJ_NAME, linkName));
        AddressManagerService addressMgrSvc = ServiceUtils.getService(m_Context, AddressManagerService.class);
        Address addr = addressMgrSvc.getOrCreateAddress("Example:30");
        m_LinkLayer.activateLayer();
        LinkFrame frame = new BaseLinkFrame();
        m_LinkLayer.send(frame, addr);
        m_LastEvent = syncer.waitForEvent(2);
        assertThat((LinkFrame)m_LastEvent.getProperty(LinkLayer.EVENT_PROP_LINK_FRAME), is(frame));
        assertThat((Address)m_LastEvent.getProperty("dest." + Address.EVENT_PROP_ADDRESS_SUFFIX), is(addr));
        m_LinkLayer.deactivateLayer();
    }
public final void testSendEvent ( ) throws CCommException , InterruptedException { final String linkName = "SendEvent" ; createLinkLayer ( linkName ) ; EventHandlerSyncer syncer = new EventHandlerSyncer ( m_Context , LinkLayer . TOPIC_DATA_SENT , String . format ( "(%s=%s)" , FactoryDescriptor . EVENT_PROP_OBJ_NAME , linkName ) ) ; AddressManagerService addressMgrSvc = ServiceUtils . getService ( m_Context , AddressManagerService . class ) ; Address addr = addressMgrSvc . getOrCreateAddress ( "Example:30" ) ; m_LinkLayer . activateLayer ( ) ; LinkFrame frame = new BaseLinkFrame ( ) ; m_LinkLayer . send ( frame , addr ) ; m_LastEvent = syncer . waitForEvent ( 2 ) ; assertThat ( ( LinkFrame ) m_LastEvent . getProperty ( LinkLayer . EVENT_PROP_LINK_FRAME ) , is ( frame ) ) ; assertThat ( ( Address ) m_LastEvent . getProperty ( "dest." + Address . EVENT_PROP_ADDRESS_SUFFIX ) , is ( addr ) ) ; m_LinkLayer . deactivateLayer ( ) ; }
Verify that a {@link LinkLayer} will post an event when it sends data.
Verify that a { @link LinkLayer } will post an event when it sends data .
//activate the link so that it can send the frame