mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestRetrieveDeleteObsHelperImpl.java
@Test
    public void testRemoteRetrievalAllAssetsTimeConstraintAndNumber()
    {
        //date objs
        Date start = new Date(9000L);
        Date stop = new Date(11000L);
        
        //dates
        m_SUT.setRetrieveByMaxObsNum(true);
        m_SUT.setRetrieveDeleteByDate(true);
        m_SUT.setStartDate(start);
        m_SUT.setEndDate(stop);
        m_SUT.setMaxObservationNumber(4);
        
        //request for observations
        m_SUT.submitRetrieveObservationsRequest(null);
        
        //verify call to remote message sender for all asset observations
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        //should be two requests one for each asset type
        verify(m_MessageFactory).createObservationStoreMessage(
            eq(ObservationStoreMessageType.GetObservationRequest), messageCaptor.capture());
        verify(m_MessageWrapper).queue(eq(CONTROLLER_ID), eq((ResponseHandler)null));
        
        //verify data messages
        GetObservationRequestData requestData = (GetObservationRequestData)messageCaptor.getAllValues().get(0);
        Query query = requestData.getObsQuery();
        assertThat(query.hasMaxNumberOfObs(), is(true));
        assertThat(query.hasCreatedTimeRange(), is(true));
        TimeConstraintData timeData = query.getCreatedTimeRange();
        assertThat(timeData.getStartTime(), is(start.getTime()));
        assertThat(timeData.getStopTime(), is(11999L));
        
        assertThat(query.hasAssetType(), is(false));
        assertThat(query.getMaxNumberOfObs(), is(4));
    }
/**
     * Verify the remote request to retrieve Observations for all known assets with time constraint and max number.
     */
Verify the remote request to retrieve Observations for all known assets with time constraint and max number.
Verify the remote request to retrieve Observations for all known assets with time constraint and max number .
@Test
    public void testRemoteRetrievalAllAssetsTimeConstraintAndNumber()
    {
        Date start = new Date(9000L);
        Date stop = new Date(11000L);
        m_SUT.setRetrieveByMaxObsNum(true);
        m_SUT.setRetrieveDeleteByDate(true);
        m_SUT.setStartDate(start);
        m_SUT.setEndDate(stop);
        m_SUT.setMaxObservationNumber(4);
        m_SUT.submitRetrieveObservationsRequest(null);
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        verify(m_MessageFactory).createObservationStoreMessage(
            eq(ObservationStoreMessageType.GetObservationRequest), messageCaptor.capture());
        verify(m_MessageWrapper).queue(eq(CONTROLLER_ID), eq((ResponseHandler)null));
        GetObservationRequestData requestData = (GetObservationRequestData)messageCaptor.getAllValues().get(0);
        Query query = requestData.getObsQuery();
        assertThat(query.hasMaxNumberOfObs(), is(true));
        assertThat(query.hasCreatedTimeRange(), is(true));
        TimeConstraintData timeData = query.getCreatedTimeRange();
        assertThat(timeData.getStartTime(), is(start.getTime()));
        assertThat(timeData.getStopTime(), is(11999L));
        assertThat(query.hasAssetType(), is(false));
        assertThat(query.getMaxNumberOfObs(), is(4));
    }
@ Test public void testRemoteRetrievalAllAssetsTimeConstraintAndNumber ( ) { Date start = new Date ( 9000L ) ; Date stop = new Date ( 11000L ) ; m_SUT . setRetrieveByMaxObsNum ( true ) ; m_SUT . setRetrieveDeleteByDate ( true ) ; m_SUT . setStartDate ( start ) ; m_SUT . setEndDate ( stop ) ; m_SUT . setMaxObservationNumber ( 4 ) ; m_SUT . submitRetrieveObservationsRequest ( null ) ; ArgumentCaptor < Message > messageCaptor = ArgumentCaptor . forClass ( Message . class ) ; verify ( m_MessageFactory ) . createObservationStoreMessage ( eq ( ObservationStoreMessageType . GetObservationRequest ) , messageCaptor . capture ( ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( CONTROLLER_ID ) , eq ( ( ResponseHandler ) null ) ) ; GetObservationRequestData requestData = ( GetObservationRequestData ) messageCaptor . getAllValues ( ) . get ( 0 ) ; Query query = requestData . getObsQuery ( ) ; assertThat ( query . hasMaxNumberOfObs ( ) , is ( true ) ) ; assertThat ( query . hasCreatedTimeRange ( ) , is ( true ) ) ; TimeConstraintData timeData = query . getCreatedTimeRange ( ) ; assertThat ( timeData . getStartTime ( ) , is ( start . getTime ( ) ) ) ; assertThat ( timeData . getStopTime ( ) , is ( 11999L ) ) ; assertThat ( query . hasAssetType ( ) , is ( false ) ) ; assertThat ( query . getMaxNumberOfObs ( ) , is ( 4 ) ) ; }
Verify the remote request to retrieve Observations for all known assets with time constraint and max number.
Verify the remote request to retrieve Observations for all known assets with time constraint and max number .
//date objs //dates //request for observations //verify call to remote message sender for all asset observations //should be two requests one for each asset type //verify data messages