private String loadXml(String xmlfile) {
		try {
			String resourceName = this.getClass().getPackage().getName().toString().replace('.', File.separatorChar)
					+ File.separator
					+ xmlfile + ".xml";
			InputStream istream = getClass().getClassLoader().getResourceAsStream(resourceName);
			BufferedInputStream bis = new BufferedInputStream(istream);
			byte[] theData = new byte[10000000];
			int dataReadSoFar = 0;
			byte[] buffer = new byte[1024];
			int read = 0;
			while ((read = bis.read(buffer)) != -1) {
				System.arraycopy(buffer, 0, theData, dataReadSoFar, read);
				dataReadSoFar += read;
			}
			bis.close();
			byte[] returnData = new byte[dataReadSoFar];
			System.arraycopy(theData, 0, returnData, 0, dataReadSoFar);
			return new String(returnData);
		}
		catch (IOException ioe) {
			throw new IllegalStateException(ioe);
		}
	}
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