SimpleFeatureIterator fi = null;
try {
logger.setLevel(java.util.logging.Level.SEVERE);
logger.addHandler(handler);
dataStore.createVirtualTable(vt);
ContentFeatureSource fs = dataStore.getFeatureSource("invalid_attribute");
// now hack the sql view definition to inject an invalid column name,
// it's easier than having to alter the column name in the db to make the existing
// view invalid
sb.setLength(0);
dialect.encodeColumnName(null, aname("not_valid"), sb);
String notValid = sb.toString();
sb.setLength(0);
dialect.encodeColumnName(null, aname("flow"), sb);
String flow = sb.toString();
dataStore.virtualTables.get("invalid_attribute").sql = vt.sql.replace(flow, notValid);
fi = fs.getFeatures().features();
fail("We should not have gotten here, we were supposed to get a sql exception");
} catch (RuntimeException e) {
// fine, this is expected
assertTrue(e.getCause() instanceof IOException);
} finally {