ruthst00 opened a new pull request, #6768:
URL: https://github.com/apache/jmeter/pull/6768

   ## Description
   <!--- Provide a general summary of your changes in the Title above -->
   <!--- Describe your changes in detail here -->
   Both bugs from issue #6633 have been fixed across four files, and `./gradlew 
--quiet classes style` passes with no errors.
   
   **Bug 1 — Inconsistent Test Plan name after merge** (3 files changed):
   - `JMeterTreeModel.addSubTree()` now has an overload that accepts a 
`merging` boolean. When `merging=true`, the 
`userObject.setName(item.getName())` call is skipped, so the current plan's 
name is always preserved regardless of which node was selected at the time of 
the merge.
   - `GuiPackage.addSubTree()` gained a matching `addSubTree(HashTree, boolean 
merging)` overload that threads the flag down to the tree model.
   - `Load.insertLoadedTree()` now calls `guiInstance.addSubTree(tree, 
merging)` instead of the no-arg form, so the flag flows end-to-end from the 
user action all the way to the model.
   
   **Bug 2 — Duplicate Open / Merge / Save Selection As menu entries** (1 file 
changed):
   - `MenuFactory.addFileMenu()` no longer adds `Open`, `Merge`, or `Save 
Selection As` items to the node popup / Edit menu. Those three are file-level 
actions that already live in the File menu bar; having them in the right-click 
popup (which is mirrored into the Edit menu) was the sole source of the 
duplication. A comment was added explaining the intentional omission.
   
   ## Motivation and Context
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   Fixes [#6633](https://github.com/apache/jmeter/issues/6633)
   
   There is inconsistent Test Plan naming and duplicate menu entries after 
merge:
   
   - If Test Plan node is selected: merged file contents are added, but the 
Test Plan name remains from the current plan (e.g., Test Plan A).
   - If a Thread Group node is selected: merged file contents are added, but 
the Test Plan name changes to the merged file’s name (e.g., Test Plan B).
   - Duplicate menu entries exist: File → Merge… and Edit → Merge…, File → 
Open… and Edit → Open…, File → Save Selection As… and Edit → Save Selection As….
   - These perform the same action, which may confuse users.
   
   ## How Has This Been Tested?
   <!--- Please describe in detail how you tested your changes. -->
   <!--- Include details of your testing environment, tests ran to see how -->
   <!--- your change affects other areas of the code, etc. -->
   Two new test files were added:
   
   - `src/core/…/gui/tree/JMeterTreeModelMergeTest.java` — 3 pure unit tests 
(no GUI required):
   - `src/dist-check/…/gui/util/MenuFactoryFileMenuTest.java` — 4 integration 
tests (placed in `dist-check` because `MenuFactory`'s static initializer 
requires the full JMeter classpath)
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Delete as appropriate 
-->
   - Bug fix (non-breaking change which fixes an issue)
   
   ## Checklist:
   <!--- Go over all the following points, and put an `x` in all the boxes that 
apply. -->
   <!--- If you're unsure about any of these, don't hesitate to ask. We're here 
to help! -->
   - [X] My code follows the [code style][style-guide] of this project.
   - [X] I have updated the documentation accordingly.
   
   [style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to