@Before
	public void setupContext() throws Exception {
		this.bus = new LocalMessageBus();
		this.bus.setApplicationContext(context);
		this.bus.afterPropertiesSet();
		this.resolver = new MessageBusAwareChannelResolver(this.bus, null);
		this.resolver.setBeanFactory(context);
		context.getBeanFactory().registerSingleton("channelResolver",
				this.resolver);
		context.registerSingleton("other", DirectChannel.class);
		context.registerSingleton("taskScheduler", ThreadPoolTaskScheduler.class);
		context.registerSingleton(IntegrationUtils.INTEGRATION_MESSAGE_BUILDER_FACTORY_BEAN_NAME,
				DefaultMessageBuilderFactory.class);
		context.refresh();

		PollerMetadata poller = new PollerMetadata();
		poller.setTrigger(new PeriodicTrigger(1000));
		bus.setPoller(poller);
	}
@author Mark Fisher
@author Gary Russell
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/integration/bus/MessageBusAwareChannelResolverTests.java