@Test
public void testParsingWithInvalidCommands() throws Exception {

	// Copy the application and update a command file
	File dir = TestUtils.findApplicationDirectory( "lamp" );
	Assert.assertTrue( dir.isDirectory());
	File newDir = this.folder.newFolder();
	Utils.copyDirectory( dir, newDir );
	File commandFile = new File( newDir, Constants.PROJECT_DIR_COMMANDS + "/scale.commands" );
	Assert.assertTrue( commandFile.isFile());
	File commandFileCopy = new File( newDir, Constants.PROJECT_DIR_COMMANDS + "/scale.invalid-extension" );
	Utils.copyStream( commandFile, commandFileCopy );
	Utils.writeStringInto( "this is an invalid command", commandFile );
	// Load it and verify it contains errors
	ApplicationLoadResult alr = RuntimeModelIo.loadApplication( newDir );
	List<RoboconfError> criticalErrors = new ArrayList<> ();
	for( RoboconfError error : alr.getLoadErrors()) {
		if( error.getErrorCode().getLevel() == ErrorLevel.SEVERE )
			criticalErrors.add( error );
	}
	Assert.assertEquals( 2, criticalErrors.size());
	Assert.assertEquals( ErrorCode.CMD_UNRECOGNIZED_INSTRUCTION, criticalErrors.get( 0 ).getErrorCode());
	Assert.assertEquals( ErrorCode.PROJ_INVALID_COMMAND_EXT, criticalErrors.get( 1 ).getErrorCode());
}