If you open a script, change it and then try exit JMeter, it will ask you to save the changes, which is good practice. The problem is that when you try to save the file and you fail to do so (i.e. when you try to write over a read only file) JMeter will exit without letting you another chance to save the file. (might be the same in a case you don't have permissions to save to file in specific folder, but haven't tried this)
Date: Mon Apr 23 20:15:41 2012 New Revision: 1329421 URL: http://svn.apache.org/viewvc?rev=1329421&view=rev Log: Bug 52997 - Jmeter should not exit without saving Test Plan if saving before exit fails Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java jmeter/trunk/xdocs/changes.xml
Unfortunately, the fix does not work. File#canWrite() only returns true if the file already exists *and* can be written, so the upfront check means that test plans cannot be saved to new files. I think the best is to deal with any problems in the catch clause, rather than trying to anticipate them. Further testing shows that the problem is caused by the call to ActionRouter.getInstance().doActionNow(new ActionEvent(subTree, e.getID(), ActionNames.SUB_TREE_SAVED)); before the save is attempted. If this is moved after the SaveService.saveTree() call, the code behaves much better. Patch to be checked in shortly.
Fixed in SVN: URL: http://svn.apache.org/viewvc?rev=1329669&view=rev Log: Bug 52997 - Jmeter should not exit without saving Test Plan if saving before exit fails Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java Note: I removed the setDirty(true) method call and the clearing of the file name. Failure to save the file should not affect the dirty status. Clearing the filename does not really achieve anything. Leaving the issue open for now, in case there are further problems.
URL: http://svn.apache.org/viewvc?rev=1330275&view=rev Log: Bug 52997 - Jmeter should not exit without saving Test Plan if saving before exit fails Fix crash with larger trees; only update saved copy of tree if we wrote the whole tree Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java Hopefully issue now really fixed!
Tests are OK for me. Closing issue as fixed.
Works for me too with r1332261.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2798