jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1332351 - /jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
Date Mon, 30 Apr 2012 19:26:27 GMT
Author: pmouawad
Date: Mon Apr 30 19:26:26 2012
New Revision: 1332351

URL: http://svn.apache.org/viewvc?rev=1332351&view=rev
Log:
Bug 53164 - New System Sampler
Fixed mergeability with config elements

Modified:
    jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java

Modified: jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java?rev=1332351&r1=1332350&r2=1332351&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
(original)
+++ jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
Mon Apr 30 19:26:26 2012
@@ -21,15 +21,20 @@ package org.apache.jmeter.protocol.syste
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.jmeter.config.Argument;
 import org.apache.jmeter.config.Arguments;
+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.services.FileServer;
+import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.testelement.property.TestElementProperty;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
@@ -55,6 +60,10 @@ public class SystemSampler extends Abstr
      */
     private static final Logger log = LoggingManager.getLoggerForClass();
 
+    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
+            Arrays.asList(new String[]{
+                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
+
     /**
      * Create a SystemSampler.
      */
@@ -142,6 +151,16 @@ public class SystemSampler extends Abstr
         }
         return results;
     }
+    
+    
+    /**
+     * @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);
+    }
 
     /**
      * 
@@ -226,5 +245,4 @@ public class SystemSampler extends Abstr
     public int getExpectedReturnCode() {
         return getPropertyAsInt(EXPECTED_RETURN_CODE);
     }
-
-}
+}
\ No newline at end of file



Mime
View raw message