mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestPersistence.java
public void testObservationQueryAll()
        throws ValidationFailedException, IllegalArgumentException, PersistenceFailedException
    {
        // should allow no parameters
        List<Observation> initialObs = new ArrayList<>(m_ObservationStore.newQuery().execute());
        
        List<Observation> expectedObs = new ArrayList<>();
        for (int i = 0; i < 20; i++)
        {
            expectedObs.add(createObservation());
            if (i > 20 / 2)
            {
                // change the 2nd half to use a different asset type
                expectedObs.get(i).setAssetType("other-type");
            }
            m_ObservationStore.persist(expectedObs.get(i));
        }
        
        // should allow no parameters
        List<Observation> afterObs = new ArrayList<>(m_ObservationStore.newQuery().execute());
        
        assertThat("Query did not return number of expected observations",
                (afterObs.size() - initialObs.size()) >= expectedObs.size());
    }
/**
     * Verify can query for all observations if no query parameters are set.
     */
Verify can query for all observations if no query parameters are set.
Verify can query for all observations if no query parameters are set .
public void testObservationQueryAll()
        throws ValidationFailedException, IllegalArgumentException, PersistenceFailedException
    {
        List<Observation> initialObs = new ArrayList<>(m_ObservationStore.newQuery().execute());
        List<Observation> expectedObs = new ArrayList<>();
        for (int i = 0; i < 20; i++)
        {
            expectedObs.add(createObservation());
            if (i > 20 / 2)
            {
                expectedObs.get(i).setAssetType("other-type");
            }
            m_ObservationStore.persist(expectedObs.get(i));
        }
        List<Observation> afterObs = new ArrayList<>(m_ObservationStore.newQuery().execute());
        assertThat("Query did not return number of expected observations",
                (afterObs.size() - initialObs.size()) >= expectedObs.size());
    }
public void testObservationQueryAll ( ) throws ValidationFailedException , IllegalArgumentException , PersistenceFailedException { List < Observation > initialObs = new ArrayList < > ( m_ObservationStore . newQuery ( ) . execute ( ) ) ; List < Observation > expectedObs = new ArrayList < > ( ) ; for ( int i = 0 ; i < 20 ; i ++ ) { expectedObs . add ( createObservation ( ) ) ; if ( i > 20 / 2 ) { expectedObs . get ( i ) . setAssetType ( "other-type" ) ; } m_ObservationStore . persist ( expectedObs . get ( i ) ) ; } List < Observation > afterObs = new ArrayList < > ( m_ObservationStore . newQuery ( ) . execute ( ) ) ; assertThat ( "Query did not return number of expected observations" , ( afterObs . size ( ) - initialObs . size ( ) ) >= expectedObs . size ( ) ) ; }
Verify can query for all observations if no query parameters are set.
Verify can query for all observations if no query parameters are set .
// should allow no parameters // change the 2nd half to use a different asset type // should allow no parameters