jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1429379 - in /jmeter/trunk: src/components/org/apache/jmeter/extractor/gui/XPathExtractorGui.java src/core/org/apache/jmeter/gui/AbstractScopedJMeterGuiComponent.java src/core/org/apache/jmeter/util/ScopePanel.java xdocs/changes.xml
Date Sat, 05 Jan 2013 20:32:24 GMT
Author: pmouawad
Date: Sat Jan  5 20:32:23 2013
New Revision: 1429379

URL: http://svn.apache.org/viewvc?rev=1429379&view=rev
Log:
Bug 54376: XPath extractor should not have scopes "Main sample and sub-samples" and "Sub-samples
only"
Bugzilla Id: 54376

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/XPathExtractorGui.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/AbstractScopedJMeterGuiComponent.java
    jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/XPathExtractorGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/XPathExtractorGui.java?rev=1429379&r1=1429378&r2=1429379&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/XPathExtractorGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/XPathExtractorGui.java Sat
Jan  5 20:32:23 2013
@@ -122,7 +122,7 @@ public class XPathExtractorGui extends A
 
         Box box = Box.createVerticalBox();
         box.add(makeTitlePanel());
-        box.add(createScopePanel(true));
+        box.add(createScopePanel(true, false, false));
         xml.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
JMeterUtils
                 .getResString("xpath_assertion_option"))); //$NON-NLS-1$
         box.add(xml);

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/AbstractScopedJMeterGuiComponent.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/AbstractScopedJMeterGuiComponent.java?rev=1429379&r1=1429378&r2=1429379&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/AbstractScopedJMeterGuiComponent.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/AbstractScopedJMeterGuiComponent.java Sat
Jan  5 20:32:23 2013
@@ -70,7 +70,18 @@ public abstract class AbstractScopedJMet
      * @return the scope settings panel
      */
     protected JPanel createScopePanel(boolean enableVariable) {
-        scopePanel = new ScopePanel(enableVariable);
+        return createScopePanel(enableVariable, true, true);
+    }
+    
+    /**
+     * Create the scope settings panel.
+     * @param enableVariable set true to enable the variable panel
+     * @param enableParentAndSubsamples set true to enable the parent and sub-samples
+     * @param enableSubsamplesOnly set true to enable the sub-samples only
+     * @return the scope settings panel
+     */
+    protected JPanel createScopePanel(boolean enableVariable, boolean enableParentAndSubsamples,
boolean enableSubsamplesOnly) {
+        scopePanel = new ScopePanel(enableVariable, enableParentAndSubsamples, enableSubsamplesOnly);
         return scopePanel;
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java?rev=1429379&r1=1429378&r2=1429379&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java Sat Jan  5 20:32:23 2013
@@ -50,9 +50,21 @@ public class ScopePanel extends JPanel i
     }
 
     public ScopePanel(boolean enableVariableButton) {
-        allButton = new JRadioButton(JMeterUtils.getResString("sample_scope_all")); //$NON-NLS-1$
+        this(enableVariableButton, true, true);
+    }
+    
+    public ScopePanel(boolean enableVariableButton, boolean enableParentAndSubsamples, boolean
enableSubsamplesOnly) {
         parentButton = new JRadioButton(JMeterUtils.getResString("sample_scope_parent"));
//$NON-NLS-1$
-        childButton = new JRadioButton(JMeterUtils.getResString("sample_scope_children"));
//$NON-NLS-1$
+        if(enableParentAndSubsamples) {
+            allButton = new JRadioButton(JMeterUtils.getResString("sample_scope_all")); //$NON-NLS-1$
+        } else {
+            allButton = null;
+        }
+        if(enableSubsamplesOnly) {
+            childButton = new JRadioButton(JMeterUtils.getResString("sample_scope_children"));
//$NON-NLS-1$
+        } else {
+            childButton = null;
+        }
         if (enableVariableButton) {
             variableButton = new JRadioButton(JMeterUtils.getResString("sample_scope_variable"));
//$NON-NLS-1$
             variableName = new JTextField(10);
@@ -74,12 +86,17 @@ public class ScopePanel extends JPanel i
 
         JPanel buttonPanel = new HorizontalPanel();
         ButtonGroup group = new ButtonGroup();
-        group.add(allButton);
+        if(allButton != null) {
+            group.add(allButton);
+            buttonPanel.add(allButton);
+        }
         group.add(parentButton);
-        group.add(childButton);
         buttonPanel.add(parentButton);
-        buttonPanel.add(childButton);
-        buttonPanel.add(allButton);
+        if(childButton != null) {
+            group.add(childButton);
+            buttonPanel.add(childButton);
+        }
+        
         if (variableButton != null){
             variableButton.addActionListener(this);
             group.add(variableButton);
@@ -143,15 +160,15 @@ public class ScopePanel extends JPanel i
     }
 
     public boolean isScopeChildren() {
-        return childButton.isSelected();
+        return childButton != null && childButton.isSelected();
     }
 
     public boolean isScopeAll() {
-        return allButton.isSelected();
+        return allButton != null && allButton.isSelected();
     }
 
     public boolean isScopeVariable() {
-        return variableButton.isSelected();
+        return variableButton != null && variableButton.isSelected();
     }
 
     @Override

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1429379&r1=1429378&r2=1429379&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Jan  5 20:32:23 2013
@@ -252,6 +252,7 @@ to the elements View Results Tree, Asser
 <li><bugzilla>54257</bugzilla> - Enhance SamplerCreator interface to meet
new requirements</li>
 <li><bugzilla>54258</bugzilla> - Proxy : Use Raw Post Body when Sampler
has one unnamed argument, useful for Samplers using POST method by of type JSON, XML, GWT
body</li>
 <li><bugzilla>54268</bugzilla> - Improve CPU and memory usage</li>
+<li><bugzilla>54376</bugzilla> - XPath extractor should not have scopes
"Main sample and sub-samples" and "Sub-samples only"</li>
 </ul>
 
 <h2>Non-functional changes</h2>



Mime
View raw message