@Test
	public void testSparkFileLogger() throws Exception {
		String streamName = testName.getMethodName()  + new Random().nextInt();
		String fileName = streamName + ".txt";
		File file = new File(fileName);
		try {
			final HttpSource source = new HttpSource(shell);
			final String stream = String.format("%s | file-logger --path=%s", source, fileName);
			createStream(streamName, stream);
			source.ensureReady().postData(TEST_MESSAGE);
			assertThat(file, eventually(50, 100, fileContent(endsWith(TEST_MESSAGE + System.lineSeparator()))));
		}
		finally {
			streamOps.destroyStream(streamName);
			if (file.exists()) {
				file.delete();
			}
		}
	}
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