@Test
	public void moduleArguments_xd1613() {
		StreamNode ast = null;

		// notice no space between the ' and final >
		ast = parse("queue:producer > transform --expression='payload.toUpperCase()' | filter --expression='payload.length() > 4'> queue:consumer");
		assertEquals("payload.toUpperCase()", ast.getModule("transform").getArguments()[0].getValue());
		assertEquals("payload.length() > 4", ast.getModule("filter").getArguments()[0].getValue());

		ast = parse("time | transform --expression='T(org.joda.time.format.DateTimeFormat).forPattern(\"yyyy-MM-dd HH:mm:ss\").parseDateTime(payload)'");
		assertEquals(
				"T(org.joda.time.format.DateTimeFormat).forPattern(\"yyyy-MM-dd HH:mm:ss\").parseDateTime(payload)",
				ast.getModule("transform").getArguments()[0].getValue());

		// allow for pipe/semicolon if quoted
		ast = parse("http | transform --outputType='text/plain|charset=UTF-8'  | log");
		assertEquals("text/plain|charset=UTF-8", ast.getModule("transform").getArguments()[0].getValue());

		ast = parse("http | transform --outputType='text/plain;charset=UTF-8'  | log");
		assertEquals("text/plain;charset=UTF-8", ast.getModule("transform").getArguments()[0].getValue());

		// Want to treat all of 'hi'+payload as the argument value
		ast = parse("http | transform --expression='hi'+payload | log");
		assertEquals("'hi'+payload", ast.getModule("transform").getArguments()[0].getValue());

		// Want to treat all of payload+'hi' as the argument value
		ast = parse("http | transform --expression=payload+'hi' | log");
		assertEquals("payload+'hi'", ast.getModule("transform").getArguments()[0].getValue());

		// Alternatively, can quote all around it to achieve the same thing
		ast = parse("http | transform --expression='payload+''hi''' | log");
		assertEquals("payload+'hi'", ast.getModule("transform").getArguments()[0].getValue());
		ast = parse("http | transform --expression='''hi''+payload' | log");
		assertEquals("'hi'+payload", ast.getModule("transform").getArguments()[0].getValue());

		ast = parse("http | transform --expression=\"payload+'hi'\" | log");
		assertEquals("payload+'hi'", ast.getModule("transform").getArguments()[0].getValue());
		ast = parse("http | transform --expression=\"'hi'+payload\" | log");
		assertEquals("'hi'+payload", ast.getModule("transform").getArguments()[0].getValue());

		ast = parse("http | transform --expression=payload+'hi'--param2='foobar' | log");
		assertEquals("payload+'hi'--param2='foobar'", ast.getModule("transform").getArguments()[0].getValue());

		ast = parse("http | transform --expression='hi'+payload--param2='foobar' | log");
		assertEquals("'hi'+payload--param2='foobar'", ast.getModule("transform").getArguments()[0].getValue());

		// This also works, which is cool
		ast = parse("http | transform --expression='hi'+'world' | log");
		assertEquals("'hi'+'world'", ast.getModule("transform").getArguments()[0].getValue());
		ast = parse("http | transform --expression=\"'hi'+'world'\" | log");
		assertEquals("'hi'+'world'", ast.getModule("transform").getArguments()[0].getValue());

		ast = parse("http | filter --expression=payload.matches('hello world') | log");
		assertEquals("payload.matches('hello world')", ast.getModule("filter").getArguments()[0].getValue());

		ast = parse("http | transform --expression='''hi''' | log");
		assertEquals("'hi'", ast.getModule("transform").getArguments()[0].getValue());

		ast = parse("http | transform --expression=\"''''hi''''\" | log");
		assertEquals("''''hi''''", ast.getModule("transform").getArguments()[0].getValue());
	}
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