// check we have the expected sheet
HSSFWorkbook wb = new HSSFWorkbook(in);
HSSFSheet sheet = wb.getSheet("PrimitiveGeoFeature");
assertNotNull(sheet);
FeatureSource fs = getFeatureSource( MockData.PRIMITIVEGEOFEATURE );
// check the number of rows in the output
final int feautureRows = fs.getCount(Query.ALL);
assertEquals(feautureRows + 1, sheet.getPhysicalNumberOfRows());
// check the header is what we expect
final SimpleFeatureType schema = (SimpleFeatureType) fs.getSchema();
final HSSFRow header = sheet.getRow(0);
assertEquals("FID", header.getCell(0).getRichStringCellValue().toString());
for (int i = 0; i < schema.getAttributeCount(); i++) {
assertEquals(schema.getDescriptor(i).getLocalName(), header.getCell(i+1).getRichStringCellValue().toString());
}
// check some selected values to see if the content and data type is the one
// we expect
FeatureIterator fi = fs.getFeatures().features();
SimpleFeature sf = (SimpleFeature) fi.next();
fi.close();
// ... a string cell
HSSFCell cell = sheet.getRow(1).getCell(1);