@Test
	public void toGraph$END() {
		js = parse("foo | oranges=$END");

		// AST creation (and DSL printing from it)
		assertEquals("foo | oranges = $END", js.stringify());

		// Graph creation
		// Note: node '2' does not exist, it was an $END node for the transition, when we discovered that was
		// going to be joined to the final $END node we re-routed the links targeting '2' to the real end
		// node and removed it
		assertEquals(toExpectedGraph("n:0:START,n:1:foo,n:3:END,l:0:1,l:1:3:transitionName=oranges"),
				js.toGraph().toJSON());

		// Graph to DSL
		checkDSLToGraphAndBackToDSL("foo | oranges = $END");

		// toXML
		assertEquals(loadXml("end1"), js.toXML("test1", true));
	}
Parse job specifications and verify either the correct abstract syntax tree is produced or the current exception comes out.
The parser does no semantic validation, it is purely syntax checking.

@author Andy Clement
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/job/dsl/JobParserTests.java