mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestObservationQueryImpl.java
@Test
    public void testTimeCreatedRange()
    {
        // replay
        ObservationQuery rv = m_SUT.withTimeCreatedRange(new Date(200), new Date(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()).setFilter("createdTimestamp >= 200 && createdTimestamp <= 300");
        
        rv = m_SUT.withTimeCreatedRange(new Date(500), new Date(500));
        m_SUT.execute();
        
        verify(m_DataStore, times(2)).executeJdoQuery(query.capture());
        
        // verify return value is the same object for method chaining
        assertThat((ObservationQueryImpl)rv, is(m_SUT));
        
        // verify
        verify(query.getValue()).setFilter("createdTimestamp >= 500 && createdTimestamp <= 500");
    }
/**
     * Verify a created time range will produce a valid filter.
     */
Verify a created time range will produce a valid filter.
Verify a created time range will produce a valid filter .
@Test
    public void testTimeCreatedRange()
    {
        ObservationQuery rv = m_SUT.withTimeCreatedRange(new Date(200), new Date(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()).setFilter("createdTimestamp >= 200 && createdTimestamp <= 300");
        rv = m_SUT.withTimeCreatedRange(new Date(500), new Date(500));
        m_SUT.execute();
        verify(m_DataStore, times(2)).executeJdoQuery(query.capture());
        assertThat((ObservationQueryImpl)rv, is(m_SUT));
        verify(query.getValue()).setFilter("createdTimestamp >= 500 && createdTimestamp <= 500");
    }
@ Test public void testTimeCreatedRange ( ) { ObservationQuery rv = m_SUT . withTimeCreatedRange ( new Date ( 200 ) , new Date ( 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 ( ) ) . setFilter ( "createdTimestamp >= 200 && createdTimestamp <= 300" ) ; rv = m_SUT . withTimeCreatedRange ( new Date ( 500 ) , new Date ( 500 ) ) ; m_SUT . execute ( ) ; verify ( m_DataStore , times ( 2 ) ) . executeJdoQuery ( query . capture ( ) ) ; assertThat ( ( ObservationQueryImpl ) rv , is ( m_SUT ) ) ; verify ( query . getValue ( ) ) . setFilter ( "createdTimestamp >= 500 && createdTimestamp <= 500" ) ; }
Verify a created time range will produce a valid filter.
Verify a created time range will produce a valid filter .
// replay // verify return value is the same object for method chaining // verify // verify return value is the same object for method chaining // verify