Author: sebb
Date: Tue Aug 14 04:34:57 2007
New Revision: 565710

URL: http://svn.apache.org/viewvc?view=rev&rev=565710
Log:
Add stop thread option to CSV Dataset

Modified:
    jakarta/jmeter/branches/rel-2-2/docs/changes.html
    jakarta/jmeter/branches/rel-2-2/docs/usermanual/component_reference.html
    
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSet.java
    
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetBeanInfo.java
    
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetResources.properties
    jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml
    jakarta/jmeter/branches/rel-2-2/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/branches/rel-2-2/docs/changes.html
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/docs/changes.html?view=diff&rev=565710&r1=565709&r2=565710
==============================================================================
--- jakarta/jmeter/branches/rel-2-2/docs/changes.html (original)
+++ jakarta/jmeter/branches/rel-2-2/docs/changes.html Tue Aug 14 04:34:57 2007
@@ -189,6 +189,21 @@
                                                </li>
                                                                        
 
+                                                                               
                <li     >
+                                                               Add link to 
Extending JMeter PDF
+                                               </li>
+                                                                       
+
+                                                                               
                <li     >
+                                                               Allow for 
quoted charset in Content-Type parsing
+                                               </li>
+                                                                       
+
+                                                                               
                <li     >
+                                                               Add stop thread 
option to CSV Dataset
+                                               </li>
+                                                                       
+
                                                </ul>
                                                                                
                                                                                
<h3     >
                                                                Version 2.3RC3

Modified: 
jakarta/jmeter/branches/rel-2-2/docs/usermanual/component_reference.html
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/docs/usermanual/component_reference.html?view=diff&rev=565710&r1=565709&r2=565710
==============================================================================
--- jakarta/jmeter/branches/rel-2-2/docs/usermanual/component_reference.html 
(original)
+++ jakarta/jmeter/branches/rel-2-2/docs/usermanual/component_reference.html 
Tue Aug 14 04:34:57 2007
@@ -6204,8 +6204,14 @@
        
                                                                                
                <p      >
                                                                
-       When the end of file is reached, and the recycle option is true, 
reading starts again with the first line of the file.
-       If the recycle option is false, then all the variables are set to 
+       When the end of file (EOF) is reached, and the recycle option is true, 
reading starts again with the first line of the file.
+       
+                                               </p>
+                                                                       
+       
+                                                                               
                <p      >
+                                                               
+       If the recycle option is false, and stopThread is false, then all the 
variables are set to 
                                                                                
                <b      >
                                                                &lt;EOF>
                                                </b>
@@ -6218,6 +6224,13 @@
        
                                                </p>
                                                                        
+       
+                                                                               
                <p      >
+                                                               
+       If the Recycle option is false, and Stop Thread is true, then reaching 
EOF will cause the thread to be stopped.
+       
+                                               </p>
+                                                                       
 
                                                                                
                                <p><b>Control Panel</b></p>
                                                <div align="center"><img 
width='360' height='196' src="../images/screenshots/csvdatasetconfig.png"></div>
@@ -6266,6 +6279,14 @@
                        <tr>
                        <td>Recycle on EOF?</td>
                        <td>                                            Should 
the file be re-read from the beginning on reaching EOF? (default is true)
+                       </td>
+                       <td>
+                                                                               
        Yes
+                                                               </td>
+               </tr>
+                       <tr>
+                       <td>Stop thread on EOF?</td>
+                       <td>                                            Should 
the thread be stopped on EOF, if Recycle is false? (default is false)
                        </td>
                        <td>
                                                                                
        Yes

Modified: 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSet.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSet.java?view=diff&rev=565710&r1=565709&r2=565710
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSet.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSet.java
 Tue Aug 14 04:34:57 2007
@@ -28,6 +28,7 @@
 import org.apache.jmeter.threads.JMeterVariables;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.logging.LoggingManager;
+import org.apache.jorphan.util.JMeterStopThreadException;
 import org.apache.jorphan.util.JOrphanUtils;
 import org.apache.log.Logger;
 
@@ -53,7 +54,9 @@
 
     private transient boolean recycle = true;
     
-       transient private String[] vars;
+    private transient boolean stopThread = false;
+
+    transient private String[] vars;
 
     private Object readResolve(){
         recycle = true;
@@ -84,6 +87,9 @@
                        }
                        // TODO - provide option to set unused variables ?
             } else {
+               if (getStopThread()) {
+                       throw new JMeterStopThreadException("End of file 
detected");
+               }
                 for (int a = 0; a < vars.length ; a++) {
                     threadVars.put(vars[a], EOFVALUE);
                 }
@@ -152,6 +158,14 @@
 
     public void setRecycle(boolean recycle) {
         this.recycle = recycle;
+    }
+
+    public boolean getStopThread() {
+        return stopThread;
+    }
+
+    public void setStopThread(boolean value) {
+        this.stopThread = value;
     }
 
 }

Modified: 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetBeanInfo.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetBeanInfo.java?view=diff&rev=565710&r1=565709&r2=565710
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetBeanInfo.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetBeanInfo.java
 Tue Aug 14 04:34:57 2007
@@ -34,6 +34,7 @@
     private static final String VARIABLE_NAMES = "variableNames";    
//$NON-NLS-1$
     private static final String DELIMITER = "delimiter";             
//$NON-NLS-1$
     private static final String RECYCLE = "recycle";                 
//$NON-NLS-1$
+    private static final String STOPTHREAD = "stopThread";           
//$NON-NLS-1$
 
     /**
         * @param beanClass
@@ -41,7 +42,7 @@
        public CSVDataSetBeanInfo() {
                super(CSVDataSet.class);
                createPropertyGroup("csv_data",             //$NON-NLS-1$
-                new String[] { FILENAME, FILE_ENCODING, VARIABLE_NAMES, 
DELIMITER, RECYCLE });
+                new String[] { FILENAME, FILE_ENCODING, VARIABLE_NAMES, 
DELIMITER, RECYCLE, STOPTHREAD });
         
                PropertyDescriptor p = property(FILENAME);
                p.setValue(NOT_UNDEFINED, Boolean.TRUE);
@@ -66,6 +67,11 @@
         p = property(RECYCLE);
         p.setValue(NOT_UNDEFINED, Boolean.TRUE);
         p.setValue(DEFAULT, Boolean.TRUE);
+        p.setValue(NOT_EXPRESSION, Boolean.TRUE);
+
+        p = property(STOPTHREAD);
+        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+        p.setValue(DEFAULT, Boolean.FALSE);
         p.setValue(NOT_EXPRESSION, Boolean.TRUE);
        }
 }

Modified: 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetResources.properties
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetResources.properties?view=diff&rev=565710&r1=565709&r2=565710
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetResources.properties
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/components/org/apache/jmeter/config/CSVDataSetResources.properties
 Tue Aug 14 04:34:57 2007
@@ -9,4 +9,6 @@
 delimiter.displayName=Delimiter (use '\\t' for tab)
 delimiter.shortDescription=Enter the delimiter ('\\t' for tab)
 recycle.displayName=Recycle on EOF ?
-recycle.shortDescription=Should the file be re-read from the start on reaching 
EOF ?
\ No newline at end of file
+recycle.shortDescription=Should the file be re-read from the start on reaching 
EOF ?
+stopThread.displayName=Stop thread on EOF ?
+stopThread.shortDescription=Should the thread be stopped on reaching EOF (if 
Recycle is false) ?
\ No newline at end of file

Modified: jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml?view=diff&rev=565710&r1=565709&r2=565710
==============================================================================
--- jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml (original)
+++ jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml Tue Aug 14 04:34:57 2007
@@ -43,6 +43,7 @@
 <li>Bug 42919 - Failure Message blank in CSV output [now records first 
non-blank message]</li>
 <li>Add link to Extending JMeter PDF</li>
 <li>Allow for quoted charset in Content-Type parsing</li>
+<li>Add stop thread option to CSV Dataset</li>
 </ul>
 
 <h3>Version 2.3RC3</h3>

Modified: 
jakarta/jmeter/branches/rel-2-2/xdocs/usermanual/component_reference.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/xdocs/usermanual/component_reference.xml?view=diff&rev=565710&r1=565709&r2=565710
==============================================================================
--- jakarta/jmeter/branches/rel-2-2/xdocs/usermanual/component_reference.xml 
(original)
+++ jakarta/jmeter/branches/rel-2-2/xdocs/usermanual/component_reference.xml 
Tue Aug 14 04:34:57 2007
@@ -1958,10 +1958,15 @@
        As a special case, the string "\t" (without quotes) is treated as a Tab.
        </p>
        <p>
-       When the end of file is reached, and the recycle option is true, 
reading starts again with the first line of the file.
-       If the recycle option is false, then all the variables are set to 
<b>&amp;lt;EOF&gt;</b> when the end of file is reached.
+       When the end of file (EOF) is reached, and the recycle option is true, 
reading starts again with the first line of the file.
+       </p>
+       <p>
+       If the recycle option is false, and stopThread is false, then all the 
variables are set to <b>&amp;lt;EOF&gt;</b> when the end of file is reached.
        This value can be changed by setting the JMeter property 
<b>csvdataset.eofstring</b>.
        </p>
+       <p>
+       If the Recycle option is false, and Stop Thread is true, then reaching 
EOF will cause the thread to be stopped.
+       </p>
 </description>
 <properties>
   <property name="Name" required="">Descriptive name for this element that is 
shown in the tree.</property>
@@ -1975,6 +1980,7 @@
   If there are fewer values on the line than there are variables the remaining 
variables are not updated -
   so they will retain their previous value (if any).</property>
   <property name="Recycle on EOF?" required="Yes">Should the file be re-read 
from the beginning on reaching EOF? (default is true)</property>
+  <property name="Stop thread on EOF?" required="Yes">Should the thread be 
stopped on EOF, if Recycle is false? (default is false)</property>
 </properties>
 </component>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to