jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1557541 - in /jmeter/trunk: src/core/org/apache/jmeter/resources/ src/protocol/http/org/apache/jmeter/protocol/http/proxy/ src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ xdocs/ xdocs/usermanual/
Date Sun, 12 Jan 2014 14:53:02 GMT
Author: pmouawad
Date: Sun Jan 12 14:53:02 2014
New Revision: 1557541

URL: http://svn.apache.org/r1557541
Log:
Bug 52013 - Test Script Recorder's Child View Results Tree does not take into account Test
Script Recorder excluded/included URLs
Bugzilla Id: 52013

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1557541&r1=1557540&r2=1557541&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Sun Jan 12 14:53:02
2014
@@ -674,6 +674,7 @@ new=New
 newdn=New distinguished name
 next=Next
 no=Norwegian
+notify_child_listeners_fr=Notify Child Listeners of filtered samplers
 number_of_threads=Number of Threads (users)\:
 obsolete_test_element=This test element is obsolete
 once_only_controller_title=Once Only Controller

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1557541&r1=1557540&r2=1557541&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Sun Jan 12 14:53:02
2014
@@ -1,3 +1,4 @@
+
 #   Licensed to the Apache Software Foundation (ASF) under one or more
 #   contributor license agreements.  See the NOTICE file distributed with
 #   this work for additional information regarding copyright ownership.
@@ -668,6 +669,7 @@ new=Nouveau
 newdn=Nouveau DN
 next=Suivant
 no=Norv\u00E9gien
+notify_child_listeners_fr=Notifier les r\u00E9cepteurs fils des \u00E9chantillons filtr\u00E9s
 number_of_threads=Nombre d'unit\u00E9s (utilisateurs) \:
 obsolete_test_element=Cet \u00E9l\u00E9ment de test est obsol\u00E8te
 once_only_controller_title=Contr\u00F4leur Ex\u00E9cution unique

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java?rev=1557541&r1=1557540&r2=1557541&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Sun Jan 12 14:53:02 2014
@@ -24,10 +24,10 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
-import java.security.cert.X509Certificate;
 import java.security.GeneralSecurityException;
 import java.security.KeyStore;
 import java.security.UnrecoverableKeyException;
+import java.security.cert.X509Certificate;
 import java.util.Collection;
 import java.util.Date;
 import java.util.Enumeration;
@@ -68,8 +68,8 @@ import org.apache.jmeter.samplers.Sample
 import org.apache.jmeter.samplers.SampleListener;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.testelement.TestElement;
-import org.apache.jmeter.testelement.TestStateListener;
 import org.apache.jmeter.testelement.TestPlan;
+import org.apache.jmeter.testelement.TestStateListener;
 import org.apache.jmeter.testelement.WorkBench;
 import org.apache.jmeter.testelement.property.BooleanProperty;
 import org.apache.jmeter.testelement.property.CollectionProperty;
@@ -144,6 +144,9 @@ public class ProxyControl extends Generi
     private static final String CONTENT_TYPE_EXCLUDE = "ProxyControlGui.content_type_exclude";
// $NON-NLS-1$
 
     private static final String CONTENT_TYPE_INCLUDE = "ProxyControlGui.content_type_include";
// $NON-NLS-1$
+
+    private static final String NOTIFY_CHILD_SAMPLER_LISTENERS_FILTERED = "ProxyControlGui.notify_child_sl_filtered";
// $NON-NLS-1$
+
     //- JMX file attributes
 
     // Must agree with the order of entries in the drop-down
@@ -255,6 +258,8 @@ public class ProxyControl extends Generi
 
     private volatile boolean samplerDownloadImages = false;
 
+    private volatile boolean notifyChildSamplerListenersOfFilteredSamples = false;
+
     private volatile boolean regexMatch = false;// Should we match using regexes?
 
     /**
@@ -335,6 +340,11 @@ public class ProxyControl extends Generi
         samplerDownloadImages = b;
         setProperty(new BooleanProperty(SAMPLER_DOWNLOAD_IMAGES, b));
     }
+    
+    public void setNotifyChildSamplerListenerOfFilteredSamplers(boolean b) {
+        notifyChildSamplerListenersOfFilteredSamples = b;
+        setProperty(new BooleanProperty(NOTIFY_CHILD_SAMPLER_LISTENERS_FILTERED, b));
+    }
 
     public void setIncludeList(Collection<String> list) {
         setProperty(new CollectionProperty(INCLUDE_LIST, new HashSet<String>(list)));
@@ -413,6 +423,10 @@ public class ProxyControl extends Generi
         return getPropertyAsBoolean(SAMPLER_DOWNLOAD_IMAGES, false);
     }
 
+    public boolean getNotifyChildSamplerListenerOfFilteredSamplers() {
+        return getPropertyAsBoolean(NOTIFY_CHILD_SAMPLER_LISTENERS_FILTERED, false);
+    }
+    
     public boolean getRegexMatch() {
         return getPropertyAsBoolean(REGEX_MATCH, false);
     }
@@ -501,6 +515,7 @@ public class ProxyControl extends Generi
      * server's response while recording.
      */
     public synchronized void deliverSampler(final HTTPSamplerBase sampler, final TestElement[]
subConfigs, final SampleResult result) {
+        boolean notifySampleListeners = true;
         if (sampler != null) {
             if (ATTEMPT_REDIRECT_DISABLING && (samplerRedirectAutomatically || samplerFollowRedirects))
{
                 if (result instanceof HTTPSampleResult) {
@@ -541,11 +556,16 @@ public class ProxyControl extends Generi
                 if(log.isDebugEnabled()) {
                     log.debug("Sample excluded based on url or content-type: " + result.getUrlAsString()
+ " - " + result.getContentType());
                 }
+                notifySampleListeners = notifyChildSamplerListenersOfFilteredSamples;
                 result.setSampleLabel("["+result.getSampleLabel()+"]");
             }
+        } 
+        if(notifySampleListeners) {
+            // SampleEvent is not passed JMeterVariables, because they don't make sense for
Proxy Recording
+            notifySampleListeners(new SampleEvent(result, "WorkBench")); // TODO - is this
the correct threadgroup name?
+        } else {
+            log.debug("Sample not delivered to Child Sampler Listener based on url or content-type:
" + result.getUrlAsString() + " - " + result.getContentType());
         }
-        // SampleEvent is not passed JMeterVariables, because they don't make sense for Proxy
Recording
-        notifySampleListeners(new SampleEvent(result, "WorkBench")); // TODO - is this the
correct threadgroup name?
     }
 
     public void stopProxy() {

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java?rev=1557541&r1=1557540&r2=1557541&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Sun Jan 12 14:53:02 2014
@@ -160,6 +160,11 @@ public class ProxyControlGui extends Log
      * List of available target controllers
      */
     private JComboBox targetNodes;
+    
+    /**
+     * Notify child Listener of Filtered Samplers
+     */
+    private JCheckBox notifyChildSamplerListenerOfFilteredSamplersCB;
 
     private DefaultComboBoxModel targetNodesModel;
 
@@ -254,6 +259,7 @@ public class ProxyControlGui extends Log
             model.setSamplerFollowRedirects(samplerFollowRedirects.isSelected());
             model.setUseKeepAlive(useKeepAlive.isSelected());
             model.setSamplerDownloadImages(samplerDownloadImages.isSelected());
+            model.setNotifyChildSamplerListenerOfFilteredSamplers(notifyChildSamplerListenerOfFilteredSamplersCB.isSelected());
             model.setRegexMatch(regexMatch.isSelected());
             model.setContentTypeInclude(contentTypeInclude.getText());
             model.setContentTypeExclude(contentTypeExclude.getText());
@@ -313,6 +319,7 @@ public class ProxyControlGui extends Log
         samplerFollowRedirects.setSelected(model.getSamplerFollowRedirects());
         useKeepAlive.setSelected(model.getUseKeepalive());
         samplerDownloadImages.setSelected(model.getSamplerDownloadImages());
+        notifyChildSamplerListenerOfFilteredSamplersCB.setSelected(model.getNotifyChildSamplerListenerOfFilteredSamplers());
         regexMatch.setSelected(model.getRegexMatch());
         contentTypeInclude.setText(model.getContentTypeInclude());
         contentTypeExclude.setText(model.getContentTypeExclude());
@@ -589,6 +596,7 @@ public class ProxyControlGui extends Log
         Box includeExcludePanel = Box.createVerticalBox();
         includeExcludePanel.add(createIncludePanel());
         includeExcludePanel.add(createExcludePanel());
+        includeExcludePanel.add(createNotifyListenersPanel());
         mainPanel.add(includeExcludePanel, BorderLayout.CENTER);
 
         mainPanel.add(createControls(), BorderLayout.SOUTH);
@@ -829,6 +837,20 @@ public class ProxyControlGui extends Log
         return panel;
     }
 
+    private JPanel createNotifyListenersPanel() {
+        JPanel panel = new JPanel();
+        panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
JMeterUtils
+                .getResString("notify_child_listeners_fr"))); // $NON-NLS-1$
+        
+        notifyChildSamplerListenerOfFilteredSamplersCB = new JCheckBox(JMeterUtils.getResString("notify_child_listeners_fr"));
// $NON-NLS-1$
+        notifyChildSamplerListenerOfFilteredSamplersCB.setSelected(false);
+        notifyChildSamplerListenerOfFilteredSamplersCB.addActionListener(this);
+        notifyChildSamplerListenerOfFilteredSamplersCB.setActionCommand(ENABLE_RESTART);
+
+        panel.add(notifyChildSamplerListenerOfFilteredSamplersCB);
+        return panel;
+    }
+
     private JPanel createTableButtonPanel(String addCommand, String deleteCommand, String
copyFromClipboard, String addSuggestedExcludes) {
         JPanel buttonPanel = new JPanel();
 

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1557541&r1=1557540&r2=1557541&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Jan 12 14:53:02 2014
@@ -160,6 +160,7 @@ A workaround is to use a Java 7 update 4
 <h3>HTTP Samplers and Test Script Recorder</h3>
 <ul>
 <li><bugzilla>55959</bugzilla> - improve error message when Test Script
Recorder fails due to I/O problem</li>
+<li><bugzilla>52013</bugzilla> -  Test Script Recorder's Child View Results
Tree does not take into account Test Script Recorder excluded/included URLs</li>
 </ul>
 
 <h3>Other samplers</h3>

Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1557541&r1=1557540&r2=1557541&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jmeter/trunk/xdocs/usermanual/component_reference.xml Sun Jan 12 14:53:02 2014
@@ -5952,6 +5952,8 @@ Both Chrome and Internet Explorer use th
         recorded</b>.</property>
         <property name="Patterns to Exclude" required="No">Regular expressions that
are matched against the URL that is sampled.
         <b>Any requests that match one or more Exclude pattern are <i>not</i>
recorded</b>.</property>
+        <property name="Notify Child Listeners of filtered samplers" required="No">Notify
Child Listeners of filtered samplers
+        <b>Any response that match one or more Exclude pattern is <i>not</i>
delivered to Child Listeners (View Results Tree)</b>.</property>
         <property name="Start Button" required="N/A">Start the proxy server.  JMeter
writes the following message to the console once the proxy server has started up and is ready
to take requests: "Proxy up and running!".</property>
         <property name="Stop Button" required="N/A">Stop the proxy server.</property>
         <property name="Restart Button" required="N/A">Stops and restarts the proxy
server.  This is



Mime
View raw message