mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/util/TestRemoteInterfaceUtilities.java
@Test
    public final void testCreateMessageUnreachableSendEvent()
    {
        // construct a single message containing data within a namespace message
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder()
                .setName("test-name")
                .build();
        
        BaseNamespace baseNamespaceMessage = BaseNamespace.newBuilder()
                .setType(BaseMessageType.ControllerInfo)
                .setData(systemInfoData.toByteString())
                .build();
        
        TerraHarvestMessage message = 
                TerraHarvestMessageHelper.createTerraHarvestMessage(0, 1, Namespace.Base, 100, baseNamespaceMessage);
        
        Event event = RemoteInterfaceUtilities.createMessageUnreachableSendEvent(message);
        
        // now test all properties and the topic
        assertThat(event.getTopic(), is(RemoteConstants.TOPIC_MESSAGE_SEND_UNREACHABLE_DEST));
        assertThat((TerraHarvestMessage)event.getProperty(RemoteConstants.EVENT_PROP_MESSAGE), is(message));
        assertThat((Integer)event.getProperty(RemoteConstants.EVENT_PROP_SOURCE_ID), is(0));
        assertThat((Integer)event.getProperty(RemoteConstants.EVENT_PROP_DEST_ID), is(1));
    }
/**
     * Verify the event is created with the proper topic and properties.
     */
Verify the event is created with the proper topic and properties.
Verify the event is created with the proper topic and properties .
@Test
    public final void testCreateMessageUnreachableSendEvent()
    {
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder()
                .setName("test-name")
                .build();
        BaseNamespace baseNamespaceMessage = BaseNamespace.newBuilder()
                .setType(BaseMessageType.ControllerInfo)
                .setData(systemInfoData.toByteString())
                .build();
        TerraHarvestMessage message = 
                TerraHarvestMessageHelper.createTerraHarvestMessage(0, 1, Namespace.Base, 100, baseNamespaceMessage);
        Event event = RemoteInterfaceUtilities.createMessageUnreachableSendEvent(message);
        assertThat(event.getTopic(), is(RemoteConstants.TOPIC_MESSAGE_SEND_UNREACHABLE_DEST));
        assertThat((TerraHarvestMessage)event.getProperty(RemoteConstants.EVENT_PROP_MESSAGE), is(message));
        assertThat((Integer)event.getProperty(RemoteConstants.EVENT_PROP_SOURCE_ID), is(0));
        assertThat((Integer)event.getProperty(RemoteConstants.EVENT_PROP_DEST_ID), is(1));
    }
@ Test public final void testCreateMessageUnreachableSendEvent ( ) { ControllerInfoData systemInfoData = ControllerInfoData . newBuilder ( ) . setName ( "test-name" ) . build ( ) ; BaseNamespace baseNamespaceMessage = BaseNamespace . newBuilder ( ) . setType ( BaseMessageType . ControllerInfo ) . setData ( systemInfoData . toByteString ( ) ) . build ( ) ; TerraHarvestMessage message = TerraHarvestMessageHelper . createTerraHarvestMessage ( 0 , 1 , Namespace . Base , 100 , baseNamespaceMessage ) ; Event event = RemoteInterfaceUtilities . createMessageUnreachableSendEvent ( message ) ; assertThat ( event . getTopic ( ) , is ( RemoteConstants . TOPIC_MESSAGE_SEND_UNREACHABLE_DEST ) ) ; assertThat ( ( TerraHarvestMessage ) event . getProperty ( RemoteConstants . EVENT_PROP_MESSAGE ) , is ( message ) ) ; assertThat ( ( Integer ) event . getProperty ( RemoteConstants . EVENT_PROP_SOURCE_ID ) , is ( 0 ) ) ; assertThat ( ( Integer ) event . getProperty ( RemoteConstants . EVENT_PROP_DEST_ID ) , is ( 1 ) ) ; }
Verify the event is created with the proper topic and properties.
Verify the event is created with the proper topic and properties .
// construct a single message containing data within a namespace message // now test all properties and the topic