mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestObservationMgrImpl.java
@Test
    public void testFilterByExpression()
    {
        //settings
        m_SUT.setFilterByExpression(true);
        m_SUT.setFilter("filter");
        
        javax.jdo.Query queryObs = mock(javax.jdo.Query.class);
        javax.jdo.Query queryCount = mock(javax.jdo.Query.class);
        when(m_JdoStore.newJdoQuery()).thenReturn(queryObs, queryCount);
        
        //request for observations
        m_SUT.getObservations().load(0, 10, null, null, null);
        
        //verify call to jdo store
        verify(m_JdoStore, times(2)).newJdoQuery();
        //verify filter set
        verify(queryObs).setFilter("filter");
        verify(queryCount).setFilter("filter");
        verify(queryObs).setOrdering("createdTimestamp descending");
        verify(queryCount, never()).setOrdering("createdTimestamp descending");
        verify(m_JdoStore).executeJdoQuery(queryObs);
        verify(m_JdoStore).executeGetCount(queryCount);
    }
/**
     * Verify the filtering of Observations via a filter string.
     */
Verify the filtering of Observations via a filter string.
Verify the filtering of Observations via a filter string .
@Test
    public void testFilterByExpression()
    {
        m_SUT.setFilterByExpression(true);
        m_SUT.setFilter("filter");
        javax.jdo.Query queryObs = mock(javax.jdo.Query.class);
        javax.jdo.Query queryCount = mock(javax.jdo.Query.class);
        when(m_JdoStore.newJdoQuery()).thenReturn(queryObs, queryCount);
        m_SUT.getObservations().load(0, 10, null, null, null);
        verify(m_JdoStore, times(2)).newJdoQuery();
        verify(queryObs).setFilter("filter");
        verify(queryCount).setFilter("filter");
        verify(queryObs).setOrdering("createdTimestamp descending");
        verify(queryCount, never()).setOrdering("createdTimestamp descending");
        verify(m_JdoStore).executeJdoQuery(queryObs);
        verify(m_JdoStore).executeGetCount(queryCount);
    }
@ Test public void testFilterByExpression ( ) { m_SUT . setFilterByExpression ( true ) ; m_SUT . setFilter ( "filter" ) ; javax . jdo . Query queryObs = mock ( javax . jdo . Query . class ) ; javax . jdo . Query queryCount = mock ( javax . jdo . Query . class ) ; when ( m_JdoStore . newJdoQuery ( ) ) . thenReturn ( queryObs , queryCount ) ; m_SUT . getObservations ( ) . load ( 0 , 10 , null , null , null ) ; verify ( m_JdoStore , times ( 2 ) ) . newJdoQuery ( ) ; verify ( queryObs ) . setFilter ( "filter" ) ; verify ( queryCount ) . setFilter ( "filter" ) ; verify ( queryObs ) . setOrdering ( "createdTimestamp descending" ) ; verify ( queryCount , never ( ) ) . setOrdering ( "createdTimestamp descending" ) ; verify ( m_JdoStore ) . executeJdoQuery ( queryObs ) ; verify ( m_JdoStore ) . executeGetCount ( queryCount ) ; }
Verify the filtering of Observations via a filter string.
Verify the filtering of Observations via a filter string .
//settings //request for observations //verify call to jdo store //verify filter set