public void testWritingDataset() throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"org/springframework/xd/integration/hadoop/config/DatasetOutboundChannelAdapterIntegrationTests.xml");
MessageChannel channel = context.getBean("datasetOut", MessageChannel.class);
channel.send(MessageBuilder.withPayload("foo").build());
channel.send(MessageBuilder.withPayload("bar").build());
DatasetOperations datasetOperations = context.getBean("datasetOperations", DatasetOperations.class);
String path = context.getBean("path", String.class);
assertTrue("Dataset path created", new File(path).exists());
assertTrue("Dataset storage created",
new File(path + "/" + "test/" + datasetOperations.getDatasetName(String.class)).exists());