jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1310078 - in /jmeter/trunk: src/core/org/apache/jmeter/samplers/ src/core/org/apache/jmeter/threads/ src/protocol/java/org/apache/jmeter/protocol/java/sampler/ src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/ xdocs/
Date Thu, 05 Apr 2012 21:35:33 GMT
Author: pmouawad
Date: Thu Apr  5 21:35:32 2012
New Revision: 1310078

URL: http://svn.apache.org/viewvc?rev=1310078&view=rev
Log:
Bug 53042 - Introduce a new method in Sampler interface to allow Sampler to decide wether
a config element applies to Sampler 

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampler.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/Sampler.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BSFSampler.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223Sampler.java
    jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampler.java?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampler.java Thu Apr  5 21:35:32
2012
@@ -18,9 +18,16 @@
 
 package org.apache.jmeter.samplers;
 
+import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.testelement.AbstractTestElement;
 
 public abstract class AbstractSampler extends AbstractTestElement implements Sampler {
     private static final long serialVersionUID = 240L;
 
+    /**
+     * {@inheritDoc}
+     */
+    public boolean applies(ConfigTestElement configElement) {
+        return true;
+    }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/Sampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/Sampler.java?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/Sampler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/Sampler.java Thu Apr  5 21:35:32 2012
@@ -18,6 +18,7 @@
 
 package org.apache.jmeter.samplers;
 
+import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.testelement.TestElement;
 
 /**
@@ -32,4 +33,11 @@ public interface Sampler extends java.io
      * into a SampleResult.
      */
     public SampleResult sample(Entry e);
+    
+    /**
+     * Does configElement apply to Sampler 
+     * @param configElement {@link ConfigTestElement}
+     * @return boolean
+     */
+    public boolean applies(ConfigTestElement configElement);
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java Thu Apr  5 21:35:32
2012
@@ -288,7 +288,9 @@ public class TestCompiler implements Has
         for (ConfigTestElement config  : configs) {
             if (!(config instanceof NoConfigMerge)) 
             {
-                sam.addTestElement(config);
+                if(sam.applies(config)) {
+                    sam.addTestElement(config);
+                }
             }
         }
     }

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BSFSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BSFSampler.java?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BSFSampler.java
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BSFSampler.java
Thu Apr  5 21:35:32 2012
@@ -24,6 +24,7 @@ import org.apache.bsf.BSFEngine;
 import org.apache.bsf.BSFException;
 import org.apache.bsf.BSFManager;
 import org.apache.commons.io.IOUtils;
+import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.samplers.Entry;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.samplers.Sampler;
@@ -126,4 +127,11 @@ public class BSFSampler extends BSFTestE
 
         return res;
     }
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean applies(ConfigTestElement configElement) {
+        return true;
+    }
 }

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Thu Apr  5 21:35:32 2012
@@ -18,6 +18,7 @@
 
 package org.apache.jmeter.protocol.java.sampler;
 
+import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.samplers.Entry;
 import org.apache.jmeter.samplers.Interruptible;
 import org.apache.jmeter.samplers.SampleResult;
@@ -163,4 +164,11 @@ public class BeanShellSampler extends Be
         }
         return false;
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean applies(ConfigTestElement configElement) {
+        return true;
+    }
 }

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223Sampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223Sampler.java?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223Sampler.java
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223Sampler.java
Thu Apr  5 21:35:32 2012
@@ -23,6 +23,7 @@ import java.io.IOException;
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
 
+import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.samplers.Entry;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.samplers.Sampler;
@@ -78,4 +79,11 @@ public class JSR223Sampler extends JSR22
         result.sampleEnd();
         return result;
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean applies(ConfigTestElement configElement) {
+        return true;
+    }
 }

Modified: jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
(original)
+++ jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
Thu Apr  5 21:35:32 2012
@@ -21,6 +21,7 @@ package org.apache.jmeter.protocol.jdbc.
 import java.sql.Connection;
 import java.sql.SQLException;
 
+import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.protocol.jdbc.AbstractJDBCTestElement;
 import org.apache.jmeter.protocol.jdbc.config.DataSourceElement;
 import org.apache.jmeter.samplers.Entry;
@@ -93,4 +94,11 @@ public class JDBCSampler extends Abstrac
         res.sampleEnd();
         return res;
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean applies(ConfigTestElement configElement) {
+        return true;
+    }
 }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1310078&r1=1310077&r2=1310078&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Thu Apr  5 21:35:32 2012
@@ -76,6 +76,11 @@ JMeter now expands the Test Plan tree to
 <p>
 Graph Full Results Listener has been removed.
 </p>
+
+<p>
+Plugin writers : Sampler interface contains a new method (see Bug 53042):<br/>
+public boolean applies(ConfigTestElement configElement);
+</p>
 <!-- =================== Bug fixes =================== -->
 
 <h2>Bug fixes</h2>
@@ -189,6 +194,7 @@ Graph Full Results Listener has been rem
 <li>Bug 52674 - Proxy : Add a Sampler Creator to allow plugging HTTP based samplers
using potentially non textual POST Body (AMF, Silverlight...) and customizing them for others</li>
 <li>Bug 52934 - GUI : Open Test plan with the tree expanded to the testplan level and
no further and select the root of the tree</li>
 <li>Bug 52941 - Improvements of HTML report design generated by JMeter Ant task extra</li>
+<li>Bug 53042 - Introduce a new method in Sampler interface to allow Sampler to decide
wether a config element applies to Sampler</li>
 </ul>
 
 <h2>Non-functional changes</h2>



Mime
View raw message