private void checkForParseError(String jobSpecification, JobDSLMessage msg, int pos, Object... inserts) {
		try {
			JobSpecification js = parse(jobSpecification);
			fail("expected to fail but parsed " + js.stringify());
		}
		catch (JobSpecificationException e) {
			e.printStackTrace();
			assertEquals(msg, e.getMessageCode());
			assertEquals(pos, e.getPosition());
			if (inserts != null) {
				for (int i = 0; i < inserts.length; i++) {
					assertEquals(inserts[i], e.getInserts()[i]);
				}
			}
		}
	}
Load a resource XML file that represents the expected test output.
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/job/dsl/JobParserTests.java