TomcatJdbcPoolDatasourceAccessor implements DatasourceAccessor { @Override public DataSourceInfo getInfo(Object resource) throws Exception { DataSourceInfo dataSourceInfo = null; if (canMap(resource)) { DataSource source = (DataSource) resource; dataSourceInfo = new DataSourceInfo(); dataSourceInfo.setBusyConnections(source.getNumActive()); dataSourceInfo.setEstablishedConnections(source.getNumIdle() + source.getNumActive()); dataSourceInfo.setMaxConnections(source.getMaxActive()); dataSourceInfo.setJdbcUrl(source.getUrl()); dataSourceInfo.setUsername(source.getUsername()); dataSourceInfo.setResettable(false); dataSourceInfo.setType("tomcat-jdbc"); } return dataSourceInfo; }  @Override DataSourceInfo getInfo(Object resource); @Override boolean reset(Object resource); @Override boolean canMap(Object resource);  }
@Test public void getInfoTest() throws Exception { accessor.getInfo(source); }