ImagePyramidReader extends AbstractGridCoverage2DReader implements GridCoverageReader { @Override public String getMetadataValue(String coverageName, String name) { String metadataValue = super.getMetadataValue(coverageName, name); if (metadataValue != null){ return metadataValue; } return getImageMosaicMetadataValue(name); } ImagePyramidReader(Object source, Hints uHints);  ImagePyramidReader(Object source); Format getFormat(); GridCoverage2D read(GeneralParameterValue[] params); @Override synchronized void dispose(); @Override int getGridCoverageCount(); @Override String getMetadataValue(String coverageName, String name); String getMetadataValue(final String name); String[] getMetadataNames(); ImageMosaicReader getImageMosaicReaderForLevel(Integer imageChoice);  }
@Test public void testForErrors() throws IOException, MismatchedDimensionException, NoSuchAuthorityCodeException { final File testFile = TestData.file(this, "goodpyramid/"+TEST_FILE); assertNotNull(testFile); ImagePyramidReader reader = null; try { reader = new ImagePyramidReader(null, new Hints( Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE)); } catch (DataSourceException e) { } assertNull(reader); try { reader = new ImagePyramidReader(new FileInputStream(testFile), new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE)); } catch (DataSourceException e) { } assertNull(reader); try { reader = new ImagePyramidReader(ImageIO .createImageInputStream(testFile), new Hints( Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE)); } catch (DataSourceException e) { } assertNull(reader); reader = new ImagePyramidReader(testFile, new Hints( Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE)); try { reader.getCurrentSubname(); } catch (UnsupportedOperationException e) { try { String value = reader.getMetadataValue(""); assertNull(value); return; } catch (UnsupportedOperationException e2) { return; } } assertTrue("Some of the unsopported method did not send an exception",false); }