You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/03/04 14:32:30 UTC
svn commit: r1785491 -
/jmeter/trunk/test/src/org/apache/jmeter/functions/TestGroovyFunction.java
Author: pmouawad
Date: Sat Mar 4 14:32:30 2017
New Revision: 1785491
URL: http://svn.apache.org/viewvc?rev=1785491&view=rev
Log:
Test file loading
Modified:
jmeter/trunk/test/src/org/apache/jmeter/functions/TestGroovyFunction.java
Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestGroovyFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestGroovyFunction.java?rev=1785491&r1=1785490&r2=1785491&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestGroovyFunction.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestGroovyFunction.java Sat Mar 4 14:32:30 2017
@@ -29,6 +29,7 @@ import org.apache.jmeter.samplers.Sample
import org.apache.jmeter.threads.JMeterContext;
import org.apache.jmeter.threads.JMeterContextService;
import org.apache.jmeter.threads.JMeterVariables;
+import org.apache.jmeter.util.JMeterUtils;
import org.junit.Before;
import org.junit.Test;
@@ -98,4 +99,13 @@ public class TestGroovyFunction extends
assertEquals("/query.cgi?s1=1&s2=2&s3=3", ret);
assertEquals(ret,vars.getObject("URL"));
}
+
+ @Test
+ public void testFileLoading() throws Exception {
+ JMeterUtils.setProperty("groovy.utilities", "bin/utility.groovy");
+ params.add(new CompoundVariable("factorial(10)"));
+ function.setParameters(params);
+ String ret = function.execute(result, null);
+ assertEquals("3628800", ret);
+ }
}