private void checkForIllegalStreamName(String streamName, String streamDef) {
		try {
			StreamNode sn = parse(streamName, streamDef);
			fail("expected to fail but parsed " + sn.stringify());
		}
		catch (StreamDefinitionException e) {
			assertEquals(XDDSLMessages.ILLEGAL_STREAM_NAME, e.getMessageCode());
			assertEquals(0, e.getPosition());
			assertEquals(streamName, e.getInserts()[0]);
		}
	}
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