mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/TestAssetImpl.java
@Test
    public void testSetStatusSummary()
    {
        String statusDescription = "Something";
        SummaryStatusEnum statusSummary = SummaryStatusEnum.DEGRADED;

        m_SUT.setStatus(statusSummary, statusDescription);

        ArgumentCaptor<Event> evtCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, atLeastOnce()).postEvent(evtCaptor.capture());

        assertThat(evtCaptor.getValue().getTopic(), is(Asset.TOPIC_STATUS_CHANGED));
        assertThat((String)evtCaptor.getValue().getProperty(Asset.EVENT_PROP_ASSET_STATUS_DESCRIPTION),
                is("Something"));
        assertThat((String)evtCaptor.getValue().getProperty(Asset.EVENT_PROP_ASSET_STATUS_SUMMARY),
                is(SummaryStatusEnum.DEGRADED.toString()));
        assertThat(evtCaptor.getValue().getProperty(Asset.EVENT_PROP_ASSET_STATUS_OBSERVATION_UUID), notNullValue());

        Observation observation = m_SUT.getLastStatus();

        assertThat(observation.isSetStatus(), is(true));
        assertThat(observation.isSetSensorId(), is(false));
        assertThat(observation.getStatus().getSummaryStatus().getDescription(), is("Something"));
        assertThat(observation.getStatus().getSummaryStatus().getSummary(), is(SummaryStatusEnum.DEGRADED));
    }
/**
     * Verify that an OperatingStatus can be given and will be set on the asset.
     */
Verify that an OperatingStatus can be given and will be set on the asset.
Verify that an OperatingStatus can be given and will be set on the asset .
@Test
    public void testSetStatusSummary()
    {
        String statusDescription = "Something";
        SummaryStatusEnum statusSummary = SummaryStatusEnum.DEGRADED;
        m_SUT.setStatus(statusSummary, statusDescription);
        ArgumentCaptor<Event> evtCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, atLeastOnce()).postEvent(evtCaptor.capture());
        assertThat(evtCaptor.getValue().getTopic(), is(Asset.TOPIC_STATUS_CHANGED));
        assertThat((String)evtCaptor.getValue().getProperty(Asset.EVENT_PROP_ASSET_STATUS_DESCRIPTION),
                is("Something"));
        assertThat((String)evtCaptor.getValue().getProperty(Asset.EVENT_PROP_ASSET_STATUS_SUMMARY),
                is(SummaryStatusEnum.DEGRADED.toString()));
        assertThat(evtCaptor.getValue().getProperty(Asset.EVENT_PROP_ASSET_STATUS_OBSERVATION_UUID), notNullValue());
        Observation observation = m_SUT.getLastStatus();
        assertThat(observation.isSetStatus(), is(true));
        assertThat(observation.isSetSensorId(), is(false));
        assertThat(observation.getStatus().getSummaryStatus().getDescription(), is("Something"));
        assertThat(observation.getStatus().getSummaryStatus().getSummary(), is(SummaryStatusEnum.DEGRADED));
    }
@ Test public void testSetStatusSummary ( ) { String statusDescription = "Something" ; SummaryStatusEnum statusSummary = SummaryStatusEnum . DEGRADED ; m_SUT . setStatus ( statusSummary , statusDescription ) ; ArgumentCaptor < Event > evtCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin , atLeastOnce ( ) ) . postEvent ( evtCaptor . capture ( ) ) ; assertThat ( evtCaptor . getValue ( ) . getTopic ( ) , is ( Asset . TOPIC_STATUS_CHANGED ) ) ; assertThat ( ( String ) evtCaptor . getValue ( ) . getProperty ( Asset . EVENT_PROP_ASSET_STATUS_DESCRIPTION ) , is ( "Something" ) ) ; assertThat ( ( String ) evtCaptor . getValue ( ) . getProperty ( Asset . EVENT_PROP_ASSET_STATUS_SUMMARY ) , is ( SummaryStatusEnum . DEGRADED . toString ( ) ) ) ; assertThat ( evtCaptor . getValue ( ) . getProperty ( Asset . EVENT_PROP_ASSET_STATUS_OBSERVATION_UUID ) , notNullValue ( ) ) ; Observation observation = m_SUT . getLastStatus ( ) ; assertThat ( observation . isSetStatus ( ) , is ( true ) ) ; assertThat ( observation . isSetSensorId ( ) , is ( false ) ) ; assertThat ( observation . getStatus ( ) . getSummaryStatus ( ) . getDescription ( ) , is ( "Something" ) ) ; assertThat ( observation . getStatus ( ) . getSummaryStatus ( ) . getSummary ( ) , is ( SummaryStatusEnum . DEGRADED ) ) ; }
Verify that an OperatingStatus can be given and will be set on the asset.
Verify that an OperatingStatus can be given and will be set on the asset .