TiffToProductMetadataConverter { static ProductData getRasterTypeValueName(int rasterTypeIndex) { ProductData value; if (rasterTypeIndex == GeoTIFFCodes.RasterPixelIsArea) { value = ProductData.createInstance("RasterPixelIsArea"); } else if (rasterTypeIndex == GeoTIFFCodes.RasterPixelIsPoint) { value = ProductData.createInstance("RasterPixelIsPoint"); } else { value = ProductData.createInstance("unknown"); } return value; }    }
@Test public void testGetRasterTypeValueName() { ProductData rasterTypeValueName = TiffToProductMetadataConverter.getRasterTypeValueName(GeoTIFFCodes.RasterPixelIsArea); assertNotNull(rasterTypeValueName); assertEquals("RasterPixelIsArea", rasterTypeValueName.getElemString()); rasterTypeValueName = TiffToProductMetadataConverter.getRasterTypeValueName(GeoTIFFCodes.RasterPixelIsPoint); assertNotNull(rasterTypeValueName); assertEquals("RasterPixelIsPoint", rasterTypeValueName.getElemString()); rasterTypeValueName = TiffToProductMetadataConverter.getRasterTypeValueName(-12); assertNotNull(rasterTypeValueName); assertEquals("unknown", rasterTypeValueName.getElemString()); }