JDBCBackendDataSource implements BackendDataSource { public List<Connection> getConnections(final String schemaName, final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode) throws SQLException { return getConnections(schemaName, dataSourceName, connectionSize, connectionMode, TransactionType.LOCAL); }  Connection getConnection(final String schemaName, final String dataSourceName); List<Connection> getConnections(final String schemaName, final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode); @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") List<Connection> getConnections(final String schemaName, final String dataSourceName,
                                           final int connectionSize, final ConnectionMode connectionMode, final TransactionType transactionType);  }
@Test public void assertGetConnectionsSucceed() throws SQLException { List<Connection> actual = ProxyContext.getInstance().getBackendDataSource().getConnections("schema", String.format(DATA_SOURCE_PATTERN, 1), 5, ConnectionMode.MEMORY_STRICTLY); assertThat(actual.size(), is(5)); }
@Test(expected = SQLException.class) public void assertGetConnectionsFailed() throws SQLException { ProxyContext.getInstance().getBackendDataSource().getConnections("schema", String.format(DATA_SOURCE_PATTERN, 1), 6, ConnectionMode.MEMORY_STRICTLY); }