BigGeoTiffProductReader extends AbstractProductReader { static boolean isBadTiling(TIFFImageReader imageReader) throws IOException { final int imageHeight = imageReader.getHeight(FIRST_IMAGE); final int tileHeight = imageReader.getTileHeight(FIRST_IMAGE); final int imageWidth = imageReader.getWidth(FIRST_IMAGE); final int tileWidth = imageReader.getTileWidth(FIRST_IMAGE); return tileWidth <= 1 || tileHeight <= 1 || imageWidth <= tileWidth || imageHeight <= tileHeight; } protected  BigGeoTiffProductReader(ProductReaderPlugIn readerPlugIn); @Override synchronized void close();  }
@Test public void testIBadTiling_goodTiling() throws IOException { final TIFFImageReader reader = mock(TIFFImageReader.class); when(reader.getHeight(0)).thenReturn(20); when(reader.getWidth(0)).thenReturn(40); when(reader.getTileHeight(0)).thenReturn(10); when(reader.getTileWidth(0)).thenReturn(20); assertFalse(BigGeoTiffProductReader.isBadTiling(reader)); when(reader.getHeight(0)).thenReturn(8000); when(reader.getWidth(0)).thenReturn(2756); when(reader.getTileHeight(0)).thenReturn(199); when(reader.getTileWidth(0)).thenReturn(287); assertFalse(BigGeoTiffProductReader.isBadTiling(reader)); }
@Test public void testIBadTiling_badTiling() throws IOException { final TIFFImageReader reader = mock(TIFFImageReader.class); when(reader.getHeight(0)).thenReturn(20); when(reader.getWidth(0)).thenReturn(40); when(reader.getTileHeight(0)).thenReturn(1); when(reader.getTileWidth(0)).thenReturn(20); assertTrue(BigGeoTiffProductReader.isBadTiling(reader)); when(reader.getHeight(0)).thenReturn(20); when(reader.getWidth(0)).thenReturn(40); when(reader.getTileHeight(0)).thenReturn(10); when(reader.getTileWidth(0)).thenReturn(1); assertTrue(BigGeoTiffProductReader.isBadTiling(reader)); when(reader.getHeight(0)).thenReturn(20); when(reader.getWidth(0)).thenReturn(40); when(reader.getTileHeight(0)).thenReturn(20); when(reader.getTileWidth(0)).thenReturn(20); assertTrue(BigGeoTiffProductReader.isBadTiling(reader)); when(reader.getHeight(0)).thenReturn(20); when(reader.getWidth(0)).thenReturn(40); when(reader.getTileHeight(0)).thenReturn(10); when(reader.getTileWidth(0)).thenReturn(40); assertTrue(BigGeoTiffProductReader.isBadTiling(reader)); }