use of org.apache.tomcat.jdbc.test.DefaultProperties in project tomcat by apache.
the class Bug54978 method testIllegalValidationQuery.
@Test
public void testIllegalValidationQuery() {
PoolProperties poolProperties = new DefaultProperties();
poolProperties.setMinIdle(0);
poolProperties.setInitialSize(1);
poolProperties.setMaxActive(1);
poolProperties.setMaxWait(5000);
poolProperties.setMaxAge(100);
poolProperties.setRemoveAbandoned(false);
poolProperties.setTestOnBorrow(true);
poolProperties.setTestOnConnect(false);
poolProperties.setValidationQuery("sdadsada");
final DataSource ds = new DataSource(poolProperties);
try {
ds.getConnection().close();
fail("Validation should have failed.");
} catch (SQLException x) {
}
}
Aggregations