Author: sebb
Date: Tue Oct  4 10:36:02 2011
New Revision: 1178752

URL: http://svn.apache.org/viewvc?rev=1178752&view=rev
Log:
Bug 51939 - Should generate new parent sample if necessary when retrieving 
embedded resources

Modified:
    jakarta/jmeter/trunk/bin/jmeter.properties
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: jakarta/jmeter/trunk/bin/jmeter.properties
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/jmeter.properties?rev=1178752&r1=1178751&r2=1178752&view=diff
==============================================================================
--- jakarta/jmeter/trunk/bin/jmeter.properties (original)
+++ jakarta/jmeter/trunk/bin/jmeter.properties Tue Oct  4 10:36:02 2011
@@ -704,6 +704,9 @@ beanshell.server.file=../extras/startup.
 #httpsampler.max_frame_depth=5
 # Maximum await termination timeout (secs) when concurrent download embedded 
resources (default 60)
 #httpsampler.await_termination_timeout=60
+# Revert to BUG 51939 behaviour (no separate container for embedded resources) 
by setting the following false:
+#httpsampler.separate.container=true
+
 
 # The encoding to be used if none is provided (default ISO-8859-1)
 #sampleresult.default.encoding=ISO-8859-1

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1178752&r1=1178751&r2=1178752&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 Tue Oct  4 10:36:02 2011
@@ -803,6 +803,10 @@ public abstract class HTTPSamplerBase ex
     private static final String HTTP_PREFIX = PROTOCOL_HTTP+"://"; // 
$NON-NLS-1$
     private static final String HTTPS_PREFIX = PROTOCOL_HTTPS+"://"; // 
$NON-NLS-1$
 
+    // Bug 51939
+    private static final boolean SEPARATE_CONTAINER = 
+            JMeterUtils.getPropDefault("httpsampler.separate.container", 
true); // $NON-NLS-1$
+
     /**
      * Get the URL, built from its component parts.
      *
@@ -1422,8 +1426,12 @@ public abstract class HTTPSamplerBase ex
                 // Only download page resources if we were not redirected.
                 // If we were redirected, the page resources have already been
                 // downloaded for the sample made for the redirected url
+                // otherwise, use null so the container is created if 
necessary unless
+                // the flag is false, in which case revert to broken 2.1 
behaviour 
+                // Bug 51939 -  
https://issues.apache.org/bugzilla/show_bug.cgi?id=51939
                 if(!wasRedirected) {
-                    HTTPSampleResult container = (HTTPSampleResult) 
(areFollowingRedirect ? res.getParent() : res);
+                    HTTPSampleResult container = (HTTPSampleResult) (
+                            areFollowingRedirect ? res.getParent() : 
SEPARATE_CONTAINER ? null : res);
                     res = downloadPageResources(res, container, frameDepth);
                 }
             }

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=1178752&r1=1178751&r2=1178752&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Tue Oct  4 10:36:02 2011
@@ -68,6 +68,12 @@ To override the default local language f
 
 <h2>Incompatible changes</h2>
 
+<p>
+JMeter versions since 2.1 failed to create a container sample when loading 
embedded resources.
+This has been corrected; can still revert to the Bug 51939 behaviour by 
setting the following property:
+<code>httpsampler.separate.container=false</code>
+</p>
+
 <!-- =================== Bug fixes =================== -->
 
 <h2>Bug fixes</h2>
@@ -76,6 +82,7 @@ To override the default local language f
 <ul>
 <li>Bug 51932 - CacheManager does not handle cache-control header with any 
attributes after max-age</li>
 <li>Bug 51918 - GZIP compressed traffic produces errors, when multiple 
connections allowed</li>
+<li>Bug 51939 - Should generate new parent sample if necessary when retrieving 
embedded resources</li>
 </ul>
 
 <h3>Other Samplers</h3>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to