jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1807164 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/action/Close.java src/core/org/apache/jmeter/gui/action/Save.java src/functions/org/apache/jmeter/functions/TestPlanName.java xdocs/changes.xml
Date Sun, 03 Sep 2017 19:34:37 GMT
Author: pmouawad
Date: Sun Sep  3 19:34:37 2017
New Revision: 1807164

URL: http://svn.apache.org/viewvc?rev=1807164&view=rev
Log:
Bug 58876 - TestPlanName function returns null for a newly saved Test Plan and uses previously
opened one for a new one
Bugzilla Id: 58876

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

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java?rev=1807164&r1=1807163&r2=1807164&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java Sun Sep  3 19:34:37 2017
@@ -27,6 +27,7 @@ import javax.swing.JTree;
 
 import org.apache.jmeter.gui.GuiPackage;
 import org.apache.jmeter.gui.util.FocusRequester;
+import org.apache.jmeter.services.FileServer;
 import org.apache.jmeter.util.JMeterUtils;
 
 /**
@@ -108,6 +109,7 @@ public class Close extends AbstractActio
         JTree tree = guiPackage.getTreeListener().getJTree();
         tree.setSelectionRow(0);
         FocusRequester.requestFocus(tree);
+        FileServer.getFileServer().setScriptName(null);
         ActionRouter.getInstance().actionPerformed(new ActionEvent(e.getSource(), e.getID(),
ActionNames.ADD_ALL));
     }
 }

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=1807164&r1=1807163&r2=1807164&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 Sun Sep  3 19:34:37 2017
@@ -47,6 +47,7 @@ import org.apache.jmeter.gui.GuiPackage;
 import org.apache.jmeter.gui.tree.JMeterTreeNode;
 import org.apache.jmeter.gui.util.FileDialoger;
 import org.apache.jmeter.save.SaveService;
+import org.apache.jmeter.services.FileServer;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.testelement.TestPlan;
 import org.apache.jmeter.testelement.WorkBench;
@@ -222,6 +223,7 @@ public class Save extends AbstractAction
         try (FileOutputStream ostream = new FileOutputStream(updateFile)){
             SaveService.saveTree(subTree, ostream);
             if (fullSave) { // Only update the stored copy of the tree for a full save
+                FileServer.getFileServer().setScriptName(new File(updateFile).getName());
                 subTree = GuiPackage.getInstance().getTreeModel().getTestPlan(); // refetch,
because convertSubTree affects it
                 if (isWorkbenchSaveable()) {
                     HashTree workbench = GuiPackage.getInstance().getTreeModel().getWorkBench();

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java?rev=1807164&r1=1807163&r2=1807164&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java Sun Sep  3 19:34:37
2017
@@ -48,7 +48,11 @@ public class TestPlanName extends Abstra
     @Override
     public String execute(SampleResult previousResult, Sampler currentSampler)
             throws InvalidVariableException {
-        return FileServer.getFileServer().getScriptName();
+        String scriptName = FileServer.getFileServer().getScriptName();
+        if(scriptName == null) {
+            scriptName = "Save Test plan before calling " + KEY + " function";
+        }
+        return scriptName;
     }
 
     /** {@inheritDoc} */

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1807164&r1=1807163&r2=1807164&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sun Sep  3 19:34:37 2017
@@ -211,6 +211,7 @@ Incorporated feed back about unclear doc
 <ul>
     <li><bug>61258</bug>StringFromFile function is mentioned twice in the
Function helper dialog</li>
     <li><bug>61260</bug><code><funclink name="__XPath"/></code>
function returns null despite xpath checker founds matches</li>
+    <li><bug>58876</bug>TestPlanName function returns null for a newly
saved Test Plan and uses previously opened one for a new one</li>
 </ul>
 
 <h3>I18N</h3>



Mime
View raw message