jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1310845 - /jmeter/trunk/src/core/org/apache/jmeter/control/TransactionSampler.java
Date Sat, 07 Apr 2012 19:55:24 GMT
Author: pmouawad
Date: Sat Apr  7 19:55:24 2012
New Revision: 1310845

URL: http://svn.apache.org/viewvc?rev=1310845&view=rev
Log:
Bug 53042 - Introduce a new Interface to be implemented by AbstractSampler to allow Sampler
to decide wether a config element applies to Sampler

Make TransactionSampler only merge 1 config elements

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/TransactionSampler.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/TransactionSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionSampler.java?rev=1310845&r1=1310844&r2=1310845&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/TransactionSampler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/TransactionSampler.java Sat Apr  7 19:55:24
2012
@@ -23,10 +23,16 @@
 package org.apache.jmeter.control;
 
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.samplers.AbstractSampler;
 import org.apache.jmeter.samplers.Entry;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.samplers.Sampler;
+import org.apache.jmeter.testelement.TestElement;
 
 /**
  * Transaction Sampler class to measure transaction times
@@ -35,6 +41,10 @@ import org.apache.jmeter.samplers.Sample
 public class TransactionSampler extends AbstractSampler {
     private static final long serialVersionUID = 240L;
 
+    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
+            Arrays.asList(new String[]{
+                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
+
     private boolean transactionDone = false;
 
     private TransactionController transactionController;
@@ -127,4 +137,13 @@ public class TransactionSampler extends 
     protected void setSubSampler(Sampler subSampler) {
         this.subSampler = subSampler;
     }
+
+    /**
+     * @see org.apache.jmeter.samplers.AbstractSampler#applies(org.apache.jmeter.config.ConfigTestElement)
+     */
+    @Override
+    public boolean applies(ConfigTestElement configElement) {
+        String guiClass = configElement.getProperty(TestElement.GUI_CLASS).getStringValue();
+        return APPLIABLE_CONFIG_CLASSES.contains(guiClass);
+    }
 }



Mime
View raw message