@Test
	public void testInvalidModules() {
		String config = "test | foo--x=13";
		XDStreamParser parser = new XDStreamParser(testRepository, mock(ModuleRegistry.class),
				new DefaultModuleOptionsMetadataResolver());
		try {
			parser.parse("t", config, stream);
			fail(config + " is invalid. Should throw exception");
		}
		catch (Exception e) {
			// success
		}
	}
Parse streams and verify either the correct abstract syntax tree is produced or the current exception comes out.

@author Andy Clement
@author David Turanski
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/stream/dsl/StreamConfigParserTests.java