sebb 2004/10/12 17:52:05
Modified: src/core/org/apache/jmeter/control Tag: rel-2_0
WhileController.java
Log:
Don't enter while loop if condition is false
Revision Changes Path
No revision
No revision
1.1.2.3 +23 -2
jakarta-jmeter/src/core/org/apache/jmeter/control/WhileController.java
Index: WhileController.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/control/WhileController.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- WhileController.java 8 Oct 2004 22:00:29 -0000 1.1.2.2
+++ WhileController.java 13 Oct 2004 00:52:05 -0000 1.1.2.3
@@ -88,6 +88,27 @@
}
}
+ /*
+ * This skips controller entirely if the condition is false
+ *
+ * TODO consider checking for previous sampler failure here -
+ * would need to distinguish this from previous failure *inside* loop
+ *
+ */
+ public Sampler next()
+ {
+ // Don't enter if condition false
+ if("false".equalsIgnoreCase(getCondition()))// $NON-NLS-1$
+ {
+ reInitialize();
+ return null;
+ }
+ else
+ {
+ return super.next();
+ }
+ }
+
/**
* @param string the condition to save
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]