@Test
    public void testDataSource() throws Throwable {
        DefaultJdbcComponent component = new DefaultJdbcComponent();

        BasicDataSource ds = new BasicDataSource();
        ds.setDriverClassName(Driver.class.getName());
        ds.setUsername("sa");
        ds.setPassword("");
        ds.setUrl("jdbc:h2:mem:testDataSource;DB_CLOSE_DELAY=-1");

        try {
            IJdbcClient client = component.create(ds);
            doAllTests(client);
        } finally {
            try {
                ds.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
Full test for the default JDBC component.

@author eric.wittmann@redhat.com
gateway/engine/core/src/test/java/io/apiman/gateway/engine/impl/DefaultJdbcComponentTest.java