@Test
	public void testCompositeProcessor() {
		ModuleDescriptor processor1Descriptor = new ModuleDescriptor.Builder()
				.setModuleDefinition(processor1Definition)
				.setGroup("compositeprocessorgroup")
				.build();
		ModuleDescriptor processor2Descriptor = new ModuleDescriptor.Builder()
				.setModuleDefinition(processor2Definition)
				.setGroup("compositeprocessorgroup")
				.build();

		ModuleDefinition composed = ModuleDefinitions.composed("compositeprocessor", ModuleType.processor,
				"processor1 | processor2",
				Arrays.asList(processor1Definition, processor2Definition));


		//parser results being reversed, we emulate here
		List<ModuleDescriptor> children = Arrays.asList(processor2Descriptor, processor1Descriptor);

		ModuleDescriptor compositeDescriptor = new ModuleDescriptor.Builder()
				.setModuleDefinition(composed)
				.setGroup("compositeprocessorgroup")
				.addChildren(children)
				.build();

		Module module = moduleFactory.createModule(compositeDescriptor, deploymentProperties);
		assertTrue(module instanceof CompositeModule);
		module.initialize();
		module.start();
		assertEquals(processor, module.getType());
		MessageChannel input = module.getComponent("input", MessageChannel.class);
		assertNotNull(input);
		SubscribableChannel output = module.getComponent("output", SubscribableChannel.class);
		assertNotNull(output);
		final AtomicReference<Message<?>> result = new AtomicReference<Message<?>>();
		output.subscribe(new MessageHandler() {

			@Override
			public void handleMessage(Message<?> message) {
				result.set(message);
			}
		});
		input.send(MessageBuilder.withPayload("foo").build());
		Message<?> message = result.get();
		assertEquals("foo12", message.getPayload());
	}
@author Mark Fisher
@author David Turanski
@author Gary Russell
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/module/CompositeModuleTests.java