jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1812445 - in /jmeter/trunk: src/functions/org/apache/jmeter/functions/SplitFunction.java test/src/org/apache/jmeter/functions/SplitFunctionTest.java xdocs/changes.xml
Date Tue, 17 Oct 2017 19:31:46 GMT
Author: pmouawad
Date: Tue Oct 17 19:31:46 2017
New Revision: 1812445

URL: http://svn.apache.org/viewvc?rev=1812445&view=rev
Log:
Bug 61628 - If split string has empty separator default separator is not used 
Bugzilla Id: 61628

Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/SplitFunctionTest.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java?rev=1812445&r1=1812444&r2=1812445&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java Tue Oct 17 19:31:46
2017
@@ -74,6 +74,7 @@ public class SplitFunction extends Abstr
     private Object[] values;
 
     public SplitFunction() {
+        super();
     }
 
     /** {@inheritDoc} */
@@ -87,7 +88,8 @@ public class SplitFunction extends Abstr
         String splitString = ",";
 
         if (values.length > 2) { // Split string provided
-            splitString = ((CompoundVariable) values[2]).execute();
+            String newSplitString = ((CompoundVariable) values[2]).execute();
+            splitString = newSplitString.length() > 0 ? newSplitString : splitString;
         }
         if (log.isDebugEnabled()){
             log.debug("Split "+stringToSplit+ " using "+ splitString+ " into "+varNamePrefix);

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/SplitFunctionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/SplitFunctionTest.java?rev=1812445&r1=1812444&r2=1812445&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/SplitFunctionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/SplitFunctionTest.java Tue Oct 17 19:31:46
2017
@@ -65,7 +65,16 @@ public class SplitFunctionTest extends J
         assertEquals("b", vars.get("VAR1_2"));
         assertEquals("c", vars.get("VAR1_3"));
         assertNull(vars.get("VAR1_4"));
-
+        
+        split = splitParams(src, "VAR1", "");
+        assertEquals(src, split.execute());
+        assertEquals(src, vars.get("VAR1"));
+        assertEquals("3", vars.get("VAR1_n"));
+        assertEquals("a", vars.get("VAR1_1"));
+        assertEquals("b", vars.get("VAR1_2"));
+        assertEquals("c", vars.get("VAR1_3"));
+        assertNull(vars.get("VAR1_4"));
+        
         split = splitParams(src, "VAR2", ",");
         assertEquals(src, split.execute());
         assertEquals(src, vars.get("VAR2"));

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1812445&r1=1812444&r2=1812445&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Tue Oct 17 19:31:46 2017
@@ -103,6 +103,7 @@ Summary
 <ul>
     <li><bug>61561</bug>Function helper dialog should display exception
in result</li>
     <li><bug>61593</bug>Remove Detail, Add, Add from Clipboard, Delete
buttons in Function Helper GUI</li>
+    <li><bug>61628</bug>If split string has empty separator default separator
is not used </li>
 </ul>
 
 <h3>I18N</h3>



Mime
View raw message