mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/controller/TestObservationCountMgrImpl.java
@Test
    public void testGetObservationCount()
    {
        //Test initial retrieval for unknown controller adds controller and returns zero for obs count.
        assertThat(m_SUT.getObservationCount(CONTROLLER_ID), is(0));
        
        Event persistEvent = mockObsPersisted();
        m_ObsEventHandler.handleEvent(persistEvent);
        
        //Verify correct obs count is returned.
        assertThat(m_SUT.getObservationCount(CONTROLLER_ID), is(1));
        
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        
        Event pushEvent = eventCaptor.getValue();
        assertThat(pushEvent, notNullValue());
        
        assertThat(pushEvent.getTopic(), is(ObservationCountMgr.TOPIC_OBSERVATION_COUNT_UPDATED));
        assertThat((int)pushEvent.getProperty(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID), is(CONTROLLER_ID));
        assertThat((int)pushEvent.getProperty(ObservationCountMgr.EVENT_PROP_OBS_COUNT), is(1));
    }
/**
     * Test retrieving the observation count for a controller.
     * Verify the observation count returned is correct.
     */
Test retrieving the observation count for a controller.
Verify the observation count returned is correct.
Test retrieving the observation count for a controller . Verify the observation count returned is correct .
@Test
    public void testGetObservationCount()
    {
        assertThat(m_SUT.getObservationCount(CONTROLLER_ID), is(0));
        Event persistEvent = mockObsPersisted();
        m_ObsEventHandler.handleEvent(persistEvent);
        assertThat(m_SUT.getObservationCount(CONTROLLER_ID), is(1));
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event pushEvent = eventCaptor.getValue();
        assertThat(pushEvent, notNullValue());
        assertThat(pushEvent.getTopic(), is(ObservationCountMgr.TOPIC_OBSERVATION_COUNT_UPDATED));
        assertThat((int)pushEvent.getProperty(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID), is(CONTROLLER_ID));
        assertThat((int)pushEvent.getProperty(ObservationCountMgr.EVENT_PROP_OBS_COUNT), is(1));
    }
@ Test public void testGetObservationCount ( ) { assertThat ( m_SUT . getObservationCount ( CONTROLLER_ID ) , is ( 0 ) ) ; Event persistEvent = mockObsPersisted ( ) ; m_ObsEventHandler . handleEvent ( persistEvent ) ; assertThat ( m_SUT . getObservationCount ( CONTROLLER_ID ) , is ( 1 ) ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event pushEvent = eventCaptor . getValue ( ) ; assertThat ( pushEvent , notNullValue ( ) ) ; assertThat ( pushEvent . getTopic ( ) , is ( ObservationCountMgr . TOPIC_OBSERVATION_COUNT_UPDATED ) ) ; assertThat ( ( int ) pushEvent . getProperty ( SharedPropertyConstants . EVENT_PROP_CONTROLLER_ID ) , is ( CONTROLLER_ID ) ) ; assertThat ( ( int ) pushEvent . getProperty ( ObservationCountMgr . EVENT_PROP_OBS_COUNT ) , is ( 1 ) ) ; }
Test retrieving the observation count for a controller.
Test retrieving the observation count for a controller .
//Test initial retrieval for unknown controller adds controller and returns zero for obs count. //Verify correct obs count is returned.