Bug 61731

Summary: Enhance Test plan Backup with option to save before run
Product: JMeter - Now in Github Reporter: orimarko <orimarko>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: 3.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch with new action on menu
Patch with new action on menu
Patch with new action on menu

Description orimarko 2017-11-07 07:35:14 UTC
There were many issues where file was corrupted, specifically when running on GUI mode, which means that jmx file can't be fixed to a working condition,

When running a Test Plan, sometimes GUI stuck and test plan can't be saved.

Backup mechanism currently happens when clicking Save

I suggest A flag  "Save before Run" which will save (and backup file) before executing Run and therefore file will not be corrupted and can be opened again.
Comment 1 Philippe Mouawad 2017-11-07 07:39:54 UTC
Hello,
It looks like an interesting idea.
Can you discuss this on dev mailing list so that we have some lights from other members before we start anything on it ?


We do popup a Save dialog when you first run a project without saving it, so maybe we should do the same here.

Regards
Comment 2 orimarko 2017-11-08 07:54:04 UTC
From mailing list add:

- new property: save_automatically_before_run
- For regression reasons, the property should be set to false by default to keep behavior as today

- user can modify in Options > "Save automatically before run", it is stored in Preferences

Preferences override property
Comment 3 orimarko 2017-11-08 08:09:15 UTC
Created attachment 35505 [details]
Patch with new action on menu

Patch with new action on Options menu "Save Automatically Before Run" check box
It toggle property save_automatically_before_run value on runtime
If it's true before Run saves the test plan if exists
Comment 4 Philippe Mouawad 2017-11-08 08:24:12 UTC
Hello,
Thanks for your patch !

My notes:
- Patch contains a test file for an old patch TestDigestFunction
- I don't think you implemented the part related to preferences (have a look at LookAndFeelCommand to see what it is about)
- Are you sure about guiInstance.setMenuItemLoggerPanel(saveBeforeRun); ?
Comment 5 orimarko 2017-11-08 08:35:32 UTC
You are right, About preferences, can it just change property value (true/false) on run time instead of using preferences?
Comment 6 Philippe Mouawad 2017-11-08 08:46:26 UTC
(In reply to orimarko from comment #5)
> You are right, About preferences, can it just change property value
> (true/false) on run time instead of using preferences?

Preferences are persisted when you restart jmeter. Properties are not unless user updates his file.
So to be coherent with Language and LAF, I'd prefer we stick to what was discussed on user mailing list.


Thanks
Comment 7 orimarko 2017-11-08 09:39:01 UTC
Created attachment 35506 [details]
Patch with new action on menu

Update patch with preference override property value
Comment 8 orimarko 2017-11-08 09:50:39 UTC
Created attachment 35507 [details]
Patch with new action on menu

Add // $NON-NLS-1$ comments
Comment 9 Philippe Mouawad 2017-11-08 20:24:18 UTC
Author: pmouawad
Date: Wed Nov  8 20:23:55 2017
New Revision: 1814635

URL: http://svn.apache.org/viewvc?rev=1814635&view=rev
Log:
Bug 61731 - Enhance Test plan Backup with option to save before run
Bugzilla Id: 61731

Added:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/SaveBeforeRun.java   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/AbstractAction.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/xdocs/changes.xml
Comment 10 Philippe Mouawad 2017-11-08 20:30:04 UTC
Author: pmouawad
Date: Wed Nov  8 20:29:42 2017
New Revision: 1814636

URL: http://svn.apache.org/viewvc?rev=1814636&view=rev
Log:
Bug 61731 - Enhance Test plan Backup with option to save before run
Add documentation in properties and mention breaking change
Bugzilla Id: 61731

Modified:
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/properties_reference.xml
Comment 11 Philippe Mouawad 2017-11-08 20:44:52 UTC
Author: pmouawad
Date: Wed Nov  8 20:32:21 2017
New Revision: 1814637

URL: http://svn.apache.org/viewvc?rev=1814637&view=rev
Log:
Bug 61731 - Enhance Test plan Backup with option to save before run
Oups forgot 1 file
Bugzilla Id: 61731

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
Comment 12 Philippe Mouawad 2017-11-08 21:10:16 UTC
Author: pmouawad
Date: Wed Nov  8 21:08:07 2017
New Revision: 1814649

URL: http://svn.apache.org/viewvc?rev=1814649&view=rev
Log:
Bug 61731 - Enhance Test plan Backup with option to save before run
Add property to jmeter.properties
Bugzilla Id: 61731

Modified:
    jmeter/trunk/bin/jmeter.properties
    
Author: pmouawad
Date: Wed Nov  8 21:05:57 2017
New Revision: 1814647

URL: http://svn.apache.org/viewvc?rev=1814647&view=rev
Log:
Bug 61731 - Enhance Test plan Backup with option to save before run
Fix test failure in headless mode
Bugzilla Id: 61731

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
Comment 13 The ASF infrastructure team 2022-09-24 20:38:10 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4570