mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/secondrun/TestRemoteEventConfigRegistration.java
@Test
    public void testCaptureDataRemoteEventRegXml() throws IOException
    {
        CreateAssetResponseData createAssetResponse = AssetNamespaceUtils.createAsset(m_Socket,
                ExampleAsset.class.getName(), "remoteConfigTestAssetXml", null);
        testUuid = createAssetResponse.getInfo().getUuid();
        MessageListener listener = new MessageListener(m_Socket);
        AssetNamespaceUtils.requestDataCapture(m_Socket, testUuid);
        
        //listen for response message 
        EventAdminNamespace message = (EventAdminNamespace)listener.waitForMessage(Namespace.EventAdmin, 
                EventAdminMessageType.SendEvent, 1000);
        SendEventData data = SendEventData.parseFrom(message.getData());
        assertThat(data.getTopic(), is("mil/dod/th/core/persistence/ObservationStore/OBSERVATION_PERSISTED_WITH_OBS"));
        Map<String, Object> props = new HashMap<>();
        for (ComplexTypesMapEntry entry : data.getPropertyList())
        {
            if (entry.hasObservationXml())
            {
                props.put(entry.getKey(), entry.getObservationXml());
            }
            else
            {
                props.put(entry.getKey(), entry.getMulti().getStringValue());
            }
        }
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_NAME), is("remoteConfigTestAssetXml"));
        assertThat(((ByteString)props.get("observation")).isEmpty(), is(false));
    }
/**
     * Verify event sent in response to the created asset's capturing of data.
     */
Verify event sent in response to the created asset's capturing of data.
Verify event sent in response to the created asset ' s capturing of data .
@Test
    public void testCaptureDataRemoteEventRegXml() throws IOException
    {
        CreateAssetResponseData createAssetResponse = AssetNamespaceUtils.createAsset(m_Socket,
                ExampleAsset.class.getName(), "remoteConfigTestAssetXml", null);
        testUuid = createAssetResponse.getInfo().getUuid();
        MessageListener listener = new MessageListener(m_Socket);
        AssetNamespaceUtils.requestDataCapture(m_Socket, testUuid);
        EventAdminNamespace message = (EventAdminNamespace)listener.waitForMessage(Namespace.EventAdmin, 
                EventAdminMessageType.SendEvent, 1000);
        SendEventData data = SendEventData.parseFrom(message.getData());
        assertThat(data.getTopic(), is("mil/dod/th/core/persistence/ObservationStore/OBSERVATION_PERSISTED_WITH_OBS"));
        Map<String, Object> props = new HashMap<>();
        for (ComplexTypesMapEntry entry : data.getPropertyList())
        {
            if (entry.hasObservationXml())
            {
                props.put(entry.getKey(), entry.getObservationXml());
            }
            else
            {
                props.put(entry.getKey(), entry.getMulti().getStringValue());
            }
        }
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_NAME), is("remoteConfigTestAssetXml"));
        assertThat(((ByteString)props.get("observation")).isEmpty(), is(false));
    }
@ Test public void testCaptureDataRemoteEventRegXml ( ) throws IOException { CreateAssetResponseData createAssetResponse = AssetNamespaceUtils . createAsset ( m_Socket , ExampleAsset . class . getName ( ) , "remoteConfigTestAssetXml" , null ) ; testUuid = createAssetResponse . getInfo ( ) . getUuid ( ) ; MessageListener listener = new MessageListener ( m_Socket ) ; AssetNamespaceUtils . requestDataCapture ( m_Socket , testUuid ) ; EventAdminNamespace message = ( EventAdminNamespace ) listener . waitForMessage ( Namespace . EventAdmin , EventAdminMessageType . SendEvent , 1000 ) ; SendEventData data = SendEventData . parseFrom ( message . getData ( ) ) ; assertThat ( data . getTopic ( ) , is ( "mil/dod/th/core/persistence/ObservationStore/OBSERVATION_PERSISTED_WITH_OBS" ) ) ; Map < String , Object > props = new HashMap < > ( ) ; for ( ComplexTypesMapEntry entry : data . getPropertyList ( ) ) { if ( entry . hasObservationXml ( ) ) { props . put ( entry . getKey ( ) , entry . getObservationXml ( ) ) ; } else { props . put ( entry . getKey ( ) , entry . getMulti ( ) . getStringValue ( ) ) ; } } assertThat ( ( String ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ_NAME ) , is ( "remoteConfigTestAssetXml" ) ) ; assertThat ( ( ( ByteString ) props . get ( "observation" ) ) . isEmpty ( ) , is ( false ) ) ; }
Verify event sent in response to the created asset's capturing of data.
Verify event sent in response to the created asset ' s capturing of data .
//listen for response message 