use of edu.uiuc.ncsa.security.storage.sql.postgres.PGConnectionPoolProvider in project OA4MP by ncsa.
the class ServiceConfigTest method testClientApprovalStoreProvider.
public void testClientApprovalStoreProvider() throws Exception {
ConfigurationNode cn = getConfig("postgresql config");
MultiDSClientApprovalStoreProvider dap = new MultiDSClientApprovalStoreProvider(cn, true, new MyLoggingFacade("test"), null, null);
ClientApproverConverter cp = new ClientApproverConverter(new ClientApprovalProvider());
dap.addListener(new DSFSClientApprovalStoreProvider(cn, cp));
dap.addListener(new DSSQLClientApprovalStoreProvider(cn, new MySQLConnectionPoolProvider("oauth", "oauth"), MYSQL_STORE, cp));
dap.addListener(new DSSQLClientApprovalStoreProvider(cn, new PGConnectionPoolProvider("oauth", "oauth"), POSTGRESQL_STORE, cp));
ClientApprovalStore<ClientApproval> as = (ClientApprovalStore<ClientApproval>) dap.get();
}
use of edu.uiuc.ncsa.security.storage.sql.postgres.PGConnectionPoolProvider in project OA4MP by ncsa.
the class ServiceConfigTest method testClientStoreProvider.
/**
* Just reads in the configuration and calls "get" on the provider. This should work if the
* configuration file is read.
* @throws Exception
*/
@Test
public void testClientStoreProvider() throws Exception {
ConfigurationNode cn = getConfig("mixed config");
ClientProvider clientProvider = new ClientProvider(new OA4MPIdentifierProvider(OA4MPIdentifierProvider.CLIENT_ID));
MultiDSClientStoreProvider csp = new MultiDSClientStoreProvider(cn, true, new MyLoggingFacade("test"), null, null, clientProvider);
ClientConverter converter = new ClientConverter(clientProvider);
csp.addListener(new DSFSClientStoreProvider(cn, converter, clientProvider));
csp.addListener(new DSClientSQLStoreProvider(cn, new MySQLConnectionPoolProvider("oauth", "oauth"), MYSQL_STORE, converter, clientProvider));
csp.addListener(new DSClientSQLStoreProvider(cn, new PGConnectionPoolProvider("oauth", "oauth"), POSTGRESQL_STORE, converter, clientProvider));
ClientStore<Client> cs = (ClientStore<Client>) csp.get();
}
Aggregations