mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestObservationQueryImpl.java
@Test
    public void testMaxObservations()
    {
        // replay
        ObservationQuery rv = m_SUT.withMaxObservations(300);
        m_SUT.execute();
        
        ArgumentCaptor<Query> query = ArgumentCaptor.forClass(Query.class);
        verify(m_DataStore).executeJdoQuery(query.capture());
        
        // verify return value is the same object for method chaining
        assertThat((ObservationQueryImpl)rv, is(m_SUT));
        
        // verify
        verify(query.getValue()).setRange(0, 300);
        
        // replay to get exactly one
        m_SUT.withMaxObservations(400);
        m_SUT.execute();
        
        verify(m_DataStore, times(2)).executeJdoQuery(query.capture());
        
        // verify range is set again
        verify(query.getValue()).setRange(0, 400);
    }
/**
     * Verify max observations setting will produce a valid filter.
     */
Verify max observations setting will produce a valid filter.
Verify max observations setting will produce a valid filter .
@Test
    public void testMaxObservations()
    {
        ObservationQuery rv = m_SUT.withMaxObservations(300);
        m_SUT.execute();
        ArgumentCaptor<Query> query = ArgumentCaptor.forClass(Query.class);
        verify(m_DataStore).executeJdoQuery(query.capture());
        assertThat((ObservationQueryImpl)rv, is(m_SUT));
        verify(query.getValue()).setRange(0, 300);
         to get exactly one
        m_SUT.withMaxObservations(400);
        m_SUT.execute();
        verify(m_DataStore, times(2)).executeJdoQuery(query.capture());
         range is set again
        verify(query.getValue()).setRange(0, 400);
    }
@ Test public void testMaxObservations ( ) { ObservationQuery rv = m_SUT . withMaxObservations ( 300 ) ; m_SUT . execute ( ) ; ArgumentCaptor < Query > query = ArgumentCaptor . forClass ( Query . class ) ; verify ( m_DataStore ) . executeJdoQuery ( query . capture ( ) ) ; assertThat ( ( ObservationQueryImpl ) rv , is ( m_SUT ) ) ; verify ( query . getValue ( ) ) . setRange ( 0 , 300 ) ; m_SUT . withMaxObservations ( 400 ) ; m_SUT . execute ( ) ; verify ( m_DataStore , times ( 2 ) ) . executeJdoQuery ( query . capture ( ) ) ; verify ( query . getValue ( ) ) . setRange ( 0 , 400 ) ; }
Verify max observations setting will produce a valid filter.
Verify max observations setting will produce a valid filter .
// replay // verify return value is the same object for method chaining // verify // replay to get exactly one // verify range is set again