jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1310842 - /jmeter/trunk/src/components/org/apache/jmeter/sampler/TestAction.java
Date Sat, 07 Apr 2012 19:54:25 GMT
Author: pmouawad
Date: Sat Apr  7 19:54:25 2012
New Revision: 1310842

URL: http://svn.apache.org/viewvc?rev=1310842&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 Test Sampler only merge 1 config elements

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

Modified: jmeter/trunk/src/components/org/apache/jmeter/sampler/TestAction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/sampler/TestAction.java?rev=1310842&r1=1310841&r2=1310842&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/sampler/TestAction.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/sampler/TestAction.java Sat Apr  7 19:54:25
2012
@@ -17,9 +17,15 @@
  */
 package org.apache.jmeter.sampler;
 
+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.testelement.TestElement;
 import org.apache.jmeter.testelement.property.IntegerProperty;
 import org.apache.jmeter.testelement.property.StringProperty;
 import org.apache.jmeter.threads.JMeterContext;
@@ -38,6 +44,10 @@ public class TestAction extends Abstract
 
     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"}));
+
     // Actions
     public final static int STOP = 0;
     public final static int PAUSE = 1;
@@ -131,4 +141,13 @@ public class TestAction extends Abstract
     public String getDurationAsString() {
         return getPropertyAsString(DURATION);
     }
+
+    /**
+     * @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);
+    }
 }
\ No newline at end of file



Mime
View raw message