jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1855128 - /jmeter/trunk/test/src/org/apache/jmeter/functions/TestSimpleFunctions.java
Date Sat, 09 Mar 2019 16:38:30 GMT
Author: pmouawad
Date: Sat Mar  9 16:38:29 2019
New Revision: 1855128

URL: http://svn.apache.org/viewvc?rev=1855128&view=rev
Log:
Bug 63241 - __threadGroupName causes a NullPointerException if called from non Test threads

Add a test
Bugzilla Id: 63241

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestSimpleFunctions.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestSimpleFunctions.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestSimpleFunctions.java?rev=1855128&r1=1855127&r2=1855128&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestSimpleFunctions.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestSimpleFunctions.java Sat Mar  9
16:38:29 2019
@@ -190,6 +190,20 @@ public class TestSimpleFunctions extends
             FileServer.getFileServer().setScriptName(null);
         }
     }
+    
+    @Test
+    public void testThreadGroupNameBug63241() throws Exception {
+        AbstractFunctionByKey function = new ThreadGroupName();
+        try {
+            HTTPSamplerProxy httpRequest = new HTTPSamplerProxy();
+            JMeterContext context = JMeterContextService.getContext();
+            context.setCurrentSampler(httpRequest);
+            String ret = function.execute(result, httpRequest);
+            assertEquals("", ret);
+        } finally {
+            FileServer.getFileServer().setScriptName(null);
+        }
+    }
 
     @Test
     public void testThreadGroupNameParameterCount() throws Exception {



Mime
View raw message