private DataSource createDataSource() {

		String url = "jdbc:hsqldb:mem:%s";
		String dbname = "foo";
		String driver = "org.hsqldb.jdbc.JDBCDriver";

		String jdbcUrl = String.format(url, dbname);
		SimpleDriverDataSource dataSource = new SimpleDriverDataSource();

		try {
			@SuppressWarnings("unchecked")
			Class<? extends Driver> classz = (Class<? extends Driver>) Class.forName(driver);
			dataSource.setDriverClass(classz);
		}
		catch (ClassNotFoundException e) {
			throw new IllegalStateException("failed to load class: " + driver, e);
		}

		dataSource.setUrl(jdbcUrl);
		return dataSource;
	}
Provides an @After JUnit lifecycle method that will destroy the definitions that were created by the test.

@author Andy Clement
@author Mark Pollack
@author Eric Bottard
@author Franck Marchand
spring-xd-shell/src/test/java/org/springframework/xd/shell/command/AbstractStreamIntegrationTest.java