jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1364181 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java xdocs/changes.xml xdocs/usermanual/component_reference.xml
Date Sat, 21 Jul 2012 22:15:57 GMT
Author: pmouawad
Date: Sat Jul 21 22:15:56 2012
New Revision: 1364181

URL: http://svn.apache.org/viewvc?rev=1364181&view=rev
Log:
Bug 53318 - Add Embedded URL Filter to HTTP Request Defaults Control 
Bugzilla Id: 53318

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java?rev=1364181&r1=1364180&r2=1364181&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java
Sat Jul 21 22:15:56 2012
@@ -32,12 +32,14 @@ import org.apache.commons.lang.StringUti
 import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.config.gui.AbstractConfigGui;
 import org.apache.jmeter.gui.util.HorizontalPanel;
+import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase;
 import org.apache.jmeter.testelement.AbstractTestElement;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.testelement.property.BooleanProperty;
 import org.apache.jmeter.testelement.property.StringProperty;
 import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.gui.JLabeledTextField;
 
 public class HttpDefaultsGui extends AbstractConfigGui {
 
@@ -51,6 +53,8 @@ public class HttpDefaultsGui extends Abs
 
     private UrlConfigGui urlConfig;
 
+    private JLabeledTextField embeddedRE; // regular expression used to match against embedded
resource URLs
+
     public HttpDefaultsGui() {
         super();
         init();
@@ -83,9 +87,16 @@ public class HttpDefaultsGui extends Abs
         if (imageParser.isSelected()) {
             config.setProperty(new BooleanProperty(HTTPSamplerBase.IMAGE_PARSER, true));
             enableConcurrentDwn(true);
+            if(!StringUtils.isEmpty(embeddedRE.getText())) {
+                config.setProperty(new StringProperty(HTTPSamplerBase.EMBEDDED_URL_RE, embeddedRE.getText()));
           
+            } else {
+                config.removeProperty(HTTPSamplerBase.EMBEDDED_URL_RE);
+            }
         } else {
             config.removeProperty(HTTPSamplerBase.IMAGE_PARSER);
+            config.removeProperty(HTTPSamplerBase.EMBEDDED_URL_RE);
             enableConcurrentDwn(false);
+            
         }
         if (concurrentDwn.isSelected()) {
             config.setProperty(new BooleanProperty(HTTPSamplerBase.CONCURRENT_DWN, true));
@@ -113,6 +124,7 @@ public class HttpDefaultsGui extends Abs
         imageParser.setSelected(false);
         concurrentDwn.setSelected(false);
         concurrentPool.setText(String.valueOf(HTTPSamplerBase.CONCURRENT_POOL_SIZE));
+        embeddedRE.setText(""); // $NON-NLS-1$
     }
 
     @Override
@@ -122,6 +134,7 @@ public class HttpDefaultsGui extends Abs
         imageParser.setSelected(((AbstractTestElement) el).getPropertyAsBoolean(HTTPSamplerBase.IMAGE_PARSER));
         concurrentDwn.setSelected(((AbstractTestElement) el).getPropertyAsBoolean(HTTPSamplerBase.CONCURRENT_DWN));
         concurrentPool.setText(((AbstractTestElement) el).getPropertyAsString(HTTPSamplerBase.CONCURRENT_POOL));
+        embeddedRE.setText(((AbstractTestElement) el).getPropertyAsString(HTTPSamplerBase.EMBEDDED_URL_RE,
""));
     }
 
     private void init() {
@@ -134,7 +147,7 @@ public class HttpDefaultsGui extends Abs
         add(urlConfig, BorderLayout.CENTER);
 
         // OPTIONAL TASKS
-        final JPanel optionalTasksPanel = new HorizontalPanel();
+        final JPanel optionalTasksPanel = new VerticalPanel();
         optionalTasksPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
JMeterUtils
                 .getResString("optional_tasks"))); // $NON-NLS-1$
 
@@ -160,6 +173,12 @@ public class HttpDefaultsGui extends Abs
         checkBoxPanel.add(concurrentDwn);
         checkBoxPanel.add(concurrentPool);
         optionalTasksPanel.add(checkBoxPanel);
+        
+        // Embedded URL match regex
+        embeddedRE = new JLabeledTextField(JMeterUtils.getResString("web_testing_embedded_url_pattern"),30);
// $NON-NLS-1$
+        optionalTasksPanel.add(embeddedRE);
+
+        
         add(optionalTasksPanel, BorderLayout.SOUTH);
     }
 
@@ -171,12 +190,14 @@ public class HttpDefaultsGui extends Abs
     private void enableConcurrentDwn(final boolean enable) {
         if (enable) {
             concurrentDwn.setEnabled(true);
+            embeddedRE.setEnabled(true);
             if (concurrentDwn.isSelected()) {
                 concurrentPool.setEnabled(true);
             }
         } else {
             concurrentDwn.setEnabled(false);
             concurrentPool.setEnabled(false);
+            embeddedRE.setEnabled(false);
         }
     }
 

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1364181&r1=1364180&r2=1364181&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Jul 21 22:15:56 2012
@@ -123,6 +123,7 @@ JSR223 Test Elements using Script file a
 <h3>Other samplers</h3>
 <ul>
 <li><bugzilla>55310</bugzilla> - TestAction should implement Interruptible</li>
+<li><bugzilla>53318</bugzilla> - Add Embedded URL Filter to HTTP Request
Defaults Control </li>
 </ul>
 
 <h3>Controllers</h3>

Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1364181&r1=1364180&r2=1364181&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jmeter/trunk/xdocs/usermanual/component_reference.xml Sat Jul 21 22:15:56 2012
@@ -3363,6 +3363,11 @@ and send HTTP/HTTPS requests for all ima
         </property>
         <property name="Use concurrent pool" required="No">Use a pool of concurrent
connections to get embedded resources.</property>
         <property name="Size" required="No">Pool size for concurrent connections used
to get embedded resources.</property>
+        <property name="Embedded URLs must match:" required="No">
+        If present, this must be a regular expression that is used to match against any embedded
URLs found.
+        So if you only want to download embedded resources from http://example.com/, use
the expression:
+        http://example\.com/.*
+        </property>
 </properties>
 <note>
 Note: radio buttons only have two states - on or off.



Mime
View raw message