You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by GitBox <gi...@apache.org> on 2021/12/17 12:05:55 UTC

[GitHub] [jmeter] vlsi commented on a change in pull request #679: Add variable support for Include Controller

vlsi commented on a change in pull request #679:
URL: https://github.com/apache/jmeter/pull/679#discussion_r771344954



##########
File path: src/components/src/main/java/org/apache/jmeter/control/IncludeController.java
##########
@@ -92,6 +94,32 @@ public String getIncludePath() {
         return this.getPropertyAsString(INCLUDE_PATH);
     }
 
+    /**
+     * return the JMX file path with function support.
+     * @return the JMX file path with function support
+     */
+    public String getIncludePathAsFunction()
+    {
+        String jmxfile = this.getPropertyAsString(INCLUDE_PATH);
+        CompoundVariable masterFunction = new CompoundVariable();
+        try{
+            log.debug("Trying to evaluate 'Include Path' as an expression: {}", jmxfile);
+            masterFunction.setParameters(jmxfile);
+            if(masterFunction.hasFunction()) {
+                String jmxfileCompile = masterFunction.getFunction().execute();
+                log.debug("The value of 'Include Path' is computed as: {}", jmxfileCompile);
+                return jmxfileCompile;
+            }
+        } catch (InvalidVariableException e)
+        {
+            log.warn("Invalid variable in 'Include Path' {}. See log for details", jmxfile);
+            log.warn("Invalid variable in 'Include Path':", e);
+        }
+
+        log.debug("The value of 'Include Path' is simple string: {}", jmxfile);
+        return jmxfile;
+    }

Review comment:
       I think this is the wrong approach to attack the problem. It looks like `includePath.setRunningVersion(true)`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org