jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1310854 - /jmeter/trunk/src/components/org/apache/jmeter/sampler/DebugSampler.java
Date Sat, 07 Apr 2012 20:25:53 GMT
Author: pmouawad
Date: Sat Apr  7 20:25:52 2012
New Revision: 1310854

URL: http://svn.apache.org/viewvc?rev=1310854&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 DebugSampler only merge 1 config element

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/sampler/DebugSampler.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/sampler/DebugSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/sampler/DebugSampler.java?rev=1310854&r1=1310853&r2=1310854&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/sampler/DebugSampler.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/sampler/DebugSampler.java Sat Apr  7 20:25:52
2012
@@ -19,15 +19,19 @@
 package org.apache.jmeter.sampler;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashSet;
 import java.util.Map;
 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.testbeans.TestBean;
+import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.util.JMeterUtils;
 
@@ -39,6 +43,10 @@ public class DebugSampler extends Abstra
 
     private static final long serialVersionUID = 232L;
 
+    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
+            Arrays.asList(new String[]{
+                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
+
     private boolean displayJMeterVariables;
 
     private boolean displayJMeterProperties;
@@ -122,4 +130,13 @@ public class DebugSampler extends Abstra
     public void setDisplaySystemProperties(boolean displaySystemProperties) {
         this.displaySystemProperties = displaySystemProperties;
     }
+
+    /**
+     * @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