mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestObservationQueryImpl.java
@Test
    public void testWithMultipleObservationSubTypeEnums()
    {
        // replay with additional types
        m_SUT.withSubType(ObservationSubTypeEnum.DETECTION)
             .withSubType(ObservationSubTypeEnum.AUDIO_METADATA);
        m_SUT.execute();
        
        ArgumentCaptor<Query> query = ArgumentCaptor.forClass(Query.class);
        verify(m_DataStore).executeJdoQuery(query.capture());
        
        // verify both types are there anded together
        ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class);
        verify(query.getValue()).setFilter(stringCaptor.capture());
        // might be in either order
        assertThat(stringCaptor.getValue(), anyOf(is("this.detection.id > 0 && this.audioMetadata.id > 0"),
                                                  is("this.audioMetadata.id > 0 && this.detection.id > 0")));
    }
/**
     * Verify multiple sub types can be added and the filter has them all.
     */
Verify multiple sub types can be added and the filter has them all.
Verify multiple sub types can be added and the filter has them all .
@Test
    public void testWithMultipleObservationSubTypeEnums()
    {
        m_SUT.withSubType(ObservationSubTypeEnum.DETECTION)
             .withSubType(ObservationSubTypeEnum.AUDIO_METADATA);
        m_SUT.execute();
        ArgumentCaptor<Query> query = ArgumentCaptor.forClass(Query.class);
        verify(m_DataStore).executeJdoQuery(query.capture());
        ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class);
        verify(query.getValue()).setFilter(stringCaptor.capture());
        assertThat(stringCaptor.getValue(), anyOf(is("this.detection.id > 0 && this.audioMetadata.id > 0"),
                                                  is("this.audioMetadata.id > 0 && this.detection.id > 0")));
    }
@ Test public void testWithMultipleObservationSubTypeEnums ( ) { m_SUT . withSubType ( ObservationSubTypeEnum . DETECTION ) . withSubType ( ObservationSubTypeEnum . AUDIO_METADATA ) ; m_SUT . execute ( ) ; ArgumentCaptor < Query > query = ArgumentCaptor . forClass ( Query . class ) ; verify ( m_DataStore ) . executeJdoQuery ( query . capture ( ) ) ; ArgumentCaptor < String > stringCaptor = ArgumentCaptor . forClass ( String . class ) ; verify ( query . getValue ( ) ) . setFilter ( stringCaptor . capture ( ) ) ; assertThat ( stringCaptor . getValue ( ) , anyOf ( is ( "this.detection.id > 0 && this.audioMetadata.id > 0" ) , is ( "this.audioMetadata.id > 0 && this.detection.id > 0" ) ) ) ; }
Verify multiple sub types can be added and the filter has them all.
Verify multiple sub types can be added and the filter has them all .
// replay with additional types // verify both types are there anded together // might be in either order