@Test
public void testParser() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"org/springframework/xd/integration/hadoop/config/DatasetOutboundChannelAdapterParserTests.xml");
EventDrivenConsumer adapter = context.getBean("adapter", EventDrivenConsumer.class);
HdfsWritingMessageHandler handler = (HdfsWritingMessageHandler) new DirectFieldAccessor(adapter).getPropertyValue("handler");
DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(handler);
assertEquals(false, handlerAccessor.getPropertyValue("autoStartup"));
DatasetWriterFactory writerFactory = (DatasetWriterFactory) handlerAccessor.getPropertyValue("hdfsWriterFactory");
DatasetOperations datasetOperations = (DatasetOperations) new DirectFieldAccessor(writerFactory).getPropertyValue("datasetOperations");
assertEquals(context.getBean("datasetOperations"), datasetOperations);