@Before
	public void setup() throws Exception {
		RandomConfigurationSupport randomConfigSupport = new RandomConfigurationSupport();
		singleNodeApplication = new SingleNodeApplication().run("--transport", this.transport);
		integrationTestSupport = new SingleNodeIntegrationTestSupport(singleNodeApplication);
		integrationTestSupport.addModuleRegistry(new ResourceModuleRegistry("classpath:/spring-xd/xd/modules"));
		Bootstrap bootstrap = new Bootstrap(new String[] {"--port", randomConfigSupport.getAdminServerPort()});
		shell = bootstrap.getJLineShellComponent();
		if (!shell.isRunning()) {
			shell.start();
		}
		streamOps = new StreamCommandsTemplate(shell, integrationTestSupport);
		metrics = new MetricsTemplate(shell);
	}
Abstract Spark streaming test class which can be extended to run against multiple XD transport.

@author Ilayaperumal Gopinathan
spring-xd-spark-streaming-tests/src/test/java/org/springframework/xd/spark/streaming/AbstractSparkStreamingTests.java