mirror of https://github.com/apache/jmeter.git
				
				
				
			Bug 50178 - HeaderManager added as child of Thread Group can create concatenated HeaderManager names and OutOfMemoryException
git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@1028948 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
		
							parent
							
								
									f6f1dd12a4
								
							
						
					
					
						commit
						3afe57817e
					
				|  | @ -86,6 +86,15 @@ public abstract class AbstractTestElement implements TestElement, Serializable { | ||||||
|         propMap.clear(); |         propMap.clear(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * {@inheritDoc} | ||||||
|  |      * <p> | ||||||
|  |      * Default implementation - does nothing | ||||||
|  |      */ | ||||||
|  |     public void clearTestElementChildren(){ | ||||||
|  |         // NOOP | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * {@inheritDoc} |      * {@inheritDoc} | ||||||
|      */ |      */ | ||||||
|  |  | ||||||
|  | @ -37,6 +37,12 @@ public interface TestElement extends Cloneable { | ||||||
|     // N.B. Comments originally only applied to Test Plans, hence the name - which can now not be easily changed |     // N.B. Comments originally only applied to Test Plans, hence the name - which can now not be easily changed | ||||||
| 
 | 
 | ||||||
|     public void addTestElement(TestElement child); |     public void addTestElement(TestElement child); | ||||||
|  |      | ||||||
|  |     /** | ||||||
|  |      * This method should clear any test element properties that are merged | ||||||
|  |      * by {@link #addTestElement(TestElement)}. | ||||||
|  |      */ | ||||||
|  |     public void clearTestElementChildren(); | ||||||
| 
 | 
 | ||||||
|     public void setProperty(String key, String value); |     public void setProperty(String key, String value); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -240,7 +240,8 @@ public class TestCompiler implements HashTreeTraverser { | ||||||
| 
 | 
 | ||||||
|     private static class ObjectPair |     private static class ObjectPair | ||||||
|     { |     { | ||||||
|         private TestElement child, parent; |         private final TestElement child; | ||||||
|  |         private final TestElement parent; | ||||||
| 
 | 
 | ||||||
|         public ObjectPair(TestElement one, TestElement two) { |         public ObjectPair(TestElement one, TestElement two) { | ||||||
|             this.child = one; |             this.child = one; | ||||||
|  | @ -270,6 +271,7 @@ public class TestCompiler implements HashTreeTraverser { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void configureWithConfigElements(Sampler sam, List<ConfigTestElement> configs) { |     private void configureWithConfigElements(Sampler sam, List<ConfigTestElement> configs) { | ||||||
|  |         sam.clearTestElementChildren(); | ||||||
|         Iterator<ConfigTestElement> iter = configs.iterator(); |         Iterator<ConfigTestElement> iter = configs.iterator(); | ||||||
|         while (iter.hasNext()) { |         while (iter.hasNext()) { | ||||||
|             ConfigTestElement config = iter.next(); |             ConfigTestElement config = iter.next(); | ||||||
|  |  | ||||||
|  | @ -528,6 +528,16 @@ public abstract class HTTPSamplerBase extends AbstractSampler | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * {@inheritDoc} | ||||||
|  |      * <p> | ||||||
|  |      * Clears the Header Manager property so subsequent loops don't keep merging more elements | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void clearTestElementChildren(){ | ||||||
|  |         removeProperty(HEADER_MANAGER); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public void setPort(int value) { |     public void setPort(int value) { | ||||||
|         setProperty(new IntegerProperty(PORT, value)); |         setProperty(new IntegerProperty(PORT, value)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -68,6 +68,7 @@ To override the default local language fully, set the JMeter property "language" | ||||||
| 
 | 
 | ||||||
| <h3>HTTP Samplers and Proxy</h3> | <h3>HTTP Samplers and Proxy</h3> | ||||||
| <ul> | <ul> | ||||||
|  | <li>Bug 50178 - HeaderManager added as child of Thread Group can create concatenated HeaderManager names and OutOfMemoryException</li> | ||||||
| </ul> | </ul> | ||||||
| 
 | 
 | ||||||
| <h3>Other Samplers</h3> | <h3>Other Samplers</h3> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue