jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1380892 - /jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java
Date Tue, 04 Sep 2012 21:23:30 GMT
Author: pmouawad
Date: Tue Sep  4 21:23:30 2012
New Revision: 1380892

URL: http://svn.apache.org/viewvc?rev=1380892&view=rev
Log:
Rollback is Numeric => Don't understand why isNumber generates this failure:
     [java] 1) SFFTest5(org.apache.jmeter.functions.PackageTest)junit.framework.AssertionFailedError:
Should have thrown JMeterStopThreadException
     [java]     at org.apache.jmeter.functions.PackageTest.SFFTest5(PackageTest.java:457)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:236)
     [java] 

Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java?rev=1380892&r1=1380891&r2=1380892&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java Tue Sep  4
21:23:30 2012
@@ -143,10 +143,10 @@ public class StringFromFile extends Abst
         String start = "";
         if (values.length >= PARAM_START) {
             start = ((CompoundVariable) values[PARAM_START - 1]).execute();
-            if(StringUtils.isNumeric(start)) {
+            try {
                 myStart = Integer.parseInt(start);
-            } else {
-                myStart = COUNT_UNUSED;// Don't process invalid numbers                 
  
+            } catch (NumberFormatException e) {
+                myStart = COUNT_UNUSED;// Don't process invalid numbers
             }
         }
         // Have we used myCurrent yet?
@@ -157,11 +157,11 @@ public class StringFromFile extends Abst
 
         if (values.length >= PARAM_END) {
             String tmp = ((CompoundVariable) values[PARAM_END - 1]).execute();
-            if(StringUtils.isNumeric(start)) {
+            try {
                 myEnd = Integer.parseInt(tmp);
-            } else {
+            } catch (NumberFormatException e) {
                 myEnd = COUNT_UNUSED;// Don't process invalid numbers
-                // (including "")
+                                        // (including "")
             }
         }
 



Mime
View raw message