Author: pmouawad
Date: Mon Oct  6 20:29:54 2014
New Revision: 1629759

URL: http://svn.apache.org/r1629759
Log:
Bug 57061 - Save as Test Fragment fails to clone deeply selected node
Bugzilla Id: 57061

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java?rev=1629759&r1=1629758&r2=1629759&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/Save.java Mon Oct  6 
20:29:54 2014
@@ -31,6 +31,7 @@ import javax.swing.JOptionPane;
 
 import org.apache.commons.io.FilenameUtils;
 import org.apache.jmeter.control.gui.TestFragmentControllerGui;
+import org.apache.jmeter.engine.TreeCloner;
 import org.apache.jmeter.exceptions.IllegalUserActionException;
 import org.apache.jmeter.gui.GuiPackage;
 import org.apache.jmeter.gui.tree.JMeterTreeNode;
@@ -101,16 +102,22 @@ public class Save implements Command {
         } 
         else if 
(e.getActionCommand().equals(ActionNames.SAVE_AS_TEST_FRAGMENT)) {
             JMeterTreeNode[] nodes = 
GuiPackage.getInstance().getTreeListener().getSelectedNodes();
-            if(checkAcceptableForTestFragment(nodes)) {
+            if(checkAcceptableForTestFragment(nodes)) {                
                 subTree = GuiPackage.getInstance().getCurrentSubTree();
-                
+                // Create Test Fragment node
                 TestElement element = 
GuiPackage.getInstance().createTestElement(TestFragmentControllerGui.class.getName());
                 HashTree hashTree = new ListedHashTree();
                 HashTree tfTree = hashTree.add(new JMeterTreeNode(element, 
null));
                 for (int i = 0; i < nodes.length; i++) {
-                    tfTree.add(nodes[i]);
+                    // Clone deeply current node
+                    TreeCloner cloner = new TreeCloner(false);
+                    
GuiPackage.getInstance().getTreeModel().getCurrentSubTree(nodes[i]).traverse(cloner);
+                    // Add clone to tfTree
+                    tfTree.add(cloner.getClonedTree());
                 }
+                                
                 subTree = hashTree;
+                
             } else {
                 JMeterUtils.reportErrorToUser(
                         
JMeterUtils.getResString("save_as_test_fragment_error"), // $NON-NLS-1$

Modified: jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1629759&r1=1629758&r2=1629759&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Oct  6 20:29:54 2014
@@ -81,6 +81,16 @@ and/or DNS load balancing.</p>
 <figure width="573" height="359" 
image="changes/2.12/02_dns_cache_manager.png"></figure>
 
 <ch_category>Core Improvements</ch_category>
+
+<ch_title>Smarter Recording of Http Test Plans</ch_title>
+<p>Test Script Recorder has been improved in many ways</p>
+<ul>
+    <li>Better matching of Variables in Requests, making Test Script Recorder 
variabilize your sampler during recording much intelligently (@Felix remove 
this when you commit your patch)</li>
+    <li>Ability to filter from View Results Tree the Samples that are excluded 
from recording, this lets you concentrate on recorded Samplers analysis and not 
bother with useless Sample Results</li>
+    <li>Better defaults for recording, since this version Recorder will number 
created Samplers letting you find them much easily in View Results Tree. 
Grouping of Samplers under Transaction Controller will
+    will be smarter making all requests emitted by a web page be children as 
new Transaction Controller</li>
+</ul>
+
 <ch_title>Better handling of embedded resources</ch_title>
 <p>When download embedded resources is checked, JMeter now uses User Agent 
header to download or not resources embedded within conditionnal comments as 
per <a 
href="http://msdn.microsoft.com/en-us/library/ms537512%28v=vs.85%29.aspx"; 
target="_blank">About conditional comments</a>.</p>
 
@@ -137,7 +147,7 @@ In addition, you can fetch only the mess
 <li>The Once Only controller behaves correctly under a Thread Group or Loop 
Controller,
 but otherwise its behaviour is not consistent (or clearly specified).</li>
 
-<li>Listeners don't show iteration counts when a If Controller has a condition 
which is always false from the first iteration (see 
<bugzilla>52496</bugzilla>).  
+<li>Infinite Loop can happen within JMeter (with possible StackOverflow side 
effect) when a If Controller has a condition which is always false from the 
first iteration (see <bugzilla>52496</bugzilla>).  
 A workaround is to add a sampler at the same level as (or superior to) the If 
Controller.
 For example a Test Action sampler with 0 wait time (which doesn't generate a 
sample),
 or a Debug Sampler with all fields set to False (to reduce the sample size).
@@ -256,6 +266,7 @@ for details on configuring this componen
 <li><bugzilla>54100</bugzilla> - Switching languages fails to preserve toolbar 
button states (enabled/disabled)</li>
 <li><bugzilla>54648</bugzilla> - JMeter GUI on OS X crashes when using CMD+C 
(keyboard shortcut or UI menu entry) on an element from the tree</li>
 <li><bugzilla>56962</bugzilla> - JMS GUIs should disable all fields affected 
by jndi.properties checkbox</li>
+<li><bugzilla>57061</bugzilla> - Save as Test Fragment fails to clone deeply 
selected node. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
 </ul>
 
 <!-- =================== Improvements =================== -->


Reply via email to