mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestViewObsMgrImpl.java
@SuppressWarnings("unchecked")
    @Test
    public void testHasResolution() throws IOException
    {
        // The observation has resolution metadata. It should report that it does have a resolution.
        Observation obs = buildTestObsLowRes();
        m_SUT.setObservation(obs);
        assertThat(m_SUT.hasResolution(), is(true));
        
        // The observation has metadata but not resolution metadata, but the image itself has a resolution.
        // It should report that it does have a resolution.
        obs = buildTestObsNoRes();
        final ImageMetadata imgMeta = new ImageMetadata();
        obs.setImageMetadata(imgMeta);
        assertThat(m_SUT.hasResolution(), is(true));
        
        // The observation has no resolution metadata but the image does have a resolution. 
        // It should report that it does have a resolution.
        obs = buildTestObsNoRes();
        m_SUT.setObservation(obs);
        assertThat(m_SUT.hasResolution(), is(true));
        
        // The observation has no resolution metadata and the input stream will not report a resolution
        // because of an IOException. It should report that it does not have a resolution.
        when(m_ImageIOService.read(Mockito.any(InputStream.class))).thenThrow(IOException.class);
        m_SUT.setObservation(obs);
        assertThat(m_SUT.hasResolution(), is(false));
    }
/**
     * Test that the hasResolution method returns true when a resolution is deciphered or false when not.
     */
Test that the hasResolution method returns true when a resolution is deciphered or false when not.
Test that the hasResolution method returns true when a resolution is deciphered or false when not .
@SuppressWarnings("unchecked")
    @Test
    public void testHasResolution() throws IOException
    {
        Observation obs = buildTestObsLowRes();
        m_SUT.setObservation(obs);
        assertThat(m_SUT.hasResolution(), is(true));
        obs = buildTestObsNoRes();
        final ImageMetadata imgMeta = new ImageMetadata();
        obs.setImageMetadata(imgMeta);
        assertThat(m_SUT.hasResolution(), is(true));
        obs = buildTestObsNoRes();
        m_SUT.setObservation(obs);
        assertThat(m_SUT.hasResolution(), is(true));
        when(m_ImageIOService.read(Mockito.any(InputStream.class))).thenThrow(IOException.class);
        m_SUT.setObservation(obs);
        assertThat(m_SUT.hasResolution(), is(false));
    }
@ SuppressWarnings ( "unchecked" ) @ Test public void testHasResolution ( ) throws IOException { Observation obs = buildTestObsLowRes ( ) ; m_SUT . setObservation ( obs ) ; assertThat ( m_SUT . hasResolution ( ) , is ( true ) ) ; obs = buildTestObsNoRes ( ) ; final ImageMetadata imgMeta = new ImageMetadata ( ) ; obs . setImageMetadata ( imgMeta ) ; assertThat ( m_SUT . hasResolution ( ) , is ( true ) ) ; obs = buildTestObsNoRes ( ) ; m_SUT . setObservation ( obs ) ; assertThat ( m_SUT . hasResolution ( ) , is ( true ) ) ; when ( m_ImageIOService . read ( Mockito . any ( InputStream . class ) ) ) . thenThrow ( IOException . class ) ; m_SUT . setObservation ( obs ) ; assertThat ( m_SUT . hasResolution ( ) , is ( false ) ) ; }
Test that the hasResolution method returns true when a resolution is deciphered or false when not.
Test that the hasResolution method returns true when a resolution is deciphered or false when not .
// The observation has resolution metadata. It should report that it does have a resolution. // The observation has metadata but not resolution metadata, but the image itself has a resolution. // It should report that it does have a resolution. // The observation has no resolution metadata but the image does have a resolution.  // It should report that it does have a resolution. // The observation has no resolution metadata and the input stream will not report a resolution // because of an IOException. It should report that it does not have a resolution.