}
@Override
public void testAuthenticationProvider() throws IOException {
super.testAuthenticationProvider();
JDBCConnectAuthProviderConfig config =
(JDBCConnectAuthProviderConfig) createAuthConfig("jdbcprov", JDBCConnectAuthProvider.class, "default");
config.setConnectURL("jdbc:connect");
JdbcSecurityConfigValidator validator = new JdbcSecurityConfigValidator(getSecurityManager());
try {
config.setDriverClassName("");
//getSecurityManager().saveAuthenticationProvider(config);
validator.validateAddAuthProvider(config);
fail();
} catch (SecurityConfigException ex) {
assertEquals( DRIVER_CLASSNAME_REQUIRED, ex.getId());
assertEquals(0, ex.getArgs().length);
}
config.setDriverClassName("a.b.c");
try {
//getSecurityManager().saveAuthenticationProvider(config);
validator.validateAddAuthProvider(config);
fail();
} catch (SecurityConfigException ex) {
assertEquals( DRIVER_CLASS_NOT_FOUND_$1, ex.getId());
assertEquals("a.b.c", ex.getArgs()[0]);
}
try {
config.setConnectURL(null);
//getSecurityManager().saveAuthenticationProvider(config);
validator.validateAddAuthProvider(config);
fail();
} catch (SecurityConfigException ex) {
assertEquals( JDBCURL_REQUIRED, ex.getId());